diff --git a/examples/json/TemplateEditRequest.json b/examples/json/TemplateEditRequest.json new file mode 100644 index 000000000..32bedcf1f --- /dev/null +++ b/examples/json/TemplateEditRequest.json @@ -0,0 +1,7 @@ +{ + "allow_form_view": false, + "title": "Test Title", + "subject": "Test Subject", + "message": "Test Message", + "cc_roles": ["one", "two"] +} \ No newline at end of file diff --git a/examples/json/TemplateEditResponse.json b/examples/json/TemplateEditResponse.json new file mode 100644 index 000000000..1a978e1d7 --- /dev/null +++ b/examples/json/TemplateEditResponse.json @@ -0,0 +1,5 @@ +{ + "template": { + "template_id": "f57db65d3f933b5316d398057a36176831451a35" + } +} \ No newline at end of file diff --git a/openapi-raw.yaml b/openapi-raw.yaml index fc7989ef0..ee45262aa 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -65,6 +65,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -167,6 +169,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -263,6 +267,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 409_example: $ref: '#/components/examples/Error409Response' 4XX_example: @@ -363,6 +369,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -462,6 +470,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -560,10 +570,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -671,10 +681,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -763,6 +773,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -867,6 +879,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -977,6 +991,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1080,6 +1096,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1186,6 +1204,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -1284,12 +1304,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1386,10 +1406,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1475,10 +1495,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1570,12 +1590,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1669,6 +1689,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -1852,6 +1874,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1945,6 +1969,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -2040,6 +2066,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -2129,6 +2157,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -2245,6 +2275,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -2338,6 +2370,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -2444,6 +2478,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -2540,10 +2576,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -2637,6 +2673,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: [] @@ -2732,6 +2770,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: [] @@ -2827,6 +2867,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -2923,12 +2965,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3025,6 +3067,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -3119,6 +3163,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -3227,10 +3273,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3330,10 +3376,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3444,12 +3490,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3561,12 +3607,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3675,12 +3721,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3789,12 +3835,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3904,14 +3950,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4009,14 +4055,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4121,14 +4167,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4226,6 +4272,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 410_example: @@ -4346,6 +4394,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 409_example: $ref: '#/components/examples/Error409Response' 4XX_example: @@ -4445,6 +4495,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -4552,14 +4604,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4652,6 +4704,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -4756,10 +4810,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4968,6 +5022,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -5077,6 +5133,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -5175,6 +5233,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5255,6 +5315,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5342,6 +5404,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -5439,6 +5503,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5535,10 +5601,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5634,6 +5700,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5747,10 +5815,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5849,6 +5917,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -5963,10 +6033,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6072,6 +6142,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -6179,6 +6251,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -6288,6 +6362,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -6383,6 +6459,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -6435,6 +6513,80 @@ paths: seo: title: '_t__TemplateDelete::SEO::TITLE' description: '_t__TemplateDelete::SEO::DESCRIPTION' + '/template/edit/{template_id}': + post: + tags: + - Template + summary: '_t__TemplateEdit::SUMMARY' + description: '_t__TemplateEdit::DESCRIPTION' + operationId: templateEdit + parameters: + - + name: template_id + in: path + description: '_t__TemplateEdit::TEMPLATE_ID' + required: true + schema: + type: string + example: f57db65d3f933b5316d398057a36176831451a35 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateEditRequest' + examples: + example: + $ref: '#/components/examples/TemplateEditRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/TemplateEditRequest' + responses: + '200': + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateEditResponse' + examples: + example: + $ref: '#/components/examples/TemplateEditResponse' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + - + oauth2: + - template_access '/template/files/{template_id}': get: tags: @@ -6494,14 +6646,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 422_example: $ref: '#/components/examples/Error422Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6598,14 +6750,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 422_example: $ref: '#/components/examples/Error422Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6709,14 +6861,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 422_example: $ref: '#/components/examples/Error422Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6813,10 +6965,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6933,10 +7085,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7042,6 +7194,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -7152,12 +7306,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7263,6 +7417,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7368,6 +7524,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -7472,12 +7630,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7583,6 +7741,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -10093,6 +10253,29 @@ components: type: boolean default: false type: object + TemplateEditRequest: + required: [] + properties: + cc_roles: + description: '_t__TemplateEdit::CC_ROLES' + type: array + items: + type: string + allow_form_view: + description: '_t__TemplateEdit::ALLOW_FORM_VIEW' + type: boolean + title: + description: '_t__TemplateEdit::TITLE' + type: string + subject: + description: '_t__TemplateEdit::SUBJECT' + type: string + maxLength: 200 + message: + description: '_t__TemplateEdit::MESSAGE' + type: string + maxLength: 5000 + type: object TemplateRemoveUserRequest: properties: account_id: @@ -12503,6 +12686,14 @@ components: type: string default: text type: object + TemplateEditResponseTemplate: + description: '_t__TemplateEditResponseTemplate::DESCRIPTION' + properties: + template_id: + description: '_t__TemplateResponse::TEMPLATE_ID' + type: string + type: object + x-internal-class: true TemplateResponseFieldAvgTextLength: description: '_t__TemplateResponseFieldAvgTextLength::DESCRIPTION' properties: @@ -12685,9 +12876,13 @@ components: required: - template_id properties: - template_id: - description: '_t__TemplateResponse::TEMPLATE_ID' - type: string + template: + $ref: '#/components/schemas/TemplateEditResponseTemplate' + warnings: + description: '_t__WarningResponse::LIST_DESCRIPTION' + type: array + items: + $ref: '#/components/schemas/WarningResponse' type: object TemplateGetResponse: required: @@ -13012,6 +13207,10 @@ components: summary: 'Form Fields Per Document and Rules Example' value: $ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldRules.json + TemplateEditRequest: + summary: '_t__TemplateEditRequestExample::SUMMARY' + value: + $ref: examples/json/TemplateEditRequest.json TemplateRemoveUserRequest: summary: 'Default Example' value: @@ -13308,6 +13507,10 @@ components: summary: '_t__TemplateCreateEmbeddedDraftResponseExample::SUMMARY' value: $ref: examples/json/TemplateCreateEmbeddedDraftResponse.json + TemplateEditResponse: + summary: '_t__TemplateEditResponseExample::SUMMARY' + value: + $ref: examples/json/TemplateEditResponse.json TemplateGetResponse: summary: '_t__TemplateGetResponseExample::SUMMARY' value: diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index c1773e744..18dca6081 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -65,6 +65,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -173,6 +175,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -269,6 +273,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 409_example: $ref: '#/components/examples/Error409Response' 4XX_example: @@ -369,6 +375,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -468,6 +476,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -566,10 +576,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -677,10 +687,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -769,6 +779,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -873,6 +885,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -983,6 +997,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1086,6 +1102,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1192,6 +1210,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -1290,12 +1310,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1392,10 +1412,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1481,10 +1501,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1576,12 +1596,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1675,6 +1695,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -1858,6 +1880,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1951,6 +1975,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -2046,6 +2072,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -2135,6 +2163,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -2251,6 +2281,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -2344,6 +2376,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -2450,6 +2484,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -2546,10 +2582,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -2643,6 +2679,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: [] @@ -2738,6 +2776,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: [] @@ -2836,6 +2876,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -2935,12 +2977,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3040,6 +3082,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -3143,6 +3187,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -3251,10 +3297,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3354,10 +3400,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3471,12 +3517,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3591,12 +3637,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3708,12 +3754,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3825,12 +3871,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3943,14 +3989,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4051,14 +4097,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4166,14 +4212,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4271,6 +4317,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 410_example: @@ -4394,6 +4442,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 409_example: $ref: '#/components/examples/Error409Response' 4XX_example: @@ -4493,6 +4543,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -4603,14 +4655,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4708,6 +4760,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -4812,10 +4866,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5029,6 +5083,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -5138,6 +5194,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -5236,6 +5294,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5316,6 +5376,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5403,6 +5465,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -5500,6 +5564,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5596,10 +5662,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5695,6 +5761,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5808,10 +5876,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5910,6 +5978,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -6024,10 +6094,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6133,6 +6203,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -6240,6 +6312,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -6349,6 +6423,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -6444,6 +6520,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -6496,6 +6574,80 @@ paths: seo: title: 'Delete Template | API Documentation | Dropbox Sign for Developers' description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to completely delete a template from the account, click here.' + '/template/edit/{template_id}': + post: + tags: + - Template + summary: 'Edit Template' + description: 'Edit template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged.' + operationId: templateEdit + parameters: + - + name: template_id + in: path + description: 'The ID of the template to update.' + required: true + schema: + type: string + example: f57db65d3f933b5316d398057a36176831451a35 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateEditRequest' + examples: + example: + $ref: '#/components/examples/TemplateEditRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/TemplateEditRequest' + responses: + '200': + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateEditResponse' + examples: + example: + $ref: '#/components/examples/TemplateEditResponse' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + - + oauth2: + - template_access '/template/files/{template_id}': get: tags: @@ -6558,14 +6710,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 422_example: $ref: '#/components/examples/Error422Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6665,14 +6817,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 422_example: $ref: '#/components/examples/Error422Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6779,14 +6931,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 422_example: $ref: '#/components/examples/Error422Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6883,10 +7035,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7006,10 +7158,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7115,6 +7267,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -7237,12 +7391,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7348,6 +7502,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7456,6 +7612,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -7563,12 +7721,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7677,6 +7835,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -10730,6 +10890,29 @@ components: type: boolean default: false type: object + TemplateEditRequest: + required: [] + properties: + cc_roles: + description: 'The CC roles that must be assigned when using the template to send a signature request.' + type: array + items: + type: string + allow_form_view: + description: 'The CC roles that must be assigned when using the template to send a signature request. If set to `true` all the form fields on template document must have non-empty names.' + type: boolean + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + subject: + description: 'The new default template email subject.' + type: string + maxLength: 200 + message: + description: 'The new default template email message.' + type: string + maxLength: 5000 + type: object TemplateRemoveUserRequest: properties: account_id: @@ -13427,6 +13610,14 @@ components: type: string default: text type: object + TemplateEditResponseTemplate: + description: 'Template object with parameters: `template_id`.' + properties: + template_id: + description: 'The id of the Template.' + type: string + type: object + x-internal-class: true TemplateResponseFieldAvgTextLength: description: 'Average text length in this field.' properties: @@ -13609,9 +13800,13 @@ components: required: - template_id properties: - template_id: - description: 'The id of the Template.' - type: string + template: + $ref: '#/components/schemas/TemplateEditResponseTemplate' + warnings: + description: 'A list of warnings.' + type: array + items: + $ref: '#/components/schemas/WarningResponse' type: object TemplateGetResponse: required: @@ -13936,6 +14131,10 @@ components: summary: 'Form Fields Per Document and Rules Example' value: $ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldRules.json + TemplateEditRequest: + summary: 'Edit template request example' + value: + $ref: examples/json/TemplateEditRequest.json TemplateRemoveUserRequest: summary: 'Default Example' value: @@ -14232,6 +14431,10 @@ components: summary: 'Create Embedded Draft Template' value: $ref: examples/json/TemplateCreateEmbeddedDraftResponse.json + TemplateEditResponse: + summary: 'Edit template response example.' + value: + $ref: examples/json/TemplateEditResponse.json TemplateGetResponse: summary: 'Get Template' value: diff --git a/openapi.yaml b/openapi.yaml index ea06c16f1..78cbcb497 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -65,6 +65,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -173,6 +175,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -269,6 +273,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 409_example: $ref: '#/components/examples/Error409Response' 4XX_example: @@ -369,6 +375,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -468,6 +476,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -566,10 +576,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -677,10 +687,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -769,6 +779,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -873,6 +885,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -983,6 +997,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1086,6 +1102,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1192,6 +1210,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -1290,12 +1310,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1392,10 +1412,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1481,10 +1501,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1576,12 +1596,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1675,6 +1695,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -1858,6 +1880,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -1951,6 +1975,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -2046,6 +2072,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -2135,6 +2163,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -2251,6 +2281,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -2344,6 +2376,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -2450,6 +2484,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -2546,10 +2582,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -2643,6 +2679,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: [] @@ -2738,6 +2776,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: [] @@ -2836,6 +2876,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -2935,12 +2977,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3040,6 +3082,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -3143,6 +3187,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -3251,10 +3297,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3354,10 +3400,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3471,12 +3517,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3591,12 +3637,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3708,12 +3754,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3825,12 +3871,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -3943,14 +3989,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4051,14 +4097,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4166,14 +4212,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4271,6 +4317,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 410_example: @@ -4394,6 +4442,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 409_example: $ref: '#/components/examples/Error409Response' 4XX_example: @@ -4493,6 +4543,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -4603,14 +4655,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 410_example: $ref: '#/components/examples/Error410Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -4708,6 +4760,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -4812,10 +4866,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5029,6 +5083,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -5138,6 +5194,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -5236,6 +5294,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5316,6 +5376,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5403,6 +5465,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -5500,6 +5564,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5596,10 +5662,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5695,6 +5761,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5808,10 +5876,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -5910,6 +5978,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -6024,10 +6094,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6133,6 +6203,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -6240,6 +6312,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -6349,6 +6423,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -6444,6 +6520,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -6496,6 +6574,80 @@ paths: seo: title: 'Delete Template | API Documentation | Dropbox Sign for Developers' description: 'The RESTful Dropbox Sign API easily allows you to build custom integrations. To find out how to completely delete a template from the account, click here.' + '/template/edit/{template_id}': + post: + tags: + - Template + summary: 'Edit Template' + description: 'Edit template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged.' + operationId: templateEdit + parameters: + - + name: template_id + in: path + description: 'The ID of the template to update.' + required: true + schema: + type: string + example: f57db65d3f933b5316d398057a36176831451a35 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateEditRequest' + examples: + example: + $ref: '#/components/examples/TemplateEditRequest' + multipart/form-data: + schema: + $ref: '#/components/schemas/TemplateEditRequest' + responses: + '200': + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/TemplateEditResponse' + examples: + example: + $ref: '#/components/examples/TemplateEditResponse' + '4XX': + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400Response' + 401_example: + $ref: '#/components/examples/Error401Response' + 402_example: + $ref: '#/components/examples/Error402Response' + 403_example: + $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' + 4XX_example: + $ref: '#/components/examples/Error4XXResponse' + security: + - + api_key: [] + - + oauth2: + - template_access '/template/files/{template_id}': get: tags: @@ -6558,14 +6710,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 422_example: $ref: '#/components/examples/Error422Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6665,14 +6817,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 422_example: $ref: '#/components/examples/Error422Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6779,14 +6931,14 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' 422_example: $ref: '#/components/examples/Error422Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -6883,10 +7035,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 404_example: - $ref: '#/components/examples/Error404Response' 429_example: $ref: '#/components/examples/Error429Response' + 404_example: + $ref: '#/components/examples/Error404Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7006,10 +7158,10 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' - 409_example: - $ref: '#/components/examples/Error409Response' 429_example: $ref: '#/components/examples/Error429Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7115,6 +7267,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 4XX_example: @@ -7237,12 +7391,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7348,6 +7502,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7456,6 +7612,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -7563,12 +7721,12 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: $ref: '#/components/examples/Error409Response' - 429_example: - $ref: '#/components/examples/Error429Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -7677,6 +7835,8 @@ paths: $ref: '#/components/examples/Error402Response' 403_example: $ref: '#/components/examples/Error403Response' + 429_example: + $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' 409_example: @@ -10708,6 +10868,29 @@ components: type: boolean default: false type: object + TemplateEditRequest: + required: [] + properties: + cc_roles: + description: 'The CC roles that must be assigned when using the template to send a signature request.' + type: array + items: + type: string + allow_form_view: + description: 'The CC roles that must be assigned when using the template to send a signature request. If set to `true` all the form fields on template document must have non-empty names.' + type: boolean + title: + description: 'The title you want to assign to the SignatureRequest.' + type: string + subject: + description: 'The new default template email subject.' + type: string + maxLength: 200 + message: + description: 'The new default template email message.' + type: string + maxLength: 5000 + type: object TemplateRemoveUserRequest: properties: account_id: @@ -13405,6 +13588,14 @@ components: type: string default: text type: object + TemplateEditResponseTemplate: + description: 'Template object with parameters: `template_id`.' + properties: + template_id: + description: 'The id of the Template.' + type: string + type: object + x-internal-class: true TemplateResponseFieldAvgTextLength: description: 'Average text length in this field.' properties: @@ -13587,9 +13778,13 @@ components: required: - template_id properties: - template_id: - description: 'The id of the Template.' - type: string + template: + $ref: '#/components/schemas/TemplateEditResponseTemplate' + warnings: + description: 'A list of warnings.' + type: array + items: + $ref: '#/components/schemas/WarningResponse' type: object TemplateGetResponse: required: @@ -13914,6 +14109,10 @@ components: summary: 'Form Fields Per Document and Rules Example' value: $ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldRules.json + TemplateEditRequest: + summary: 'Edit template request example' + value: + $ref: examples/json/TemplateEditRequest.json TemplateRemoveUserRequest: summary: 'Default Example' value: @@ -14210,6 +14409,10 @@ components: summary: 'Create Embedded Draft Template' value: $ref: examples/json/TemplateCreateEmbeddedDraftResponse.json + TemplateEditResponse: + summary: 'Edit template response example.' + value: + $ref: examples/json/TemplateEditResponse.json TemplateGetResponse: summary: 'Get Template' value: diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index c8323efa3..52abfd302 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -193,6 +193,7 @@ Class | Method | HTTP request | Description *TemplateApi* | [**TemplateCreate**](docs/TemplateApi.md#templatecreate) | **POST** /template/create | Create Template *TemplateApi* | [**TemplateCreateEmbeddedDraft**](docs/TemplateApi.md#templatecreateembeddeddraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft *TemplateApi* | [**TemplateDelete**](docs/TemplateApi.md#templatedelete) | **POST** /template/delete/{template_id} | Delete Template +*TemplateApi* | [**TemplateEdit**](docs/TemplateApi.md#templateedit) | **POST** /template/edit/{template_id} | _t__TemplateEdit::SUMMARY *TemplateApi* | [**TemplateFiles**](docs/TemplateApi.md#templatefiles) | **GET** /template/files/{template_id} | Get Template Files *TemplateApi* | [**TemplateFilesAsDataUri**](docs/TemplateApi.md#templatefilesasdatauri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri *TemplateApi* | [**TemplateFilesAsFileUrl**](docs/TemplateApi.md#templatefilesasfileurl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url @@ -357,7 +358,9 @@ Class | Method | HTTP request | Description - [Model.TemplateCreateRequest](docs/TemplateCreateRequest.md) - [Model.TemplateCreateResponse](docs/TemplateCreateResponse.md) - [Model.TemplateCreateResponseTemplate](docs/TemplateCreateResponseTemplate.md) + - [Model.TemplateEditRequest](docs/TemplateEditRequest.md) - [Model.TemplateEditResponse](docs/TemplateEditResponse.md) + - [Model.TemplateEditResponseTemplate](docs/TemplateEditResponseTemplate.md) - [Model.TemplateGetResponse](docs/TemplateGetResponse.md) - [Model.TemplateListResponse](docs/TemplateListResponse.md) - [Model.TemplateRemoveUserRequest](docs/TemplateRemoveUserRequest.md) diff --git a/sdks/dotnet/docs/TemplateApi.md b/sdks/dotnet/docs/TemplateApi.md index f9c66e11c..e1fcd1957 100644 --- a/sdks/dotnet/docs/TemplateApi.md +++ b/sdks/dotnet/docs/TemplateApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**TemplateCreate**](TemplateApi.md#templatecreate) | **POST** /template/create | Create Template | | [**TemplateCreateEmbeddedDraft**](TemplateApi.md#templatecreateembeddeddraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft | | [**TemplateDelete**](TemplateApi.md#templatedelete) | **POST** /template/delete/{template_id} | Delete Template | +| [**TemplateEdit**](TemplateApi.md#templateedit) | **POST** /template/edit/{template_id} | _t__TemplateEdit::SUMMARY | | [**TemplateFiles**](TemplateApi.md#templatefiles) | **GET** /template/files/{template_id} | Get Template Files | | [**TemplateFilesAsDataUri**](TemplateApi.md#templatefilesasdatauri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri | | [**TemplateFilesAsFileUrl**](TemplateApi.md#templatefilesasfileurl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url | @@ -544,6 +545,68 @@ void (empty response body) - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **TemplateEdit** +> TemplateEditResponse TemplateEdit (string templateId, TemplateEditRequest templateEditRequest) + +_t__TemplateEdit::SUMMARY + +_t__TemplateEdit::DESCRIPTION + +### Example +```csharp +REPLACE_ME_WITH_EXAMPLE_FOR__TemplateEdit_C#_CODE +``` + +#### Using the TemplateEditWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // _t__TemplateEdit::SUMMARY + ApiResponse response = apiInstance.TemplateEditWithHttpInfo(templateId, templateEditRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling TemplateApi.TemplateEditWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **templateId** | **string** | _t__TemplateEdit::TEMPLATE_ID | | +| **templateEditRequest** | [**TemplateEditRequest**](TemplateEditRequest.md) | | | + +### Return type + +[**TemplateEditResponse**](TemplateEditResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/sdks/dotnet/docs/TemplateEditRequest.md b/sdks/dotnet/docs/TemplateEditRequest.md new file mode 100644 index 000000000..84eb4cc27 --- /dev/null +++ b/sdks/dotnet/docs/TemplateEditRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.TemplateEditRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CcRoles** | **List<string>** | _t__TemplateEdit::CC_ROLES | [optional] **AllowFormView** | **bool** | _t__TemplateEdit::ALLOW_FORM_VIEW | [optional] **Title** | **string** | _t__TemplateEdit::TITLE | [optional] **Subject** | **string** | _t__TemplateEdit::SUBJECT | [optional] **Message** | **string** | _t__TemplateEdit::MESSAGE | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/TemplateEditResponse.md b/sdks/dotnet/docs/TemplateEditResponse.md index 830c7a9ed..a4c211689 100644 --- a/sdks/dotnet/docs/TemplateEditResponse.md +++ b/sdks/dotnet/docs/TemplateEditResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateId** | **string** | The id of the Template. | +**Template** | [**TemplateEditResponseTemplate**](TemplateEditResponseTemplate.md) | | [optional] **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/TemplateEditResponseTemplate.md b/sdks/dotnet/docs/TemplateEditResponseTemplate.md new file mode 100644 index 000000000..b05b09dca --- /dev/null +++ b/sdks/dotnet/docs/TemplateEditResponseTemplate.md @@ -0,0 +1,11 @@ +# Dropbox.Sign.Model.TemplateEditResponseTemplate +_t__TemplateEditResponseTemplate::DESCRIPTION + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TemplateId** | **string** | The id of the Template. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs index f98f0671c..2693f7f5b 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs @@ -122,6 +122,31 @@ public interface ITemplateApiSync : IApiAccessor /// ApiResponse of Object(void) ApiResponse TemplateDeleteWithHttpInfo(string templateId, int operationIndex = 0); /// + /// _t__TemplateEdit::SUMMARY + /// + /// + /// _t__TemplateEdit::DESCRIPTION + /// + /// Thrown when fails to make API call + /// _t__TemplateEdit::TEMPLATE_ID + /// + /// Index associated with the operation. + /// TemplateEditResponse + TemplateEditResponse TemplateEdit(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0); + + /// + /// _t__TemplateEdit::SUMMARY + /// + /// + /// _t__TemplateEdit::DESCRIPTION + /// + /// Thrown when fails to make API call + /// _t__TemplateEdit::TEMPLATE_ID + /// + /// Index associated with the operation. + /// ApiResponse of TemplateEditResponse + ApiResponse TemplateEditWithHttpInfo(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0); + /// /// Get Template Files /// /// @@ -408,6 +433,33 @@ public interface ITemplateApiAsync : IApiAccessor /// Task of ApiResponse System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// + /// _t__TemplateEdit::SUMMARY + /// + /// + /// _t__TemplateEdit::DESCRIPTION + /// + /// Thrown when fails to make API call + /// _t__TemplateEdit::TEMPLATE_ID + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of TemplateEditResponse + System.Threading.Tasks.Task TemplateEditAsync(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// _t__TemplateEdit::SUMMARY + /// + /// + /// _t__TemplateEdit::DESCRIPTION + /// + /// Thrown when fails to make API call + /// _t__TemplateEdit::TEMPLATE_ID + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TemplateEditResponse) + System.Threading.Tasks.Task> TemplateEditWithHttpInfoAsync(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// /// Get Template Files /// /// @@ -1452,6 +1504,208 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string return localVarResponse; } + /// + /// _t__TemplateEdit::SUMMARY _t__TemplateEdit::DESCRIPTION + /// + /// Thrown when fails to make API call + /// _t__TemplateEdit::TEMPLATE_ID + /// + /// Index associated with the operation. + /// TemplateEditResponse + public TemplateEditResponse TemplateEdit(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = TemplateEditWithHttpInfo(templateId, templateEditRequest); + return localVarResponse.Data; + } + + /// + /// _t__TemplateEdit::SUMMARY _t__TemplateEdit::DESCRIPTION + /// + /// Thrown when fails to make API call + /// _t__TemplateEdit::TEMPLATE_ID + /// + /// Index associated with the operation. + /// ApiResponse of TemplateEditResponse + public Dropbox.Sign.Client.ApiResponse TemplateEditWithHttpInfo(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0) + { + // verify the required parameter 'templateId' is set + if (templateId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'templateId' when calling TemplateApi->TemplateEdit"); + } + + // verify the required parameter 'templateEditRequest' is set + if (templateEditRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'templateEditRequest' when calling TemplateApi->TemplateEdit"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = templateEditRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = templateEditRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + + localVarRequestOptions.Operation = "TemplateApi.TemplateEdit"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/template/edit/{template_id}", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TemplateEdit", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// _t__TemplateEdit::SUMMARY _t__TemplateEdit::DESCRIPTION + /// + /// Thrown when fails to make API call + /// _t__TemplateEdit::TEMPLATE_ID + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of TemplateEditResponse + public async System.Threading.Tasks.Task TemplateEditAsync(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateEditWithHttpInfoAsync(templateId, templateEditRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// _t__TemplateEdit::SUMMARY _t__TemplateEdit::DESCRIPTION + /// + /// Thrown when fails to make API call + /// _t__TemplateEdit::TEMPLATE_ID + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (TemplateEditResponse) + public async System.Threading.Tasks.Task> TemplateEditWithHttpInfoAsync(string templateId, TemplateEditRequest templateEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'templateId' is set + if (templateId == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'templateId' when calling TemplateApi->TemplateEdit"); + } + + // verify the required parameter 'templateEditRequest' is set + if (templateEditRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'templateEditRequest' when calling TemplateApi->TemplateEdit"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = templateEditRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = templateEditRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + + localVarRequestOptions.Operation = "TemplateApi.TemplateEdit"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + // authentication (oauth2) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/template/edit/{template_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("TemplateEdit", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + /// /// Get Template Files Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. /// diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs index b6af36b3d..436068987 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs @@ -44,14 +44,12 @@ public enum TypeEnum /// [EnumMember(Value = "change-field-visibility")] ChangeFieldVisibility = 1, - FieldVisibility = ChangeFieldVisibility, /// /// Enum ChangeGroupVisibility for value: change-group-visibility /// [EnumMember(Value = "change-group-visibility")] - ChangeGroupVisibility = 2, - GroupVisibility = ChangeGroupVisibility + ChangeGroupVisibility = 2 } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditRequest.cs new file mode 100644 index 000000000..96a358fb8 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditRequest.cs @@ -0,0 +1,279 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// TemplateEditRequest + /// + [DataContract(Name = "TemplateEditRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class TemplateEditRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TemplateEditRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// _t__TemplateEdit::CC_ROLES. + /// _t__TemplateEdit::ALLOW_FORM_VIEW. + /// _t__TemplateEdit::TITLE. + /// _t__TemplateEdit::SUBJECT. + /// _t__TemplateEdit::MESSAGE. + public TemplateEditRequest(List ccRoles = default(List), bool allowFormView = default(bool), string title = default(string), string subject = default(string), string message = default(string)) + { + + this.CcRoles = ccRoles; + this.AllowFormView = allowFormView; + this.Title = title; + this.Subject = subject; + this.Message = message; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static TemplateEditRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of TemplateEditRequest"); + } + + return obj; + } + + /// + /// _t__TemplateEdit::CC_ROLES + /// + /// _t__TemplateEdit::CC_ROLES + [DataMember(Name = "cc_roles", EmitDefaultValue = true)] + public List CcRoles { get; set; } + + /// + /// _t__TemplateEdit::ALLOW_FORM_VIEW + /// + /// _t__TemplateEdit::ALLOW_FORM_VIEW + [DataMember(Name = "allow_form_view", EmitDefaultValue = true)] + public bool AllowFormView { get; set; } + + /// + /// _t__TemplateEdit::TITLE + /// + /// _t__TemplateEdit::TITLE + [DataMember(Name = "title", EmitDefaultValue = true)] + public string Title { get; set; } + + /// + /// _t__TemplateEdit::SUBJECT + /// + /// _t__TemplateEdit::SUBJECT + [DataMember(Name = "subject", EmitDefaultValue = true)] + public string Subject { get; set; } + + /// + /// _t__TemplateEdit::MESSAGE + /// + /// _t__TemplateEdit::MESSAGE + [DataMember(Name = "message", EmitDefaultValue = true)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TemplateEditRequest {\n"); + sb.Append(" CcRoles: ").Append(CcRoles).Append("\n"); + sb.Append(" AllowFormView: ").Append(AllowFormView).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" Subject: ").Append(Subject).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TemplateEditRequest); + } + + /// + /// Returns true if TemplateEditRequest instances are equal + /// + /// Instance of TemplateEditRequest to be compared + /// Boolean + public bool Equals(TemplateEditRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.CcRoles == input.CcRoles || + this.CcRoles != null && + input.CcRoles != null && + this.CcRoles.SequenceEqual(input.CcRoles) + ) && + ( + this.AllowFormView == input.AllowFormView || + this.AllowFormView.Equals(input.AllowFormView) + ) && + ( + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) + ) && + ( + this.Subject == input.Subject || + (this.Subject != null && + this.Subject.Equals(input.Subject)) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.CcRoles != null) + { + hashCode = (hashCode * 59) + this.CcRoles.GetHashCode(); + } + hashCode = (hashCode * 59) + this.AllowFormView.GetHashCode(); + if (this.Title != null) + { + hashCode = (hashCode * 59) + this.Title.GetHashCode(); + } + if (this.Subject != null) + { + hashCode = (hashCode * 59) + this.Subject.GetHashCode(); + } + if (this.Message != null) + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 200) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 200.", new[] { "Subject" }); + } + + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new[] { "Message" }); + } + + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "cc_roles", + Property = "CcRoles", + Type = "List", + Value = CcRoles, + }); + types.Add(new OpenApiType() + { + Name = "allow_form_view", + Property = "AllowFormView", + Type = "bool", + Value = AllowFormView, + }); + types.Add(new OpenApiType() + { + Name = "title", + Property = "Title", + Type = "string", + Value = Title, + }); + types.Add(new OpenApiType() + { + Name = "subject", + Property = "Subject", + Type = "string", + Value = Subject, + }); + types.Add(new OpenApiType() + { + Name = "message", + Property = "Message", + Type = "string", + Value = Message, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponse.cs index f76b5eb4f..891c5efdc 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponse.cs @@ -41,16 +41,13 @@ protected TemplateEditResponse() { } /// /// Initializes a new instance of the class. /// - /// The id of the Template. (required). - public TemplateEditResponse(string templateId = default(string)) + /// template. + /// A list of warnings.. + public TemplateEditResponse(TemplateEditResponseTemplate template = default(TemplateEditResponseTemplate), List warnings = default(List)) { - // to ensure "templateId" is required (not null) - if (templateId == null) - { - throw new ArgumentNullException("templateId is a required property for TemplateEditResponse and cannot be null"); - } - this.TemplateId = templateId; + this.Template = template; + this.Warnings = warnings; } /// @@ -70,11 +67,17 @@ public static TemplateEditResponse Init(string jsonData) } /// - /// The id of the Template. + /// Gets or Sets Template + /// + [DataMember(Name = "template", EmitDefaultValue = true)] + public TemplateEditResponseTemplate Template { get; set; } + + /// + /// A list of warnings. /// - /// The id of the Template. - [DataMember(Name = "template_id", IsRequired = true, EmitDefaultValue = true)] - public string TemplateId { get; set; } + /// A list of warnings. + [DataMember(Name = "warnings", EmitDefaultValue = true)] + public List Warnings { get; set; } /// /// Returns the string presentation of the object @@ -84,7 +87,8 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class TemplateEditResponse {\n"); - sb.Append(" TemplateId: ").Append(TemplateId).Append("\n"); + sb.Append(" Template: ").Append(Template).Append("\n"); + sb.Append(" Warnings: ").Append(Warnings).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -121,9 +125,15 @@ public bool Equals(TemplateEditResponse input) } return ( - this.TemplateId == input.TemplateId || - (this.TemplateId != null && - this.TemplateId.Equals(input.TemplateId)) + this.Template == input.Template || + (this.Template != null && + this.Template.Equals(input.Template)) + ) && + ( + this.Warnings == input.Warnings || + this.Warnings != null && + input.Warnings != null && + this.Warnings.SequenceEqual(input.Warnings) ); } @@ -136,9 +146,13 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.TemplateId != null) + if (this.Template != null) { - hashCode = (hashCode * 59) + this.TemplateId.GetHashCode(); + hashCode = (hashCode * 59) + this.Template.GetHashCode(); + } + if (this.Warnings != null) + { + hashCode = (hashCode * 59) + this.Warnings.GetHashCode(); } return hashCode; } @@ -158,10 +172,17 @@ public List GetOpenApiTypes() var types = new List(); types.Add(new OpenApiType() { - Name = "template_id", - Property = "TemplateId", - Type = "string", - Value = TemplateId, + Name = "template", + Property = "Template", + Type = "TemplateEditResponseTemplate", + Value = Template, + }); + types.Add(new OpenApiType() + { + Name = "warnings", + Property = "Warnings", + Type = "List", + Value = Warnings, }); return types; diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponseTemplate.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponseTemplate.cs new file mode 100644 index 000000000..64eb05a20 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponseTemplate.cs @@ -0,0 +1,166 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// _t__TemplateEditResponseTemplate::DESCRIPTION + /// + [DataContract(Name = "TemplateEditResponseTemplate")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class TemplateEditResponseTemplate : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TemplateEditResponseTemplate() { } + /// + /// Initializes a new instance of the class. + /// + /// The id of the Template.. + public TemplateEditResponseTemplate(string templateId = default(string)) + { + + this.TemplateId = templateId; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static TemplateEditResponseTemplate Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of TemplateEditResponseTemplate"); + } + + return obj; + } + + /// + /// The id of the Template. + /// + /// The id of the Template. + [DataMember(Name = "template_id", EmitDefaultValue = true)] + public string TemplateId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class TemplateEditResponseTemplate {\n"); + sb.Append(" TemplateId: ").Append(TemplateId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TemplateEditResponseTemplate); + } + + /// + /// Returns true if TemplateEditResponseTemplate instances are equal + /// + /// Instance of TemplateEditResponseTemplate to be compared + /// Boolean + public bool Equals(TemplateEditResponseTemplate input) + { + if (input == null) + { + return false; + } + return + ( + this.TemplateId == input.TemplateId || + (this.TemplateId != null && + this.TemplateId.Equals(input.TemplateId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.TemplateId != null) + { + hashCode = (hashCode * 59) + this.TemplateId.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType() + { + Name = "template_id", + Property = "TemplateId", + Type = "string", + Value = TemplateId, + }); + + return types; + } + } + +} diff --git a/sdks/java-v1/README.md b/sdks/java-v1/README.md index 50dab15bb..edebdcce2 100644 --- a/sdks/java-v1/README.md +++ b/sdks/java-v1/README.md @@ -236,6 +236,7 @@ Class | Method | HTTP request | Description *TemplateApi* | [**templateCreate**](docs/TemplateApi.md#templateCreate) | **POST** /template/create | Create Template *TemplateApi* | [**templateCreateEmbeddedDraft**](docs/TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft *TemplateApi* | [**templateDelete**](docs/TemplateApi.md#templateDelete) | **POST** /template/delete/{template_id} | Delete Template +*TemplateApi* | [**templateEdit**](docs/TemplateApi.md#templateEdit) | **POST** /template/edit/{template_id} | _t__TemplateEdit::SUMMARY *TemplateApi* | [**templateFiles**](docs/TemplateApi.md#templateFiles) | **GET** /template/files/{template_id} | Get Template Files *TemplateApi* | [**templateFilesAsDataUri**](docs/TemplateApi.md#templateFilesAsDataUri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri *TemplateApi* | [**templateFilesAsFileUrl**](docs/TemplateApi.md#templateFilesAsFileUrl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url @@ -399,7 +400,9 @@ Class | Method | HTTP request | Description - [TemplateCreateRequest](docs/TemplateCreateRequest.md) - [TemplateCreateResponse](docs/TemplateCreateResponse.md) - [TemplateCreateResponseTemplate](docs/TemplateCreateResponseTemplate.md) + - [TemplateEditRequest](docs/TemplateEditRequest.md) - [TemplateEditResponse](docs/TemplateEditResponse.md) + - [TemplateEditResponseTemplate](docs/TemplateEditResponseTemplate.md) - [TemplateGetResponse](docs/TemplateGetResponse.md) - [TemplateListResponse](docs/TemplateListResponse.md) - [TemplateRemoveUserRequest](docs/TemplateRemoveUserRequest.md) diff --git a/sdks/java-v1/docs/TemplateApi.md b/sdks/java-v1/docs/TemplateApi.md index dd470487b..5febb2b2b 100644 --- a/sdks/java-v1/docs/TemplateApi.md +++ b/sdks/java-v1/docs/TemplateApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://api.hellosign.com/v3* [**templateCreate**](TemplateApi.md#templateCreate) | **POST** /template/create | Create Template [**templateCreateEmbeddedDraft**](TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft [**templateDelete**](TemplateApi.md#templateDelete) | **POST** /template/delete/{template_id} | Delete Template +[**templateEdit**](TemplateApi.md#templateEdit) | **POST** /template/edit/{template_id} | _t__TemplateEdit::SUMMARY [**templateFiles**](TemplateApi.md#templateFiles) | **GET** /template/files/{template_id} | Get Template Files [**templateFilesAsDataUri**](TemplateApi.md#templateFilesAsDataUri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri [**templateFilesAsFileUrl**](TemplateApi.md#templateFilesAsFileUrl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url @@ -473,6 +474,48 @@ null (empty response body) | **4XX** | failed_operation | - | +## templateEdit + +> TemplateEditResponse templateEdit(templateId, templateEditRequest) + +_t__TemplateEdit::SUMMARY + +_t__TemplateEdit::DESCRIPTION + +### Example + +```java +REPLACE_ME_WITH_EXAMPLE_FOR__templateEdit_Java_CODE +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| + **templateId** | **String**| _t__TemplateEdit::TEMPLATE_ID | + **templateEditRequest** | [**TemplateEditRequest**](TemplateEditRequest.md)| | + +### Return type + +[**TemplateEditResponse**](TemplateEditResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json, multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + + ## templateFiles > File templateFiles(templateId, fileType) diff --git a/sdks/java-v1/docs/TemplateEditRequest.md b/sdks/java-v1/docs/TemplateEditRequest.md new file mode 100644 index 000000000..fd40d7f32 --- /dev/null +++ b/sdks/java-v1/docs/TemplateEditRequest.md @@ -0,0 +1,18 @@ + + +# TemplateEditRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `ccRoles` | ```List``` | _t__TemplateEdit::CC_ROLES | | +| `allowFormView` | ```Boolean``` | _t__TemplateEdit::ALLOW_FORM_VIEW | | +| `title` | ```String``` | _t__TemplateEdit::TITLE | | +| `subject` | ```String``` | _t__TemplateEdit::SUBJECT | | +| `message` | ```String``` | _t__TemplateEdit::MESSAGE | | + + + diff --git a/sdks/java-v1/docs/TemplateEditResponse.md b/sdks/java-v1/docs/TemplateEditResponse.md index 88d225e68..355f185da 100644 --- a/sdks/java-v1/docs/TemplateEditResponse.md +++ b/sdks/java-v1/docs/TemplateEditResponse.md @@ -8,7 +8,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `templateId`*_required_ | ```String``` | The id of the Template. | | +| `template` | [```TemplateEditResponseTemplate```](TemplateEditResponseTemplate.md) | | | +| `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/TemplateEditResponseTemplate.md b/sdks/java-v1/docs/TemplateEditResponseTemplate.md new file mode 100644 index 000000000..91cd0ad8a --- /dev/null +++ b/sdks/java-v1/docs/TemplateEditResponseTemplate.md @@ -0,0 +1,14 @@ + + +# TemplateEditResponseTemplate + +_t__TemplateEditResponseTemplate::DESCRIPTION + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `templateId` | ```String``` | The id of the Template. | | + + + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/ApiClient.java b/sdks/java-v1/src/main/java/com/dropbox/sign/ApiClient.java index e7af3ef7e..c661985b4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/ApiClient.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/ApiClient.java @@ -10,44 +10,9 @@ * Do not edit the class manually. */ + package com.dropbox.sign; -import com.dropbox.sign.auth.ApiKeyAuth; -import com.dropbox.sign.auth.Authentication; -import com.dropbox.sign.auth.HttpBasicAuth; -import com.dropbox.sign.auth.HttpBearerAuth; -import com.dropbox.sign.model.ErrorResponse; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.security.cert.X509Certificate; -import java.text.DateFormat; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.logging.Logger; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Entity; @@ -58,1289 +23,1254 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; + import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.client.HttpUrlConnectorProvider; import org.glassfish.jersey.jackson.JacksonFeature; -import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.media.multipart.FormDataBodyPart; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.MultiPart; import org.glassfish.jersey.media.multipart.MultiPartFeature; -/** ApiClient class. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class ApiClient extends JavaTimeFormatter { - private static final Pattern JSON_MIME_PATTERN = - Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); - - protected Map defaultHeaderMap = new HashMap<>(); - protected Map defaultCookieMap = new HashMap<>(); - protected String basePath = "https://api.hellosign.com/v3"; - protected String userAgent; - private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - - protected List servers = - new ArrayList<>( - Arrays.asList( - new ServerConfiguration( - "https://api.hellosign.com/v3", - "No description provided", - new LinkedHashMap<>()))); - protected Integer serverIndex = 0; - protected Map serverVariables = null; - protected Map> operationServers; - - { - Map> operationServers = new HashMap<>(); - operationServers.put( - "OAuthApi.oauthTokenGenerate", - new ArrayList<>( - Arrays.asList( - new ServerConfiguration( - "https://app.hellosign.com", - "No description provided", - new LinkedHashMap<>())))); - operationServers.put( - "OAuthApi.oauthTokenRefresh", - new ArrayList<>( - Arrays.asList( - new ServerConfiguration( - "https://app.hellosign.com", - "No description provided", - new LinkedHashMap<>())))); - this.operationServers = operationServers; - } - - protected Map operationServerIndex = new HashMap<>(); - protected Map> operationServerVariables = new HashMap<>(); - protected boolean debugging = false; - protected ClientConfig clientConfig; - protected int connectionTimeout = 0; - private int readTimeout = 0; +import java.io.IOException; +import java.io.InputStream; - protected Client httpClient; - protected JSON json; - protected String tempFolderPath = null; +import java.net.URI; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.security.cert.X509Certificate; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Map.Entry; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.time.OffsetDateTime; - protected Map authentications; - protected Map authenticationLookup; +import java.net.URLEncoder; - protected DateFormat dateFormat; +import java.io.File; +import java.io.UnsupportedEncodingException; - /** Constructs a new ApiClient with default parameters. */ - public ApiClient() { - this(null); - } +import java.text.DateFormat; +import java.util.regex.Matcher; +import java.util.regex.Pattern; - /** - * Constructs a new ApiClient with the specified authentication parameters. - * - * @param authMap A hash map containing authentication parameters. - */ - public ApiClient(Map authMap) { - json = new JSON(); - httpClient = buildHttpClient(); - - this.dateFormat = new RFC3339DateFormat(); - - // Set default User-Agent. - setUserAgent("OpenAPI-Generator/1.10-dev/java"); - - // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap<>(); - Authentication auth = null; - if (authMap != null) { - auth = authMap.get("api_key"); - } - if (auth instanceof HttpBasicAuth) { - authentications.put("api_key", auth); - } else { - authentications.put("api_key", new HttpBasicAuth()); - } - if (authMap != null) { - auth = authMap.get("oauth2"); - } - if (auth instanceof HttpBearerAuth) { - authentications.put("oauth2", auth); - } else { - authentications.put("oauth2", new HttpBearerAuth("bearer")); - } - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); +import com.dropbox.sign.auth.Authentication; +import com.dropbox.sign.auth.HttpBasicAuth; +import com.dropbox.sign.auth.HttpBearerAuth; +import com.dropbox.sign.auth.ApiKeyAuth; +import com.dropbox.sign.model.ErrorResponse; - // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap<>(); +/** + *

ApiClient class.

+ */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +public class ApiClient extends JavaTimeFormatter { + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); + protected String basePath = "https://api.hellosign.com/v3"; + protected String userAgent; + private static final Logger log = Logger.getLogger(ApiClient.class.getName()); + + protected List servers = new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "https://api.hellosign.com/v3", + "No description provided", + new LinkedHashMap<>() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + protected Map> operationServers; + + { + Map> operationServers = new HashMap<>(); + operationServers.put("OAuthApi.oauthTokenGenerate", new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "https://app.hellosign.com", + "No description provided", + new LinkedHashMap<>() + ) + ))); + operationServers.put("OAuthApi.oauthTokenRefresh", new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "https://app.hellosign.com", + "No description provided", + new LinkedHashMap<>() + ) + ))); + this.operationServers = operationServers; + } + + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); + protected boolean debugging = false; + protected ClientConfig clientConfig; + protected int connectionTimeout = 0; + private int readTimeout = 0; + + protected Client httpClient; + protected JSON json; + protected String tempFolderPath = null; + + protected Map authentications; + protected Map authenticationLookup; + + protected DateFormat dateFormat; + + /** + * Constructs a new ApiClient with default parameters. + */ + public ApiClient() { + this(null); + } + + /** + * Constructs a new ApiClient with the specified authentication parameters. + * + * @param authMap A hash map containing authentication parameters. + */ + public ApiClient(Map authMap) { + json = new JSON(); + httpClient = buildHttpClient(); + + this.dateFormat = new RFC3339DateFormat(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.10-dev/java"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>(); + Authentication auth = null; + if (authMap != null) { + auth = authMap.get("api_key"); } - - /** - * Gets the JSON instance to do JSON serialization and deserialization. - * - * @return JSON - */ - public JSON getJSON() { - return json; + if (auth instanceof HttpBasicAuth) { + authentications.put("api_key", auth); + } else { + authentications.put("api_key", new HttpBasicAuth()); } - - /** - * Getter for the field httpClient. - * - * @return a {@link javax.ws.rs.client.Client} object. - */ - public Client getHttpClient() { - return httpClient; + if (authMap != null) { + auth = authMap.get("oauth2"); } - - /** - * Setter for the field httpClient. - * - * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link ApiClient} object. - */ - public ApiClient setHttpClient(Client httpClient) { - this.httpClient = httpClient; - return this; + if (auth instanceof HttpBearerAuth) { + authentications.put("oauth2", auth); + } else { + authentications.put("oauth2", new HttpBearerAuth("bearer")); } - - /** - * Returns the base URL to the location where the OpenAPI document is being served. - * - * @return The base URL to the target host. - */ - public String getBasePath() { - return basePath; + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + + // Setup authentication lookup (key: authentication alias, value: authentication name) + authenticationLookup = new HashMap<>(); + } + + /** + * Gets the JSON instance to do JSON serialization and deserialization. + * + * @return JSON + */ + public JSON getJSON() { + return json; + } + + /** + *

Getter for the field httpClient.

+ * + * @return a {@link javax.ws.rs.client.Client} object. + */ + public Client getHttpClient() { + return httpClient; + } + + /** + *

Setter for the field httpClient.

+ * + * @param httpClient a {@link javax.ws.rs.client.Client} object. + * @return a {@link ApiClient} object. + */ + public ApiClient setHttpClient(Client httpClient) { + this.httpClient = httpClient; + return this; + } + + /** + * Returns the base URL to the location where the OpenAPI document is being served. + * + * @return The base URL to the target host. + */ + public String getBasePath() { + return basePath; + } + + /** + * Sets the base URL to the location where the OpenAPI document is being served. + * + * @param basePath The base URL to the target host. + * @return a {@link ApiClient} object. + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + *

Getter for the field servers.

+ * + * @return a {@link java.util.List} of servers. + */ + public List getServers() { + return servers; + } + + /** + *

Setter for the field servers.

+ * + * @param servers a {@link java.util.List} of servers. + * @return a {@link ApiClient} object. + */ + public ApiClient setServers(List servers) { + this.servers = servers; + updateBasePath(); + return this; + } + + /** + *

Getter for the field serverIndex.

+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getServerIndex() { + return serverIndex; + } + + /** + *

Setter for the field serverIndex.

+ * + * @param serverIndex the server index + * @return a {@link ApiClient} object. + */ + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + updateBasePath(); + return this; + } + + /** + *

Getter for the field serverVariables.

+ * + * @return a {@link java.util.Map} of server variables. + */ + public Map getServerVariables() { + return serverVariables; + } + + /** + *

Setter for the field serverVariables.

+ * + * @param serverVariables a {@link java.util.Map} of server variables. + * @return a {@link ApiClient} object. + */ + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + updateBasePath(); + return this; + } + + private void updateBasePath() { + if (serverIndex != null) { + setBasePath(servers.get(serverIndex).URL(serverVariables)); } - - /** - * Sets the base URL to the location where the OpenAPI document is being served. - * - * @param basePath The base URL to the target host. - * @return a {@link ApiClient} object. - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication object + */ + 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 + * @return a {@link ApiClient} object. + */ + public ApiClient setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); return this; + } } - - /** - * Getter for the field servers. - * - * @return a {@link java.util.List} of servers. - */ - public List getServers() { - return servers; - } - - /** - * Setter for the field servers. - * - * @param servers a {@link java.util.List} of servers. - * @return a {@link ApiClient} object. - */ - public ApiClient setServers(List servers) { - this.servers = servers; - updateBasePath(); + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + * @return a {@link ApiClient} object. + */ + public ApiClient setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); return this; + } } - - /** - * Getter for the field serverIndex. - * - * @return a {@link java.lang.Integer} object. - */ - public Integer getServerIndex() { - return serverIndex; - } - - /** - * Setter for the field serverIndex. - * - * @param serverIndex the server index - * @return a {@link ApiClient} object. - */ - public ApiClient setServerIndex(Integer serverIndex) { - this.serverIndex = serverIndex; - updateBasePath(); + 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 + * @return a {@link ApiClient} object. + */ + public ApiClient setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(apiKey); return this; - } - - /** - * Getter for the field serverVariables. - * - * @return a {@link java.util.Map} of server variables. - */ - public Map getServerVariables() { - return serverVariables; - } - - /** - * Setter for the field serverVariables. - * - * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link ApiClient} object. - */ - public ApiClient setServerVariables(Map serverVariables) { - this.serverVariables = serverVariables; - updateBasePath(); + } else if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); return this; + } } - - private void updateBasePath() { - if (serverIndex != null) { - setBasePath(servers.get(serverIndex).URL(serverVariables)); - } - } - - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map of authentication object - */ - 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 - * @return a {@link ApiClient} object. - */ - public ApiClient setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return this; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set password for the first HTTP basic authentication. - * - * @param password Password - * @return a {@link ApiClient} object. - */ - public ApiClient setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return this; - } - } - 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 - * @return a {@link ApiClient} object. - */ - public ApiClient setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(apiKey); - return this; - } else if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return this; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set bearer token for the first Bearer authentication. - * - * @param bearerToken Bearer token - * @return a {@link ApiClient} object. - */ - public ApiClient setBearerToken(String bearerToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); - return this; - } - } - throw new RuntimeException("No Bearer authentication configured!"); - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent Http user agent - * @return a {@link ApiClient} object. - */ - public ApiClient setUserAgent(String userAgent) { - this.userAgent = userAgent; - addDefaultHeader("User-Agent", userAgent); + throw new RuntimeException("No API key authentication configured!"); + } + + + /** + * Helper method to set bearer token for the first Bearer authentication. + * + * @param bearerToken Bearer token + * @return a {@link ApiClient} object. + */ + public ApiClient setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); return this; + } } - - /** - * Get the User-Agent header's value. - * - * @return User-Agent string - */ - public String getUserAgent() { - return userAgent; + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent Http user agent + * @return a {@link ApiClient} object. + */ + public ApiClient setUserAgent(String userAgent) { + this.userAgent = userAgent; + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Get the User-Agent header's value. + * + * @return User-Agent string + */ + public String getUserAgent(){ + return userAgent; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return a {@link ApiClient} object. + */ + 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 a {@link ApiClient} object. + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Gets the client config. + * + * @return Client config + */ + public ClientConfig getClientConfig() { + return clientConfig; + } + + /** + * Set the client config. + * + * @param clientConfig Set the client config + * @return a {@link ApiClient} object. + */ + public ApiClient setClientConfig(ClientConfig clientConfig) { + this.clientConfig = clientConfig; + // Rebuild HTTP Client according to the new "clientConfig" value. + this.httpClient = buildHttpClient(); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is switched on + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return a {@link ApiClient} object. + */ + public ApiClient setDebugging(boolean debugging) { + this.debugging = debugging; + // Rebuild HTTP Client according to the new "debugging" value. + this.httpClient = buildHttpClient(); + 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. + * + * @return Temp folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set temp folder path + * + * @param tempFolderPath Temp folder path + * @return a {@link ApiClient} object. + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Connect timeout (in milliseconds). + * + * @return Connection timeout + */ + public int getConnectTimeout() { + return connectionTimeout; + } + + /** + * Set the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param connectionTimeout Connection timeout in milliseconds + * @return a {@link ApiClient} object. + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + this.connectionTimeout = connectionTimeout; + httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); + return this; + } + + /** + * read timeout (in milliseconds). + * + * @return Read timeout + */ + public int getReadTimeout() { + return readTimeout; + } + + /** + * Set the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param readTimeout Read timeout in milliseconds + * @return a {@link ApiClient} object. + */ + public ApiClient setReadTimeout(int readTimeout) { + this.readTimeout = readTimeout; + httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * + * @return Date format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Set the date format used to parse/format date parameters. + * + * @param dateFormat Date format + * @return a {@link ApiClient} object. + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + // also set the date format for model (de)serialization with Date properties + this.json.setDateFormat((DateFormat) dateFormat.clone()); + return this; + } + + /** + * Parse the given string into Date object. + * + * @param str String + * @return Date + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return a {@link ApiClient} object. - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; + } + + /** + * Format the given Date object into string. + * + * @param date Date + * @return Date in string format + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Format the given parameter object into string. + * + * @param param Object + * @return Object in string format + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate((Date) param); + } else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection)param) { + if(b.length() > 0) { + b.append(','); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); } - - /** - * Add a default cookie. - * - * @param key The cookie's key - * @param value The cookie's value - * @return a {@link ApiClient} object. - */ - public ApiClient addDefaultCookie(String key, String value) { - defaultCookieMap.put(key, value); - return this; + } + + /* + * Format to {@code Pair} objects. + * + * @param collectionFormat Collection format + * @param name Name + * @param value Value + * @return List of pairs + */ + public List parameterToPairs(String collectionFormat, String name, Object value){ + List params = new ArrayList<>(); + + // preconditions + if (name == null || name.isEmpty() || value == null) return params; + + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(new Pair(name, parameterToString(value))); + return params; } - /** - * Gets the client config. - * - * @return Client config - */ - public ClientConfig getClientConfig() { - return clientConfig; + if (valueCollection.isEmpty()){ + return params; } - /** - * Set the client config. - * - * @param clientConfig Set the client config - * @return a {@link ApiClient} object. - */ - public ApiClient setClientConfig(ClientConfig clientConfig) { - this.clientConfig = clientConfig; - // Rebuild HTTP Client according to the new "clientConfig" value. - this.httpClient = buildHttpClient(); - return this; - } + // get the collection format (default: csv) + String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is switched on - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return a {@link ApiClient} object. - */ - public ApiClient setDebugging(boolean debugging) { - this.debugging = debugging; - // Rebuild HTTP Client according to the new "debugging" value. - this.httpClient = buildHttpClient(); - return this; - } + // create the params based on the collection format + if ("multi".equals(format)) { + for (Object item : valueCollection) { + params.add(new Pair(name, parameterToString(item))); + } - /** - * 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. - * - * @return Temp folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Set temp folder path - * - * @param tempFolderPath Temp folder path - * @return a {@link ApiClient} object. - */ - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; + return params; } - /** - * Connect timeout (in milliseconds). - * - * @return Connection timeout - */ - public int getConnectTimeout() { - return connectionTimeout; - } + String delimiter = ","; - /** - * Set the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values - * must be between 1 and {@link Integer#MAX_VALUE}. - * - * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link ApiClient} object. - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - this.connectionTimeout = connectionTimeout; - httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); - return this; + if ("csv".equals(format)) { + delimiter = ","; + } else if ("ssv".equals(format)) { + delimiter = " "; + } else if ("tsv".equals(format)) { + delimiter = "\t"; + } else if ("pipes".equals(format)) { + delimiter = "|"; } - /** - * read timeout (in milliseconds). - * - * @return Read timeout - */ - public int getReadTimeout() { - return readTimeout; + StringBuilder sb = new StringBuilder() ; + for (Object item : valueCollection) { + sb.append(delimiter); + sb.append(parameterToString(item)); } - /** - * Set the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must - * be between 1 and {@link Integer#MAX_VALUE}. - * - * @param readTimeout Read timeout in milliseconds - * @return a {@link ApiClient} object. - */ - public ApiClient setReadTimeout(int readTimeout) { - this.readTimeout = readTimeout; - httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); - return this; + params.add(new Pair(name, sb.substring(1))); + + return params; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "*{@literal /}*" is also considered JSON by this method. + * + * @param mime MIME + * @return True if the MIME type is JSON + */ + public boolean isJsonMime(String mime) { + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); + } + + /** + * 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 == null || accepts.length == 0) { + return null; } - - /** - * Get the date format used to parse/format date parameters. - * - * @return Date format - */ - public DateFormat getDateFormat() { - return dateFormat; + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } } - - /** - * Set the date format used to parse/format date parameters. - * - * @param dateFormat Date format - * @return a {@link ApiClient} object. - */ - public ApiClient setDateFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - // also set the date format for model (de)serialization with Date properties - this.json.setDateFormat((DateFormat) dateFormat.clone()); - return this; + 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, + * JSON will be used. + */ + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { + return "application/json"; } - - /** - * Parse the given string into Date object. - * - * @param str String - * @return Date - */ - public Date parseDate(String str) { - try { - return dateFormat.parse(str); - } catch (java.text.ParseException e) { - throw new RuntimeException(e); - } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } } - - /** - * Format the given Date object into string. - * - * @param date Date - * @return Date in string format - */ - public String formatDate(Date date) { - return dateFormat.format(date); + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; } - - /** - * Format the given parameter object into string. - * - * @param param Object - * @return Object in string format - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date) { - return formatDate((Date) param); - } else if (param instanceof OffsetDateTime) { - return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection) param) { - if (b.length() > 0) { - b.append(','); - } - b.append(String.valueOf(o)); - } - return b.toString(); + } + + /** + * Serialize the given Java object into string entity according the given + * Content-Type (only JSON is supported for now). + * + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @return Entity + * @throws ApiException API exception + */ + public Entity serialize(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException { + Entity entity; + if (contentType.startsWith("multipart/form-data")) { + MultiPart multiPart = new MultiPart(); + for (Entry param: formParams.entrySet()) { + if (param.getValue() instanceof Iterable) { + ((Iterable)param.getValue()).forEach(v -> addParamToMultipart(v, param.getKey(), multiPart)); } else { - return String.valueOf(param); + addParamToMultipart(param.getValue(), param.getKey(), multiPart); } - } - - /* - * Format to {@code Pair} objects. - * - * @param collectionFormat Collection format - * @param name Name - * @param value Value - * @return List of pairs - */ - public List parameterToPairs(String collectionFormat, String name, Object value) { - List params = new ArrayList<>(); - - // preconditions - if (name == null || name.isEmpty() || value == null) return params; - - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + } + entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + Form form = new Form(); + for (Entry param: formParams.entrySet()) { + form.param(param.getKey(), parameterToString(param.getValue())); + } + entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); + } else { + // We let jersey handle the serialization + if (isBodyNullable) { // payload is nullable + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); } else { - params.add(new Pair(name, parameterToString(value))); - return params; - } - - if (valueCollection.isEmpty()) { - return params; + entity = Entity.entity(obj == null ? "null" : obj, contentType); } - - // get the collection format (default: csv) - String format = - (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); - - // create the params based on the collection format - if ("multi".equals(format)) { - for (Object item : valueCollection) { - params.add(new Pair(name, parameterToString(item))); - } - - return params; - } - - String delimiter = ","; - - if ("csv".equals(format)) { - delimiter = ","; - } else if ("ssv".equals(format)) { - delimiter = " "; - } else if ("tsv".equals(format)) { - delimiter = "\t"; - } else if ("pipes".equals(format)) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder(); - for (Object item : valueCollection) { - sb.append(delimiter); - sb.append(parameterToString(item)); + } else { + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "" : obj, contentType); } - - params.add(new Pair(name, sb.substring(1))); - - return params; + } } + return entity; + } /** - * Check if the given MIME is a JSON MIME. JSON MIME examples: application/json - * application/json; charset=UTF8 APPLICATION/JSON application/vnd.company+json "*{@literal /}*" - * is also considered JSON by this method. - * - * @param mime MIME - * @return True if the MIME type is JSON - */ - public boolean isJsonMime(String mime) { - return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); + * Adds the object with the provided key to the MultiPart. + * Based on the object type sets Content-Disposition and Content-Type. + * + * @param obj Object + * @param key Key of the object + * @param multiPart MultiPart to add the form param to + */ + private void addParamToMultipart(Object value, String key, MultiPart multiPart) { + if (value instanceof File) { + File file = (File) value; + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(key) + .fileName(file.getName()).size(file.length()).build(); + + // Attempt to probe the content type for the file so that the form part is more correctly + // and precisely identified, but fall back to application/octet-stream if that fails. + MediaType type; + try { + type = MediaType.valueOf(Files.probeContentType(file.toPath())); + } catch (IOException | IllegalArgumentException e) { + type = MediaType.APPLICATION_OCTET_STREAM_TYPE; + } + + multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type)); + } else { + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(key).build(); + multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(value))); } - - /** - * 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 == null || accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } + } + + /** + * Serialize the given Java object into string according the given + * Content-Type (only JSON, HTTP form is supported for now). + * + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @param isBodyNullable True if the body is nullable + * @return String + * @throws ApiException API exception + */ + public String serializeToString(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException { + try { + if (contentType.startsWith("multipart/form-data")) { + throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)"); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + String formString = ""; + for (Entry param : formParams.entrySet()) { + formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&"; } - 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, JSON will be used. - */ - public String selectHeaderContentType(String... contentTypes) { - if (contentTypes == null || contentTypes.length == 0) { - return "application/json"; + if (formString.length() == 0) { // empty string + return formString; + } else { + return formString.substring(0, formString.length() - 1); } - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } + } else { + if (isBodyNullable) { + return obj == null ? "null" : json.getMapper().writeValueAsString(obj); + } else { + return obj == null ? "" : json.getMapper().writeValueAsString(obj); } - return contentTypes[0]; + } + } catch (Exception ex) { + throw new ApiException("Failed to perform serializeToString: " + ex.toString()); } - - /** - * Escape the given string to be used as URL query value. - * - * @param str String - * @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 Content-Type. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Deserialize object + * @throws ApiException API exception + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, GenericType returnType) throws ApiException { + if (response == null || returnType == null) { + return null; } - /** - * Serialize the given Java object into string entity according the given Content-Type (only - * JSON is supported for now). - * - * @param obj Object - * @param formParams Form parameters - * @param contentType Context type - * @return Entity - * @throws ApiException API exception - */ - public Entity serialize( - Object obj, Map formParams, String contentType, boolean isBodyNullable) - throws ApiException { - Entity entity; - if (contentType.startsWith("multipart/form-data")) { - MultiPart multiPart = new MultiPart(); - for (Entry param : formParams.entrySet()) { - if (param.getValue() instanceof Iterable) { - ((Iterable) param.getValue()) - .forEach(v -> addParamToMultipart(v, param.getKey(), multiPart)); - } else { - addParamToMultipart(param.getValue(), param.getKey(), multiPart); - } - } - entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE); - } else if (contentType.startsWith("application/x-www-form-urlencoded")) { - Form form = new Form(); - for (Entry param : formParams.entrySet()) { - form.param(param.getKey(), parameterToString(param.getValue())); - } - entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); - } else { - // We let jersey handle the serialization - if (isBodyNullable) { // payload is nullable - if (obj instanceof String) { - entity = - Entity.entity( - obj == null - ? "null" - : "\"" - + ((String) obj) - .replaceAll( - "\"", - Matcher.quoteReplacement( - "\\\"")) - + "\"", - contentType); - } else { - entity = Entity.entity(obj == null ? "null" : obj, contentType); - } - } else { - if (obj instanceof String) { - entity = - Entity.entity( - obj == null - ? "" - : "\"" - + ((String) obj) - .replaceAll( - "\"", - Matcher.quoteReplacement( - "\\\"")) - + "\"", - contentType); - } else { - entity = Entity.entity(obj == null ? "" : obj, contentType); - } - } - } - return entity; + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + return (T) response.readEntity(byte[].class); + } else if (returnType.getRawType() == File.class) { + // Handle file downloading. + T file = (T) downloadFileFromResponse(response); + return file; } - /** - * Adds the object with the provided key to the MultiPart. Based on the object type sets - * Content-Disposition and Content-Type. - * - * @param obj Object - * @param key Key of the object - * @param multiPart MultiPart to add the form param to - */ - private void addParamToMultipart(Object value, String key, MultiPart multiPart) { - if (value instanceof File) { - File file = (File) value; - FormDataContentDisposition contentDisp = - FormDataContentDisposition.name(key) - .fileName(file.getName()) - .size(file.length()) - .build(); - - // Attempt to probe the content type for the file so that the form part is more - // correctly - // and precisely identified, but fall back to application/octet-stream if that fails. - MediaType type; - try { - type = MediaType.valueOf(Files.probeContentType(file.toPath())); - } catch (IOException | IllegalArgumentException e) { - type = MediaType.APPLICATION_OCTET_STREAM_TYPE; - } - - multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type)); - } else { - FormDataContentDisposition contentDisp = FormDataContentDisposition.name(key).build(); - multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(value))); - } + // read the entity stream multiple times + response.bufferEntity(); + + return response.readEntity(returnType); + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); } - - /** - * Serialize the given Java object into string according the given Content-Type (only JSON, HTTP - * form is supported for now). - * - * @param obj Object - * @param formParams Form parameters - * @param contentType Context type - * @param isBodyNullable True if the body is nullable - * @return String - * @throws ApiException API exception - */ - public String serializeToString( - Object obj, Map formParams, String contentType, boolean isBodyNullable) - throws ApiException { - try { - if (contentType.startsWith("multipart/form-data")) { - throw new ApiException( - "multipart/form-data not yet supported for serializeToString (http" - + " signature authentication)"); - } else if (contentType.startsWith("application/x-www-form-urlencoded")) { - String formString = ""; - for (Entry param : formParams.entrySet()) { - formString = - param.getKey() - + "=" - + URLEncoder.encode( - parameterToString(param.getValue()), "UTF-8") - + "&"; - } - - if (formString.length() == 0) { // empty string - return formString; - } else { - return formString.substring(0, formString.length() - 1); - } - } else { - if (isBodyNullable) { - return obj == null ? "null" : json.getMapper().writeValueAsString(obj); - } else { - return obj == null ? "" : json.getMapper().writeValueAsString(obj); - } - } - } catch (Exception ex) { - throw new ApiException("Failed to perform serializeToString: " + ex.toString()); - } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link javax.ws.rs.core.Response} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = (String) response.getHeaders().getFirst("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 = matcher.group(1); } - /** - * Deserialize response body to Java object according to the Content-Type. - * - * @param Type - * @param response Response - * @param returnType Return type - * @return Deserialize object - * @throws ApiException API exception - */ - @SuppressWarnings("unchecked") - public T deserialize(Response response, GenericType returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - return (T) response.readEntity(byte[].class); - } else if (returnType.getRawType() == File.class) { - // Handle file downloading. - T file = (T) downloadFileFromResponse(response); - return file; - } - - // read the entity stream multiple times - response.bufferEntity(); - - return response.readEntity(returnType); + String prefix; + 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-"; } - /** - * Download file from the given response. - * - * @param response Response - * @return File - * @throws ApiException If fail to read file content from response and write to disk - */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - Files.copy( - response.readEntity(InputStream.class), - file.toPath(), - StandardCopyOption.REPLACE_EXISTING); - return file; - } catch (IOException e) { - throw new ApiException(e); - } + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param Type + * @param operation The qualified name of the operation + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE" + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @param isBodyNullable True if the body is nullable + * @return The response body in type of string + * @throws ApiException API exception + */ + public ApiResponse invokeAPI( + String operation, + String path, + String method, + List queryParams, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String accept, + String contentType, + String[] authNames, + GenericType returnType, + boolean isBodyNullable) + throws ApiException { + + String targetURL; + List serverConfigurations; + if (serverIndex != null && (serverConfigurations = operationServers.get(operation)) != null) { + int index = operationServerIndex.getOrDefault(operation, serverIndex).intValue(); + Map variables = operationServerVariables.getOrDefault(operation, serverVariables); + if (index < 0 || index >= serverConfigurations.size()) { + throw new ArrayIndexOutOfBoundsException( + String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", + index, serverConfigurations.size())); + } + targetURL = serverConfigurations.get(index).URL(variables) + path; + } else { + targetURL = this.basePath + path; } - - /** - * Prepare the file for download from the response. - * - * @param response a {@link javax.ws.rs.core.Response} object. - * @return a {@link java.io.File} object. - * @throws java.io.IOException if any. - */ - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = (String) response.getHeaders().getFirst("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 = matcher.group(1); - } - - String prefix; - 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-"; + // Not using `.target(targetURL).path(path)` below, + // to support (constant) query string in `path`, e.g. "/posts?draft=1" + WebTarget target = httpClient.target(targetURL); + + if (queryParams != null) { + for (Pair queryParam : queryParams) { + if (queryParam.getValue() != null) { + target = target.queryParam(queryParam.getName(), escapeString(queryParam.getValue())); } - - if (tempFolderPath == null) return Files.createTempFile(prefix, suffix).toFile(); - else return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } } - /** - * Invoke API by sending HTTP request with the given options. - * - * @param Type - * @param operation The qualified name of the operation - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE" - * @param queryParams The query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param accept The request's Accept header - * @param contentType The request's Content-Type header - * @param authNames The authentications to apply - * @param returnType The return type into which to deserialize the response - * @param isBodyNullable True if the body is nullable - * @return The response body in type of string - * @throws ApiException API exception - */ - public ApiResponse invokeAPI( - String operation, - String path, - String method, - List queryParams, - Object body, - Map headerParams, - Map cookieParams, - Map formParams, - String accept, - String contentType, - String[] authNames, - GenericType returnType, - boolean isBodyNullable) - throws ApiException { - - String targetURL; - List serverConfigurations; - if (serverIndex != null - && (serverConfigurations = operationServers.get(operation)) != null) { - int index = operationServerIndex.getOrDefault(operation, serverIndex).intValue(); - Map variables = - operationServerVariables.getOrDefault(operation, serverVariables); - if (index < 0 || index >= serverConfigurations.size()) { - throw new ArrayIndexOutOfBoundsException( - String.format( - "Invalid index %d when selecting the host settings. Must be less" - + " than %d", - index, serverConfigurations.size())); - } - targetURL = serverConfigurations.get(index).URL(variables) + path; - } else { - targetURL = this.basePath + path; - } - // Not using `.target(targetURL).path(path)` below, - // to support (constant) query string in `path`, e.g. "/posts?draft=1" - WebTarget target = httpClient.target(targetURL); - - if (queryParams != null) { - for (Pair queryParam : queryParams) { - if (queryParam.getValue() != null) { - target = - target.queryParam( - queryParam.getName(), escapeString(queryParam.getValue())); - } - } - } + Invocation.Builder invocationBuilder = target.request(); - Invocation.Builder invocationBuilder = target.request(); - - if (accept != null) { - invocationBuilder = invocationBuilder.accept(accept); - } + if (accept != null) { + invocationBuilder = invocationBuilder.accept(accept); + } - for (Entry entry : cookieParams.entrySet()) { - String value = entry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); - } - } + for (Entry entry : cookieParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } - for (Entry entry : defaultCookieMap.entrySet()) { - String value = entry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); - } - } + for (Entry entry : defaultCookieMap.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } - Entity entity = serialize(body, formParams, contentType, isBodyNullable); - - // put all headers in one place - Map allHeaderParams = new HashMap<>(defaultHeaderMap); - allHeaderParams.putAll(headerParams); - - if (authNames != null) { - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - null, - method, - target.getUri()); - } + Entity entity = serialize(body, formParams, contentType, isBodyNullable); + + // put all headers in one place + Map allHeaderParams = new HashMap<>(defaultHeaderMap); + allHeaderParams.putAll(headerParams); + + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + null, + method, + target.getUri()); + } - for (Entry entry : allHeaderParams.entrySet()) { - String value = entry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.header(entry.getKey(), value); - } - } + for (Entry entry : allHeaderParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.header(entry.getKey(), value); + } + } - Response response = null; + Response response = null; - try { - response = sendRequest(method, invocationBuilder, entity); + try { + response = sendRequest(method, invocationBuilder, entity); - final int statusCode = response.getStatusInfo().getStatusCode(); + final int statusCode = response.getStatusInfo().getStatusCode(); - Map> responseHeaders = buildResponseHeaders(response); + Map> responseHeaders = buildResponseHeaders(response); - if (statusCode == Status.NO_CONTENT.getStatusCode()) { - return new ApiResponse(statusCode, responseHeaders); - } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { - if (returnType == null) { - return new ApiResponse(statusCode, responseHeaders); - } else { - return new ApiResponse( - statusCode, responseHeaders, deserialize(response, returnType)); - } - } else { - String message = "error"; - String respBody = null; - ErrorResponse errorResponse = null; - if (response.hasEntity()) { - try { - if (response.getStatusInfo().getFamily() == Status.Family.CLIENT_ERROR) { - errorResponse = response.readEntity(ErrorResponse.class); - respBody = errorResponse.toString(); - message = respBody; - } else { - respBody = String.valueOf(response.readEntity(String.class)); - message = respBody; - } - } catch (RuntimeException e) { - // e.printStackTrace(); - } - } - throw new ApiException( - response.getStatus(), - message, - buildResponseHeaders(response), - respBody, - errorResponse); - } - } finally { - try { - response.close(); - } catch (Exception e) { - // it's not critical, since the response object is local in method invokeAPI; that's - // fine, - // just continue - } + if (statusCode == Status.NO_CONTENT.getStatusCode()) { + return new ApiResponse(statusCode, responseHeaders); + } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { + if (returnType == null) { + return new ApiResponse(statusCode, responseHeaders); + } else { + return new ApiResponse(statusCode, responseHeaders, deserialize(response, returnType)); } - } - - private Response sendRequest( - String method, Invocation.Builder invocationBuilder, Entity entity) { - Response response; - if ("POST".equals(method)) { - response = invocationBuilder.post(entity); - } else if ("PUT".equals(method)) { - response = invocationBuilder.put(entity); - } else if ("DELETE".equals(method)) { - if ("".equals(entity.getEntity())) { - response = invocationBuilder.method("DELETE"); + } else { + String message = "error"; + String respBody = null; + ErrorResponse errorResponse = null; + if (response.hasEntity()) { + try { + if (response.getStatusInfo().getFamily() == Status.Family.CLIENT_ERROR) { + errorResponse = response.readEntity(ErrorResponse.class); + respBody = errorResponse.toString(); + message = respBody; } else { - response = invocationBuilder.method("DELETE", entity); + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; } - } else if ("PATCH".equals(method)) { - response = invocationBuilder.method("PATCH", entity); - } else { - response = invocationBuilder.method(method); + } catch (RuntimeException e) { + // e.printStackTrace(); + } } - return response; + throw new ApiException( + response.getStatus(), message, buildResponseHeaders(response), respBody, errorResponse); + } + } finally { + try { + response.close(); + } catch (Exception e) { + // it's not critical, since the response object is local in method invokeAPI; that's fine, + // just continue + } } - - /** - * @deprecated Add qualified name of the operation as a first parameter. - */ - @Deprecated - public ApiResponse invokeAPI( - String path, - String method, - List queryParams, - Object body, - Map headerParams, - Map cookieParams, - Map formParams, - String accept, - String contentType, - String[] authNames, - GenericType returnType, - boolean isBodyNullable) - throws ApiException { - return invokeAPI( - null, - path, - method, - queryParams, - body, - headerParams, - cookieParams, - formParams, - accept, - contentType, - authNames, - returnType, - isBodyNullable); + } + + private Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { + Response response; + if ("POST".equals(method)) { + response = invocationBuilder.post(entity); + } else if ("PUT".equals(method)) { + response = invocationBuilder.put(entity); + } else if ("DELETE".equals(method)) { + if ("".equals(entity.getEntity())) { + response = invocationBuilder.method("DELETE"); + } else { + response = invocationBuilder.method("DELETE", entity); + } + } else if ("PATCH".equals(method)) { + response = invocationBuilder.method("PATCH", entity); + } else { + response = invocationBuilder.method(method); } - - /** - * Build the Client used to make HTTP requests. - * - * @return Client - */ - protected Client buildHttpClient() { - // recreate the client config to pickup changes - clientConfig = getDefaultClientConfig(); - - ClientBuilder clientBuilder = ClientBuilder.newBuilder(); - clientBuilder = clientBuilder.withConfig(clientConfig); - customizeClientBuilder(clientBuilder); - return clientBuilder.build(); + return response; + } + + /** + * @deprecated Add qualified name of the operation as a first parameter. + */ + @Deprecated + public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException { + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); + } + + /** + * Build the Client used to make HTTP requests. + * + * @return Client + */ + protected Client buildHttpClient() { + // recreate the client config to pickup changes + clientConfig = getDefaultClientConfig(); + + ClientBuilder clientBuilder = ClientBuilder.newBuilder(); + clientBuilder = clientBuilder.withConfig(clientConfig); + customizeClientBuilder(clientBuilder); + return clientBuilder.build(); + } + + /** + * Get the default client config. + * + * @return Client config + */ + public ClientConfig getDefaultClientConfig() { + ClientConfig clientConfig = new ClientConfig(); + clientConfig.register(MultiPartFeature.class); + clientConfig.register(json); + clientConfig.register(JacksonFeature.class); + clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); + if (debugging) { + clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); + clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); + // Set logger to ALL + java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); } - /** - * Get the default client config. - * - * @return Client config - */ - public ClientConfig getDefaultClientConfig() { - ClientConfig clientConfig = new ClientConfig(); - clientConfig.register(MultiPartFeature.class); - clientConfig.register(json); - clientConfig.register(JacksonFeature.class); - clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); - // turn off compliance validation to be able to send payloads with DELETE calls - clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); - if (debugging) { - clientConfig.register( - new LoggingFeature( - java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), - java.util.logging.Level.INFO, - LoggingFeature.Verbosity.PAYLOAD_ANY, - 1024 * 50 /* Log payloads up to 50K */)); - clientConfig.property( - LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); - // Set logger to ALL - java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME) - .setLevel(java.util.logging.Level.ALL); - } else { - // suppress warnings for payloads with DELETE calls: - java.util.logging.Logger.getLogger("org.glassfish.jersey.client") - .setLevel(java.util.logging.Level.SEVERE); + return clientConfig; + } + + /** + * Customize the client builder. + * + * This method can be overridden to customize the API client. For example, this can be used to: + * 1. Set the hostname verifier to be used by the client to verify the endpoint's hostname + * against its identification information. + * 2. Set the client-side key store. + * 3. Set the SSL context that will be used when creating secured transport connections to + * server endpoints from web targets created by the client instance that is using this SSL context. + * 4. Set the client-side trust store. + * + * To completely disable certificate validation (at your own risk), you can + * override this method and invoke disableCertificateValidation(clientBuilder). + * + * @param clientBuilder a {@link javax.ws.rs.client.ClientBuilder} object. + */ + protected void customizeClientBuilder(ClientBuilder clientBuilder) { + // No-op extension point + } + + /** + * Disable X.509 certificate validation in TLS connections. + * + * Please note that trusting all certificates is extremely risky. + * This may be useful in a development environment with self-signed certificates. + * + * @param clientBuilder a {@link javax.ws.rs.client.ClientBuilder} object. + * @throws java.security.KeyManagementException if any. + * @throws java.security.NoSuchAlgorithmException if any. + */ + protected void disableCertificateValidation(ClientBuilder clientBuilder) throws KeyManagementException, NoSuchAlgorithmException { + TrustManager[] trustAllCerts = new X509TrustManager[] { + new X509TrustManager() { + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; } - - return clientConfig; - } - - /** - * Customize the client builder. - * - *

This method can be overridden to customize the API client. For example, this can be used - * to: 1. Set the hostname verifier to be used by the client to verify the endpoint's hostname - * against its identification information. 2. Set the client-side key store. 3. Set the SSL - * context that will be used when creating secured transport connections to server endpoints - * from web targets created by the client instance that is using this SSL context. 4. Set the - * client-side trust store. - * - *

To completely disable certificate validation (at your own risk), you can override this - * method and invoke disableCertificateValidation(clientBuilder). - * - * @param clientBuilder a {@link javax.ws.rs.client.ClientBuilder} object. - */ - protected void customizeClientBuilder(ClientBuilder clientBuilder) { - // No-op extension point - } - - /** - * Disable X.509 certificate validation in TLS connections. - * - *

Please note that trusting all certificates is extremely risky. This may be useful in a - * development environment with self-signed certificates. - * - * @param clientBuilder a {@link javax.ws.rs.client.ClientBuilder} object. - * @throws java.security.KeyManagementException if any. - * @throws java.security.NoSuchAlgorithmException if any. - */ - protected void disableCertificateValidation(ClientBuilder clientBuilder) - throws KeyManagementException, NoSuchAlgorithmException { - TrustManager[] trustAllCerts = - new X509TrustManager[] { - new X509TrustManager() { - @Override - public X509Certificate[] getAcceptedIssuers() { - return null; - } - - @Override - public void checkClientTrusted(X509Certificate[] certs, String authType) {} - - @Override - public void checkServerTrusted(X509Certificate[] certs, String authType) {} - } - }; - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(null, trustAllCerts, new SecureRandom()); - clientBuilder.sslContext(sslContext); - } - - /** - * Build the response headers. - * - * @param response a {@link javax.ws.rs.core.Response} object. - * @return a {@link java.util.Map} of response headers. - */ - protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap<>(); - for (Entry> entry : response.getHeaders().entrySet()) { - List values = entry.getValue(); - List headers = new ArrayList<>(); - for (Object o : values) { - headers.add(String.valueOf(o)); - } - responseHeaders.put(entry.getKey(), headers); + @Override + public void checkClientTrusted(X509Certificate[] certs, String authType) { } - return responseHeaders; - } - - /** - * 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 method HTTP method (e.g. POST) - * @param uri HTTP URI - */ - protected 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) { - continue; - } - auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + @Override + public void checkServerTrusted(X509Certificate[] certs, String authType) { } + } + }; + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, trustAllCerts, new SecureRandom()); + clientBuilder.sslContext(sslContext); + } + + /** + *

Build the response headers.

+ * + * @param response a {@link javax.ws.rs.core.Response} object. + * @return a {@link java.util.Map} of response headers. + */ + protected Map> buildResponseHeaders(Response response) { + Map> responseHeaders = new HashMap<>(); + for (Entry> entry: response.getHeaders().entrySet()) { + List values = entry.getValue(); + List headers = new ArrayList<>(); + for (Object o : values) { + headers.add(String.valueOf(o)); + } + responseHeaders.put(entry.getKey(), headers); + } + return responseHeaders; + } + + /** + * 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 method HTTP method (e.g. POST) + * @param uri HTTP URI + */ + protected 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) { + continue; + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/ApiException.java b/sdks/java-v1/src/main/java/com/dropbox/sign/ApiException.java index 27476dab3..29c9e7017 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/ApiException.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/ApiException.java @@ -10,16 +10,17 @@ * Do not edit the class manually. */ + package com.dropbox.sign; -import com.dropbox.sign.model.ErrorResponse; -import java.util.List; import java.util.Map; +import java.util.List; +import com.dropbox.sign.model.ErrorResponse; -/** API Exception */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +/** + * API Exception + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class ApiException extends Exception { private static final long serialVersionUID = 1L; @@ -38,31 +39,18 @@ public ApiException(String message) { super(message); } - public ApiException( - String message, - Throwable throwable, - int code, - Map> responseHeaders, - String responseBody) { + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { super(message, throwable); this.code = code; this.responseHeaders = responseHeaders; this.responseBody = responseBody; } - public ApiException( - String message, - int code, - Map> responseHeaders, - String responseBody) { + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { this(message, (Throwable) null, code, responseHeaders, responseBody); } - public ApiException( - String message, - Throwable throwable, - int code, - Map> responseHeaders) { + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { this(message, throwable, code, responseHeaders, null); } @@ -75,22 +63,13 @@ public ApiException(int code, String message) { this.code = code; } - public ApiException( - int code, - String message, - Map> responseHeaders, - String responseBody) { + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { this(code, message); this.responseHeaders = responseHeaders; this.responseBody = responseBody; } - public ApiException( - int code, - String message, - Map> responseHeaders, - String responseBody, - ErrorResponse errorResponse) { + public ApiException(int code, String message, Map> responseHeaders, String responseBody, ErrorResponse errorResponse) { this(code, message, responseHeaders, responseBody); this.errorResponse = errorResponse; } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/ApiResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/ApiResponse.java index 7f5f3703f..7105de613 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/ApiResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/ApiResponse.java @@ -10,6 +10,7 @@ * Do not edit the class manually. */ + package com.dropbox.sign; import java.util.List; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/Configuration.java b/sdks/java-v1/src/main/java/com/dropbox/sign/Configuration.java index ddcbd7148..da15b2803 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/Configuration.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/Configuration.java @@ -10,19 +10,18 @@ * Do not edit the class manually. */ + package com.dropbox.sign; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class Configuration { public static final String VERSION = "1.10-dev"; private static volatile ApiClient defaultApiClient = new ApiClient(); /** - * Get the default API client, which would be used when creating API instances without providing - * an API client. + * Get the default API client, which would be used when creating API + * instances without providing an API client. * * @return Default API client */ @@ -31,8 +30,8 @@ public static ApiClient getDefaultApiClient() { } /** - * Set the default API client, which would be used when creating API instances without providing - * an API client. + * Set the default API client, which would be used when creating API + * instances without providing an API client. * * @param apiClient API client */ diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/EventCallbackHelper.java b/sdks/java-v1/src/main/java/com/dropbox/sign/EventCallbackHelper.java index 8d65b8708..1aa36e6e0 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/EventCallbackHelper.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/EventCallbackHelper.java @@ -10,6 +10,7 @@ * Do not edit the class manually. */ + package com.dropbox.sign; import com.dropbox.sign.model.EventCallbackRequest; @@ -17,9 +18,7 @@ import org.apache.commons.codec.digest.HmacAlgorithms; import org.apache.commons.codec.digest.HmacUtils; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class EventCallbackHelper { public static final String EVENT_TYPE_ACCOUNT_CALLBACK = "account_callback"; @@ -28,33 +27,34 @@ public class EventCallbackHelper { private EventCallbackHelper() {} /** - * Verify that a callback came from HelloSign.com - * - * @param apiKey - * @param eventCallback - * @return a boolean value indicating whether the callback event is valid - */ + * Verify that a callback came from HelloSign.com + * + * @param apiKey + * @param eventCallback + * @return a boolean value indicating whether the callback event is valid + */ public static boolean isValid(String apiKey, EventCallbackRequest eventCallback) { return new HmacUtils(HmacAlgorithms.HMAC_SHA_256, apiKey) - .hmacHex( - eventCallback.getEvent().getEventTime() - + eventCallback.getEvent().getEventType()) - .equals(eventCallback.getEvent().getEventHash()); + .hmacHex(eventCallback.getEvent().getEventTime() + eventCallback.getEvent().getEventType()) + .equals(eventCallback.getEvent().getEventHash()); } /** - * Identifies the callback type, one of "account_callback" or "app_callback". + * Identifies the callback type, one of "account_callback" or + * "app_callback". * - *

"app_callback" will always include a value for "reported_for_app_id" + * "app_callback" will always include a value for "reported_for_app_id" * * @param eventCallback */ public static String getCallbackType(EventCallbackRequest eventCallback) { EventCallbackRequestEventMetadata metadata = eventCallback.getEvent().getEventMetadata(); - if (metadata == null - || metadata.getReportedForAppId() == null - || metadata.getReportedForAppId().isEmpty()) { + if ( + metadata == null || + metadata.getReportedForAppId() == null || + metadata.getReportedForAppId().isEmpty() + ) { return EventCallbackHelper.EVENT_TYPE_ACCOUNT_CALLBACK; } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/JSON.java b/sdks/java-v1/src/main/java/com/dropbox/sign/JSON.java index cd4a199ef..be060134a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/JSON.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/JSON.java @@ -10,12 +10,14 @@ * Do not edit the class manually. */ + package com.dropbox.sign; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; + import java.text.DateFormat; import java.util.HashMap; import java.util.HashSet; @@ -24,237 +26,233 @@ import javax.ws.rs.core.GenericType; import javax.ws.rs.ext.ContextResolver; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class JSON implements ContextResolver { - private ObjectMapper mapper; + private ObjectMapper mapper; + + public JSON() { + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + .build(); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } - public JSON() { - mapper = - JsonMapper.builder() - .serializationInclusion(JsonInclude.Include.NON_NULL) - .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) - .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) - .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) - .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) - .defaultDateFormat(new RFC3339DateFormat()) - .addModule(new JavaTimeModule()) - .build(); + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet<>()); } + return null; + } - /** - * Set the date format for JSON (de)serialization with Date properties. - * - * @param dateFormat Date format - */ - public void setDateFormat(DateFormat dateFormat) { - mapper.setDateFormat(dateFormat); + /** + * Helper class to register the discriminator mappings. + */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap<>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } } - @Override - public ObjectMapper getContext(Class type) { - return mapper; + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; } - /** - * Get the object mapper - * - * @return object mapper - */ - public ObjectMapper getMapper() { - return mapper; + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; } /** - * Returns the target model class that should be used to deserialize the input data. The - * discriminator mappings are used to determine the target model class. + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. * * @param node The input data. - * @param modelClass The class that contains the discriminator mappings. + * @param visitedClasses The set of classes that have already been visited. */ - public static Class getClassForElement(JsonNode node, Class modelClass) { - ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); - if (cdm != null) { - return cdm.getClassForElement(node, new HashSet<>()); - } + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. return null; - } - - /** Helper class to register the discriminator mappings. */ - private static class ClassDiscriminatorMapping { - // The model class name. - Class modelClass; - // The name of the discriminator property. - String discriminatorName; - // The discriminator mappings for a model class. - Map> discriminatorMappings; - - // Constructs a new class discriminator. - ClassDiscriminatorMapping( - Class cls, String propertyName, Map> mappings) { - modelClass = cls; - discriminatorName = propertyName; - discriminatorMappings = new HashMap<>(); - if (mappings != null) { - discriminatorMappings.putAll(mappings); - } - } - - // Return the name of the discriminator property for this model class. - String getDiscriminatorPropertyName() { - return discriminatorName; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; } - - // Return the discriminator value or null if the discriminator is not - // present in the payload. - String getDiscriminatorValue(JsonNode node) { - // Determine the value of the discriminator property in the input data. - if (discriminatorName != null) { - // Get the value of the discriminator property, if present in the input payload. - node = node.get(discriminatorName); - if (node != null && node.isValueNode()) { - String discrValue = node.asText(); - if (discrValue != null) { - return discrValue; - } - } - } - return null; + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } } - - /** - * Returns the target model class that should be used to deserialize the input data. This - * function can be invoked for anyOf/oneOf composed models with discriminator mappings. The - * discriminator mappings are used to determine the target model class. - * - * @param node The input data. - * @param visitedClasses The set of classes that have already been visited. - */ - Class getClassForElement(JsonNode node, Set> visitedClasses) { - if (visitedClasses.contains(modelClass)) { - // Class has already been visited. - return null; - } - // Determine the value of the discriminator property in the input data. - String discrValue = getDiscriminatorValue(node); - if (discrValue == null) { - return null; - } - Class cls = discriminatorMappings.get(discrValue); - // It may not be sufficient to return this cls directly because that target class - // may itself be a composed schema, possibly with its own discriminator. - visitedClasses.add(modelClass); - for (Class childClass : discriminatorMappings.values()) { - ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); - if (childCdm == null) { - continue; - } - if (!discriminatorName.equals(childCdm.discriminatorName)) { - discrValue = getDiscriminatorValue(node); - if (discrValue == null) { - continue; - } - } - if (childCdm != null) { - // Recursively traverse the discriminator mappings. - Class childDiscr = childCdm.getClassForElement(node, visitedClasses); - if (childDiscr != null) { - return childDiscr; - } - } - } - return cls; + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } } + } + return cls; } + } - /** - * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. - * - *

The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, - * so it's not possible to use the instanceof keyword. - * - * @param modelClass A OpenAPI model class. - * @param inst The instance object. - */ - public static boolean isInstanceOf( - Class modelClass, Object inst, Set> visitedClasses) { - if (modelClass.isInstance(inst)) { - return true; - } - if (visitedClasses.contains(modelClass)) { - // This is to prevent infinite recursion when the composed schemas have - // a circular dependency. - return false; - } - visitedClasses.add(modelClass); + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); - // Traverse the oneOf/anyOf composed schemas. - Map> descendants = modelDescendants.get(modelClass); - if (descendants != null) { - for (GenericType childType : descendants.values()) { - if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { - return true; - } - } + // Traverse the oneOf/anyOf composed schemas. + Map> descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (GenericType childType : descendants.values()) { + if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { + return true; } - return false; + } } + return false; + } - /** A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); - /** A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map>> modelDescendants = new HashMap<>(); + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map>> modelDescendants = new HashMap<>(); - /** - * Register a model class discriminator. - * - * @param modelClass the model class - * @param discriminatorPropertyName the name of the discriminator property - * @param mappings a map with the discriminator mappings. - */ - public static void registerDiscriminator( - Class modelClass, String discriminatorPropertyName, Map> mappings) { - ClassDiscriminatorMapping m = - new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); - modelDiscriminators.put(modelClass, m); - } + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } - /** - * Register the oneOf/anyOf descendants of the modelClass. - * - * @param modelClass the model class - * @param descendants a map of oneOf/anyOf descendants. - */ - public static void registerDescendants( - Class modelClass, Map> descendants) { - modelDescendants.put(modelClass, descendants); - } + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map> descendants) { + modelDescendants.put(modelClass, descendants); + } - private static JSON json; + private static JSON json; - static { - json = new JSON(); - } + static + { + json = new JSON(); + } - /** - * Get the default JSON instance. - * - * @return the default JSON instance - */ - public static JSON getDefault() { - return json; - } + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } - /** - * Set the default JSON instance. - * - * @param json JSON instance to be used - */ - public static void setDefault(JSON json) { - JSON.json = json; - } + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/JavaTimeFormatter.java b/sdks/java-v1/src/main/java/com/dropbox/sign/JavaTimeFormatter.java index 806b9b146..014149dbe 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/JavaTimeFormatter.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/JavaTimeFormatter.java @@ -17,20 +17,16 @@ import java.time.format.DateTimeParseException; /** - * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. It's - * generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code - * java8}. + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class JavaTimeFormatter { private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; /** * Get the date format used to parse/format {@code OffsetDateTime} parameters. - * * @return DateTimeFormatter */ public DateTimeFormatter getOffsetDateTimeFormatter() { @@ -39,7 +35,6 @@ public DateTimeFormatter getOffsetDateTimeFormatter() { /** * Set the date format used to parse/format {@code OffsetDateTime} parameters. - * * @param offsetDateTimeFormatter {@code DateTimeFormatter} */ public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { @@ -48,7 +43,6 @@ public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter /** * Parse the given string into {@code OffsetDateTime} object. - * * @param str String * @return {@code OffsetDateTime} */ @@ -59,10 +53,8 @@ public OffsetDateTime parseOffsetDateTime(String str) { throw new RuntimeException(e); } } - /** * Format the given {@code OffsetDateTime} object into string. - * * @param offsetDateTime {@code OffsetDateTime} * @return {@code OffsetDateTime} in string format */ diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/Pair.java b/sdks/java-v1/src/main/java/com/dropbox/sign/Pair.java index 0f3d10c47..4ddfb7ec3 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/Pair.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/Pair.java @@ -10,16 +10,15 @@ * Do not edit the class manually. */ + package com.dropbox.sign; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class Pair { private String name = ""; private String value = ""; - public Pair(String name, String value) { + public Pair (String name, String value) { setName(name); setValue(value); } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/RFC3339DateFormat.java b/sdks/java-v1/src/main/java/com/dropbox/sign/RFC3339DateFormat.java index 3334a5843..4ee519791 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/RFC3339DateFormat.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/RFC3339DateFormat.java @@ -13,46 +13,46 @@ package com.dropbox.sign; import com.fasterxml.jackson.databind.util.StdDateFormat; + import java.text.DateFormat; -import java.text.DecimalFormat; import java.text.FieldPosition; import java.text.ParsePosition; import java.util.Date; +import java.text.DecimalFormat; import java.util.GregorianCalendar; import java.util.TimeZone; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = - new StdDateFormat().withTimeZone(TIMEZONE_Z).withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - this.numberFormat = new DecimalFormat(); - } - - @Override - public Date parse(String source) { - return parse(source, new ParsePosition(0)); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return super.clone(); - } + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/ServerConfiguration.java b/sdks/java-v1/src/main/java/com/dropbox/sign/ServerConfiguration.java index 8d3d8b18c..7e7364f08 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/ServerConfiguration.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/ServerConfiguration.java @@ -10,14 +10,15 @@ * Do not edit the class manually. */ + package com.dropbox.sign; import java.util.Map; -/** Representing a Server configuration. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class ServerConfiguration { public String URL; public String description; @@ -26,11 +27,9 @@ public class ServerConfiguration { /** * @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. + * @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) { + public ServerConfiguration(String URL, String description, Map variables) { this.URL = URL; this.description = description; this.variables = variables; @@ -46,21 +45,15 @@ public String URL(Map variables) { String url = this.URL; // go through variables and replace placeholders - for (Map.Entry variable : this.variables.entrySet()) { + 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 - + "."); + 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); diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/ServerVariable.java b/sdks/java-v1/src/main/java/com/dropbox/sign/ServerVariable.java index 4af52f41e..fdd6a3ca2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/ServerVariable.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/ServerVariable.java @@ -10,14 +10,15 @@ * Do not edit the class manually. */ + package com.dropbox.sign; import java.util.HashSet; -/** Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class ServerVariable { public String description; public String defaultValue; @@ -26,8 +27,7 @@ public class ServerVariable { /** * @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. + * @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; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/StringUtil.java b/sdks/java-v1/src/main/java/com/dropbox/sign/StringUtil.java index bcc8a0371..95daecb51 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/StringUtil.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/StringUtil.java @@ -10,74 +10,74 @@ * Do not edit the class manually. */ + package com.dropbox.sign; import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") 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; + /** + * 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 ""; - } + /** + * 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(); + 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(); + /** + * 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/sdks/java-v1/src/main/java/com/dropbox/sign/api/AccountApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/AccountApi.java index 836bd4bf4..9c65d5820 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/AccountApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/AccountApi.java @@ -1,380 +1,353 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; + +import javax.ws.rs.core.GenericType; + import com.dropbox.sign.model.AccountCreateRequest; import com.dropbox.sign.model.AccountCreateResponse; import com.dropbox.sign.model.AccountGetResponse; import com.dropbox.sign.model.AccountUpdateRequest; import com.dropbox.sign.model.AccountVerifyRequest; import com.dropbox.sign.model.AccountVerifyResponse; +import com.dropbox.sign.model.ErrorResponse; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class AccountApi { - private ApiClient apiClient; + private ApiClient apiClient; - public AccountApi() { - this(Configuration.getDefaultApiClient()); - } + public AccountApi() { + this(Configuration.getDefaultApiClient()); + } - public AccountApi(ApiClient apiClient) { - this.apiClient = apiClient; - } + public AccountApi(ApiClient apiClient) { + this.apiClient = apiClient; + } - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; - } + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } - /** - * Create Account Creates a new Dropbox Sign Account that is associated with the specified - * `email_address`. - * - * @param accountCreateRequest (required) - * @return AccountCreateResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public AccountCreateResponse accountCreate(AccountCreateRequest accountCreateRequest) - throws ApiException { - return accountCreateWithHttpInfo(accountCreateRequest).getData(); - } + /** + * Create Account + * Creates a new Dropbox Sign Account that is associated with the specified `email_address`. + * @param accountCreateRequest (required) + * @return AccountCreateResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public AccountCreateResponse accountCreate(AccountCreateRequest accountCreateRequest) throws ApiException { + return accountCreateWithHttpInfo(accountCreateRequest).getData(); + } - /** - * Create Account Creates a new Dropbox Sign Account that is associated with the specified - * `email_address`. - * - * @param accountCreateRequest (required) - * @return ApiResponse<AccountCreateResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse accountCreateWithHttpInfo( - AccountCreateRequest accountCreateRequest) throws ApiException { - - // Check required parameters - if (accountCreateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'accountCreateRequest' when calling" - + " accountCreate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = accountCreateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "AccountApi.accountCreate", - "/account/create", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : accountCreateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - /** - * Get Account Returns the properties and settings of your Account. - * - * @param accountId `account_id` or `email_address` is required. If both are - * provided, the account id prevails. The ID of the Account. (optional) - * @param emailAddress `account_id` or `email_address` is required, If both - * are provided, the account id prevails. The email address of the Account. (optional) - * @return AccountGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public AccountGetResponse accountGet(String accountId, String emailAddress) - throws ApiException { - return accountGetWithHttpInfo(accountId, emailAddress).getData(); + /** + * Create Account + * Creates a new Dropbox Sign Account that is associated with the specified `email_address`. + * @param accountCreateRequest (required) + * @return ApiResponse<AccountCreateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse accountCreateWithHttpInfo(AccountCreateRequest accountCreateRequest) throws ApiException { + + // Check required parameters + if (accountCreateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'accountCreateRequest' when calling accountCreate"); } - /** - * @see AccountApi#accountGet(String, String) - */ - public AccountGetResponse accountGet() throws ApiException { - String accountId = null; - String emailAddress = null; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = accountCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "AccountApi.accountCreate", + "/account/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : accountCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return accountGetWithHttpInfo(accountId, emailAddress).getData(); - } + } + /** + * Get Account + * Returns the properties and settings of your Account. + * @param accountId `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param emailAddress `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @return AccountGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public AccountGetResponse accountGet(String accountId, String emailAddress) throws ApiException { + return accountGetWithHttpInfo(accountId, emailAddress).getData(); + } - /** - * @see AccountApi#accountGetWithHttpInfo(String, String) - */ - public ApiResponse accountGetWithHttpInfo() throws ApiException { - String accountId = null; - String emailAddress = null; - return accountGetWithHttpInfo(accountId, emailAddress); - } + /** + * @see AccountApi#accountGet(String, String) + */ + public AccountGetResponse accountGet() throws ApiException { + String accountId = null; + String emailAddress = null; - /** - * @see AccountApi#accountGet(String, String) - */ - public AccountGetResponse accountGet(String accountId) throws ApiException { - String emailAddress = null; + return accountGetWithHttpInfo(accountId, emailAddress).getData(); + } - return accountGetWithHttpInfo(accountId, emailAddress).getData(); - } + /** + * @see AccountApi#accountGetWithHttpInfo(String, String) + */ + public ApiResponse accountGetWithHttpInfo() throws ApiException { + String accountId = null; + String emailAddress = null; - /** - * @see AccountApi#accountGetWithHttpInfo(String, String) - */ - public ApiResponse accountGetWithHttpInfo(String accountId) - throws ApiException { - String emailAddress = null; + return accountGetWithHttpInfo(accountId, emailAddress); + } - return accountGetWithHttpInfo(accountId, emailAddress); - } + /** + * @see AccountApi#accountGet(String, String) + */ + public AccountGetResponse accountGet(String accountId) throws ApiException { + String emailAddress = null; - /** - * Get Account Returns the properties and settings of your Account. - * - * @param accountId `account_id` or `email_address` is required. If both are - * provided, the account id prevails. The ID of the Account. (optional) - * @param emailAddress `account_id` or `email_address` is required, If both - * are provided, the account id prevails. The email address of the Account. (optional) - * @return ApiResponse<AccountGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse accountGetWithHttpInfo( - String accountId, String emailAddress) throws ApiException { - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "account_id", accountId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "email_address", emailAddress)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "AccountApi.accountGet", - "/account", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } + return accountGetWithHttpInfo(accountId, emailAddress).getData(); + } - /** - * Update Account Updates the properties and settings of your Account. Currently only allows for - * updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. - * - * @param accountUpdateRequest (required) - * @return AccountGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public AccountGetResponse accountUpdate(AccountUpdateRequest accountUpdateRequest) - throws ApiException { - return accountUpdateWithHttpInfo(accountUpdateRequest).getData(); - } + /** + * @see AccountApi#accountGetWithHttpInfo(String, String) + */ + public ApiResponse accountGetWithHttpInfo(String accountId) throws ApiException { + String emailAddress = null; - /** - * Update Account Updates the properties and settings of your Account. Currently only allows for - * updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. - * - * @param accountUpdateRequest (required) - * @return ApiResponse<AccountGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse accountUpdateWithHttpInfo( - AccountUpdateRequest accountUpdateRequest) throws ApiException { - - // Check required parameters - if (accountUpdateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'accountUpdateRequest' when calling" - + " accountUpdate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = accountUpdateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "AccountApi.accountUpdate", - "/account", - "PUT", - new ArrayList<>(), - isFileTypeFound ? null : accountUpdateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } + return accountGetWithHttpInfo(accountId, emailAddress); + } + + + /** + * Get Account + * Returns the properties and settings of your Account. + * @param accountId `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param emailAddress `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @return ApiResponse<AccountGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse accountGetWithHttpInfo(String accountId, String emailAddress) throws ApiException { + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "email_address", emailAddress)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "AccountApi.accountGet", + "/account", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - /** - * Verify Account Verifies whether an Dropbox Sign Account exists for the given email address. - * - * @param accountVerifyRequest (required) - * @return AccountVerifyResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public AccountVerifyResponse accountVerify(AccountVerifyRequest accountVerifyRequest) - throws ApiException { - return accountVerifyWithHttpInfo(accountVerifyRequest).getData(); + } + /** + * Update Account + * Updates the properties and settings of your Account. Currently only allows for updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. + * @param accountUpdateRequest (required) + * @return AccountGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public AccountGetResponse accountUpdate(AccountUpdateRequest accountUpdateRequest) throws ApiException { + return accountUpdateWithHttpInfo(accountUpdateRequest).getData(); + } + + + /** + * Update Account + * Updates the properties and settings of your Account. Currently only allows for updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. + * @param accountUpdateRequest (required) + * @return ApiResponse<AccountGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse accountUpdateWithHttpInfo(AccountUpdateRequest accountUpdateRequest) throws ApiException { + + // Check required parameters + if (accountUpdateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'accountUpdateRequest' when calling accountUpdate"); } - /** - * Verify Account Verifies whether an Dropbox Sign Account exists for the given email address. - * - * @param accountVerifyRequest (required) - * @return ApiResponse<AccountVerifyResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse accountVerifyWithHttpInfo( - AccountVerifyRequest accountVerifyRequest) throws ApiException { - - // Check required parameters - if (accountVerifyRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'accountVerifyRequest' when calling" - + " accountVerify"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = accountVerifyRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "AccountApi.accountVerify", - "/account/verify", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : accountVerifyRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = accountUpdateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "AccountApi.accountUpdate", + "/account", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : accountUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Verify Account + * Verifies whether an Dropbox Sign Account exists for the given email address. + * @param accountVerifyRequest (required) + * @return AccountVerifyResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public AccountVerifyResponse accountVerify(AccountVerifyRequest accountVerifyRequest) throws ApiException { + return accountVerifyWithHttpInfo(accountVerifyRequest).getData(); + } + + + /** + * Verify Account + * Verifies whether an Dropbox Sign Account exists for the given email address. + * @param accountVerifyRequest (required) + * @return ApiResponse<AccountVerifyResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse accountVerifyWithHttpInfo(AccountVerifyRequest accountVerifyRequest) throws ApiException { + + // Check required parameters + if (accountVerifyRequest == null) { + throw new ApiException(400, "Missing the required parameter 'accountVerifyRequest' when calling accountVerify"); } -} + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = accountVerifyRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "AccountApi.accountVerify", + "/account/verify", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : accountVerifyRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/ApiAppApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/ApiAppApi.java index b74007e35..3567a0498 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/ApiAppApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/ApiAppApi.java @@ -1,462 +1,436 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; + +import javax.ws.rs.core.GenericType; + import com.dropbox.sign.model.ApiAppCreateRequest; import com.dropbox.sign.model.ApiAppGetResponse; import com.dropbox.sign.model.ApiAppListResponse; import com.dropbox.sign.model.ApiAppUpdateRequest; +import com.dropbox.sign.model.ErrorResponse; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class ApiAppApi { - private ApiClient apiClient; - - public ApiAppApi() { - this(Configuration.getDefaultApiClient()); - } - - public ApiAppApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Create API App Creates a new API App. - * - * @param apiAppCreateRequest (required) - * @return ApiAppGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiAppGetResponse apiAppCreate(ApiAppCreateRequest apiAppCreateRequest) - throws ApiException { - return apiAppCreateWithHttpInfo(apiAppCreateRequest).getData(); - } - - /** - * Create API App Creates a new API App. - * - * @param apiAppCreateRequest (required) - * @return ApiResponse<ApiAppGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse apiAppCreateWithHttpInfo( - ApiAppCreateRequest apiAppCreateRequest) throws ApiException { - - // Check required parameters - if (apiAppCreateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'apiAppCreateRequest' when calling" - + " apiAppCreate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = apiAppCreateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "ApiAppApi.apiAppCreate", - "/api_app", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : apiAppCreateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + private ApiClient apiClient; + + public ApiAppApi() { + this(Configuration.getDefaultApiClient()); + } + + public ApiAppApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create API App + * Creates a new API App. + * @param apiAppCreateRequest (required) + * @return ApiAppGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiAppGetResponse apiAppCreate(ApiAppCreateRequest apiAppCreateRequest) throws ApiException { + return apiAppCreateWithHttpInfo(apiAppCreateRequest).getData(); + } + + + /** + * Create API App + * Creates a new API App. + * @param apiAppCreateRequest (required) + * @return ApiResponse<ApiAppGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse apiAppCreateWithHttpInfo(ApiAppCreateRequest apiAppCreateRequest) throws ApiException { + + // Check required parameters + if (apiAppCreateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'apiAppCreateRequest' when calling apiAppCreate"); } - /** - * Delete API App Deletes an API App. Can only be invoked for apps you own. - * - * @param clientId The client id of the API App to delete. (required) - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public void apiAppDelete(String clientId) throws ApiException { - apiAppDeleteWithHttpInfo(clientId); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = apiAppCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "ApiAppApi.apiAppCreate", + "/api_app", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : apiAppCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Delete API App + * Deletes an API App. Can only be invoked for apps you own. + * @param clientId The client id of the API App to delete. (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void apiAppDelete(String clientId) throws ApiException { + apiAppDeleteWithHttpInfo(clientId); + } + + + /** + * Delete API App + * Deletes an API App. Can only be invoked for apps you own. + * @param clientId The client id of the API App to delete. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse apiAppDeleteWithHttpInfo(String clientId) throws ApiException { + + // Check required parameters + if (clientId == null) { + throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppDelete"); } - /** - * Delete API App Deletes an API App. Can only be invoked for apps you own. - * - * @param clientId The client id of the API App to delete. (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse apiAppDeleteWithHttpInfo(String clientId) throws ApiException { - - // Check required parameters - if (clientId == null) { - throw new ApiException( - 400, "Missing the required parameter 'clientId' when calling apiAppDelete"); - } - - // Path parameters - String localVarPath = - "/api_app/{client_id}" - .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - return apiClient.invokeAPI( - "ApiAppApi.apiAppDelete", - localVarPath, - "DELETE", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - null, - false); + // Path parameters + String localVarPath = "/api_app/{client_id}" + .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + return apiClient.invokeAPI( + "ApiAppApi.apiAppDelete", + localVarPath, + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); + + } + /** + * Get API App + * Returns an object with information about an API App. + * @param clientId The client id of the API App to retrieve. (required) + * @return ApiAppGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiAppGetResponse apiAppGet(String clientId) throws ApiException { + return apiAppGetWithHttpInfo(clientId).getData(); + } + + + /** + * Get API App + * Returns an object with information about an API App. + * @param clientId The client id of the API App to retrieve. (required) + * @return ApiResponse<ApiAppGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse apiAppGetWithHttpInfo(String clientId) throws ApiException { + + // Check required parameters + if (clientId == null) { + throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppGet"); } - /** - * Get API App Returns an object with information about an API App. - * - * @param clientId The client id of the API App to retrieve. (required) - * @return ApiAppGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiAppGetResponse apiAppGet(String clientId) throws ApiException { - return apiAppGetWithHttpInfo(clientId).getData(); + // Path parameters + String localVarPath = "/api_app/{client_id}" + .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "ApiAppApi.apiAppGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * List API Apps + * Returns a list of API Apps that are accessible by you. If you are on a team with an Admin or Developer role, this list will include apps owned by teammates. + * @param page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @return ApiAppListResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiAppListResponse apiAppList(Integer page, Integer pageSize) throws ApiException { + return apiAppListWithHttpInfo(page, pageSize).getData(); + } + + + /** + * @see ApiAppApi#apiAppList(Integer, Integer) + */ + public ApiAppListResponse apiAppList() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return apiAppListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see ApiAppApi#apiAppListWithHttpInfo(Integer, Integer) + */ + public ApiResponse apiAppListWithHttpInfo() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return apiAppListWithHttpInfo(page, pageSize); + } + + /** + * @see ApiAppApi#apiAppList(Integer, Integer) + */ + public ApiAppListResponse apiAppList(Integer page) throws ApiException { + Integer pageSize = 20; + + return apiAppListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see ApiAppApi#apiAppListWithHttpInfo(Integer, Integer) + */ + public ApiResponse apiAppListWithHttpInfo(Integer page) throws ApiException { + Integer pageSize = 20; + + return apiAppListWithHttpInfo(page, pageSize); + } + + + /** + * List API Apps + * Returns a list of API Apps that are accessible by you. If you are on a team with an Admin or Developer role, this list will include apps owned by teammates. + * @param page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @return ApiResponse<ApiAppListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse apiAppListWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + + if (page == null) { + page = 1; } - - /** - * Get API App Returns an object with information about an API App. - * - * @param clientId The client id of the API App to retrieve. (required) - * @return ApiResponse<ApiAppGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse apiAppGetWithHttpInfo(String clientId) - throws ApiException { - - // Check required parameters - if (clientId == null) { - throw new ApiException( - 400, "Missing the required parameter 'clientId' when calling apiAppGet"); - } - - // Path parameters - String localVarPath = - "/api_app/{client_id}" - .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "ApiAppApi.apiAppGet", - localVarPath, - "GET", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * List API Apps Returns a list of API Apps that are accessible by you. If you are on a team - * with an Admin or Developer role, this list will include apps owned by teammates. - * - * @param page Which page number of the API App List to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @return ApiAppListResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiAppListResponse apiAppList(Integer page, Integer pageSize) throws ApiException { - return apiAppListWithHttpInfo(page, pageSize).getData(); - } - - /** - * @see ApiAppApi#apiAppList(Integer, Integer) - */ - public ApiAppListResponse apiAppList() throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return apiAppListWithHttpInfo(page, pageSize).getData(); - } - - /** - * @see ApiAppApi#apiAppListWithHttpInfo(Integer, Integer) - */ - public ApiResponse apiAppListWithHttpInfo() throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return apiAppListWithHttpInfo(page, pageSize); + if (pageSize == null) { + pageSize = 20; } - - /** - * @see ApiAppApi#apiAppList(Integer, Integer) - */ - public ApiAppListResponse apiAppList(Integer page) throws ApiException { - Integer pageSize = 20; - - return apiAppListWithHttpInfo(page, pageSize).getData(); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "ApiAppApi.apiAppList", + "/api_app/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Update API App + * Updates an existing API App. Can only be invoked for apps you own. Only the fields you provide will be updated. If you wish to clear an existing optional field, provide an empty string. + * @param clientId The client id of the API App to update. (required) + * @param apiAppUpdateRequest (required) + * @return ApiAppGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiAppGetResponse apiAppUpdate(String clientId, ApiAppUpdateRequest apiAppUpdateRequest) throws ApiException { + return apiAppUpdateWithHttpInfo(clientId, apiAppUpdateRequest).getData(); + } + + + /** + * Update API App + * Updates an existing API App. Can only be invoked for apps you own. Only the fields you provide will be updated. If you wish to clear an existing optional field, provide an empty string. + * @param clientId The client id of the API App to update. (required) + * @param apiAppUpdateRequest (required) + * @return ApiResponse<ApiAppGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse apiAppUpdateWithHttpInfo(String clientId, ApiAppUpdateRequest apiAppUpdateRequest) throws ApiException { + + // Check required parameters + if (clientId == null) { + throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppUpdate"); } - - /** - * @see ApiAppApi#apiAppListWithHttpInfo(Integer, Integer) - */ - public ApiResponse apiAppListWithHttpInfo(Integer page) - throws ApiException { - Integer pageSize = 20; - - return apiAppListWithHttpInfo(page, pageSize); + if (apiAppUpdateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'apiAppUpdateRequest' when calling apiAppUpdate"); } - /** - * List API Apps Returns a list of API Apps that are accessible by you. If you are on a team - * with an Admin or Developer role, this list will include apps owned by teammates. - * - * @param page Which page number of the API App List to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @return ApiResponse<ApiAppListResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse apiAppListWithHttpInfo(Integer page, Integer pageSize) - throws ApiException { - - if (page == null) { - page = 1; - } - if (pageSize == null) { - pageSize = 20; - } - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "ApiAppApi.apiAppList", - "/api_app/list", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Update API App Updates an existing API App. Can only be invoked for apps you own. Only the - * fields you provide will be updated. If you wish to clear an existing optional field, provide - * an empty string. - * - * @param clientId The client id of the API App to update. (required) - * @param apiAppUpdateRequest (required) - * @return ApiAppGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiAppGetResponse apiAppUpdate(String clientId, ApiAppUpdateRequest apiAppUpdateRequest) - throws ApiException { - return apiAppUpdateWithHttpInfo(clientId, apiAppUpdateRequest).getData(); - } - - /** - * Update API App Updates an existing API App. Can only be invoked for apps you own. Only the - * fields you provide will be updated. If you wish to clear an existing optional field, provide - * an empty string. - * - * @param clientId The client id of the API App to update. (required) - * @param apiAppUpdateRequest (required) - * @return ApiResponse<ApiAppGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse apiAppUpdateWithHttpInfo( - String clientId, ApiAppUpdateRequest apiAppUpdateRequest) throws ApiException { - - // Check required parameters - if (clientId == null) { - throw new ApiException( - 400, "Missing the required parameter 'clientId' when calling apiAppUpdate"); - } - if (apiAppUpdateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'apiAppUpdateRequest' when calling" - + " apiAppUpdate"); - } - - // Path parameters - String localVarPath = - "/api_app/{client_id}" - .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = apiAppUpdateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "ApiAppApi.apiAppUpdate", - localVarPath, - "PUT", - new ArrayList<>(), - isFileTypeFound ? null : apiAppUpdateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } -} + // Path parameters + String localVarPath = "/api_app/{client_id}" + .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = apiAppUpdateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "ApiAppApi.apiAppUpdate", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : apiAppUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java index f928d5c26..c96d44107 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java @@ -1,302 +1,286 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; + +import javax.ws.rs.core.GenericType; + import com.dropbox.sign.model.BulkSendJobGetResponse; import com.dropbox.sign.model.BulkSendJobListResponse; +import com.dropbox.sign.model.ErrorResponse; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class BulkSendJobApi { - private ApiClient apiClient; - - public BulkSendJobApi() { - this(Configuration.getDefaultApiClient()); + private ApiClient apiClient; + + public BulkSendJobApi() { + this(Configuration.getDefaultApiClient()); + } + + public BulkSendJobApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get Bulk Send Job + * Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. + * @param bulkSendJobId The id of the BulkSendJob to retrieve. (required) + * @param page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @return BulkSendJobGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public BulkSendJobGetResponse bulkSendJobGet(String bulkSendJobId, Integer page, Integer pageSize) throws ApiException { + return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize).getData(); + } + + + /** + * @see BulkSendJobApi#bulkSendJobGet(String, Integer, Integer) + */ + public BulkSendJobGetResponse bulkSendJobGet(String bulkSendJobId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize).getData(); + } + + /** + * @see BulkSendJobApi#bulkSendJobGetWithHttpInfo(String, Integer, Integer) + */ + public ApiResponse bulkSendJobGetWithHttpInfo(String bulkSendJobId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize); + } + + /** + * @see BulkSendJobApi#bulkSendJobGet(String, Integer, Integer) + */ + public BulkSendJobGetResponse bulkSendJobGet(String bulkSendJobId, Integer page) throws ApiException { + Integer pageSize = 20; + + return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize).getData(); + } + + /** + * @see BulkSendJobApi#bulkSendJobGetWithHttpInfo(String, Integer, Integer) + */ + public ApiResponse bulkSendJobGetWithHttpInfo(String bulkSendJobId, Integer page) throws ApiException { + Integer pageSize = 20; + + return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize); + } + + + /** + * Get Bulk Send Job + * Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. + * @param bulkSendJobId The id of the BulkSendJob to retrieve. (required) + * @param page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @return ApiResponse<BulkSendJobGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse bulkSendJobGetWithHttpInfo(String bulkSendJobId, Integer page, Integer pageSize) throws ApiException { + + if (page == null) { + page = 1; } - - public BulkSendJobApi(ApiClient apiClient) { - this.apiClient = apiClient; + if (pageSize == null) { + pageSize = 20; } - - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; + // Check required parameters + if (bulkSendJobId == null) { + throw new ApiException(400, "Missing the required parameter 'bulkSendJobId' when calling bulkSendJobGet"); } - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Get Bulk Send Job Returns the status of the BulkSendJob and its SignatureRequests specified - * by the `bulk_send_job_id` parameter. - * - * @param bulkSendJobId The id of the BulkSendJob to retrieve. (required) - * @param page Which page number of the BulkSendJob list to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is 20. (optional, default to 20) - * @return BulkSendJobGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public BulkSendJobGetResponse bulkSendJobGet( - String bulkSendJobId, Integer page, Integer pageSize) throws ApiException { - return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize).getData(); - } - - /** - * @see BulkSendJobApi#bulkSendJobGet(String, Integer, Integer) - */ - public BulkSendJobGetResponse bulkSendJobGet(String bulkSendJobId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize).getData(); - } - - /** - * @see BulkSendJobApi#bulkSendJobGetWithHttpInfo(String, Integer, Integer) - */ - public ApiResponse bulkSendJobGetWithHttpInfo(String bulkSendJobId) - throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize); - } - - /** - * @see BulkSendJobApi#bulkSendJobGet(String, Integer, Integer) - */ - public BulkSendJobGetResponse bulkSendJobGet(String bulkSendJobId, Integer page) - throws ApiException { - Integer pageSize = 20; - - return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize).getData(); + // Path parameters + String localVarPath = "/bulk_send_job/{bulk_send_job_id}" + .replaceAll("\\{bulk_send_job_id}", apiClient.escapeString(bulkSendJobId.toString())); + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "BulkSendJobApi.bulkSendJobGet", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * List Bulk Send Jobs + * Returns a list of BulkSendJob that you can access. + * @param page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @return BulkSendJobListResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public BulkSendJobListResponse bulkSendJobList(Integer page, Integer pageSize) throws ApiException { + return bulkSendJobListWithHttpInfo(page, pageSize).getData(); + } + + + /** + * @see BulkSendJobApi#bulkSendJobList(Integer, Integer) + */ + public BulkSendJobListResponse bulkSendJobList() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return bulkSendJobListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see BulkSendJobApi#bulkSendJobListWithHttpInfo(Integer, Integer) + */ + public ApiResponse bulkSendJobListWithHttpInfo() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return bulkSendJobListWithHttpInfo(page, pageSize); + } + + /** + * @see BulkSendJobApi#bulkSendJobList(Integer, Integer) + */ + public BulkSendJobListResponse bulkSendJobList(Integer page) throws ApiException { + Integer pageSize = 20; + + return bulkSendJobListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see BulkSendJobApi#bulkSendJobListWithHttpInfo(Integer, Integer) + */ + public ApiResponse bulkSendJobListWithHttpInfo(Integer page) throws ApiException { + Integer pageSize = 20; + + return bulkSendJobListWithHttpInfo(page, pageSize); + } + + + /** + * List Bulk Send Jobs + * Returns a list of BulkSendJob that you can access. + * @param page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @return ApiResponse<BulkSendJobListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse bulkSendJobListWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + + if (page == null) { + page = 1; } - - /** - * @see BulkSendJobApi#bulkSendJobGetWithHttpInfo(String, Integer, Integer) - */ - public ApiResponse bulkSendJobGetWithHttpInfo( - String bulkSendJobId, Integer page) throws ApiException { - Integer pageSize = 20; - - return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize); - } - - /** - * Get Bulk Send Job Returns the status of the BulkSendJob and its SignatureRequests specified - * by the `bulk_send_job_id` parameter. - * - * @param bulkSendJobId The id of the BulkSendJob to retrieve. (required) - * @param page Which page number of the BulkSendJob list to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is 20. (optional, default to 20) - * @return ApiResponse<BulkSendJobGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse bulkSendJobGetWithHttpInfo( - String bulkSendJobId, Integer page, Integer pageSize) throws ApiException { - - if (page == null) { - page = 1; - } - if (pageSize == null) { - pageSize = 20; - } - // Check required parameters - if (bulkSendJobId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'bulkSendJobId' when calling bulkSendJobGet"); - } - - // Path parameters - String localVarPath = - "/bulk_send_job/{bulk_send_job_id}" - .replaceAll( - "\\{bulk_send_job_id}", - apiClient.escapeString(bulkSendJobId.toString())); - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "BulkSendJobApi.bulkSendJobGet", - localVarPath, - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * List Bulk Send Jobs Returns a list of BulkSendJob that you can access. - * - * @param page Which page number of the BulkSendJob List to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is 20. (optional, default to 20) - * @return BulkSendJobListResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public BulkSendJobListResponse bulkSendJobList(Integer page, Integer pageSize) - throws ApiException { - return bulkSendJobListWithHttpInfo(page, pageSize).getData(); - } - - /** - * @see BulkSendJobApi#bulkSendJobList(Integer, Integer) - */ - public BulkSendJobListResponse bulkSendJobList() throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return bulkSendJobListWithHttpInfo(page, pageSize).getData(); - } - - /** - * @see BulkSendJobApi#bulkSendJobListWithHttpInfo(Integer, Integer) - */ - public ApiResponse bulkSendJobListWithHttpInfo() throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return bulkSendJobListWithHttpInfo(page, pageSize); - } - - /** - * @see BulkSendJobApi#bulkSendJobList(Integer, Integer) - */ - public BulkSendJobListResponse bulkSendJobList(Integer page) throws ApiException { - Integer pageSize = 20; - - return bulkSendJobListWithHttpInfo(page, pageSize).getData(); - } - - /** - * @see BulkSendJobApi#bulkSendJobListWithHttpInfo(Integer, Integer) - */ - public ApiResponse bulkSendJobListWithHttpInfo(Integer page) - throws ApiException { - Integer pageSize = 20; - - return bulkSendJobListWithHttpInfo(page, pageSize); - } - - /** - * List Bulk Send Jobs Returns a list of BulkSendJob that you can access. - * - * @param page Which page number of the BulkSendJob List to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is 20. (optional, default to 20) - * @return ApiResponse<BulkSendJobListResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse bulkSendJobListWithHttpInfo( - Integer page, Integer pageSize) throws ApiException { - - if (page == null) { - page = 1; - } - if (pageSize == null) { - pageSize = 20; - } - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "BulkSendJobApi.bulkSendJobList", - "/bulk_send_job/list", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + if (pageSize == null) { + pageSize = 20; } -} + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "BulkSendJobApi.bulkSendJobList", + "/bulk_send_job/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/EmbeddedApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/EmbeddedApi.java index e89671c3d..68f09d764 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/EmbeddedApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/EmbeddedApi.java @@ -1,212 +1,193 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; +import com.dropbox.sign.Pair; + +import javax.ws.rs.core.GenericType; + import com.dropbox.sign.model.EmbeddedEditUrlRequest; import com.dropbox.sign.model.EmbeddedEditUrlResponse; import com.dropbox.sign.model.EmbeddedSignUrlResponse; +import com.dropbox.sign.model.ErrorResponse; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class EmbeddedApi { - private ApiClient apiClient; - - public EmbeddedApi() { - this(Configuration.getDefaultApiClient()); - } - - public EmbeddedApi(ApiClient apiClient) { - this.apiClient = apiClient; + private ApiClient apiClient; + + public EmbeddedApi() { + this(Configuration.getDefaultApiClient()); + } + + public EmbeddedApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get Embedded Template Edit URL + * Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. + * @param templateId The id of the template to edit. (required) + * @param embeddedEditUrlRequest (required) + * @return EmbeddedEditUrlResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public EmbeddedEditUrlResponse embeddedEditUrl(String templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) throws ApiException { + return embeddedEditUrlWithHttpInfo(templateId, embeddedEditUrlRequest).getData(); + } + + + /** + * Get Embedded Template Edit URL + * Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. + * @param templateId The id of the template to edit. (required) + * @param embeddedEditUrlRequest (required) + * @return ApiResponse<EmbeddedEditUrlResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse embeddedEditUrlWithHttpInfo(String templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling embeddedEditUrl"); } - - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; + if (embeddedEditUrlRequest == null) { + throw new ApiException(400, "Missing the required parameter 'embeddedEditUrlRequest' when calling embeddedEditUrl"); } - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + // Path parameters + String localVarPath = "/embedded/edit_url/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = embeddedEditUrlRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "EmbeddedApi.embeddedEditUrl", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : embeddedEditUrlRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Get Embedded Sign URL + * Retrieves an embedded object containing a signature url that can be opened in an iFrame. Note that templates created via the embedded template process will only be accessible through the API. + * @param signatureId The id of the signature to get a signature url for. (required) + * @return EmbeddedSignUrlResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public EmbeddedSignUrlResponse embeddedSignUrl(String signatureId) throws ApiException { + return embeddedSignUrlWithHttpInfo(signatureId).getData(); + } + + + /** + * Get Embedded Sign URL + * Retrieves an embedded object containing a signature url that can be opened in an iFrame. Note that templates created via the embedded template process will only be accessible through the API. + * @param signatureId The id of the signature to get a signature url for. (required) + * @return ApiResponse<EmbeddedSignUrlResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse embeddedSignUrlWithHttpInfo(String signatureId) throws ApiException { + + // Check required parameters + if (signatureId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureId' when calling embeddedSignUrl"); } - /** - * Get Embedded Template Edit URL Retrieves an embedded object containing a template url that - * can be opened in an iFrame. Note that only templates created via the embedded template - * process are available to be edited with this endpoint. - * - * @param templateId The id of the template to edit. (required) - * @param embeddedEditUrlRequest (required) - * @return EmbeddedEditUrlResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public EmbeddedEditUrlResponse embeddedEditUrl( - String templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) throws ApiException { - return embeddedEditUrlWithHttpInfo(templateId, embeddedEditUrlRequest).getData(); - } - - /** - * Get Embedded Template Edit URL Retrieves an embedded object containing a template url that - * can be opened in an iFrame. Note that only templates created via the embedded template - * process are available to be edited with this endpoint. - * - * @param templateId The id of the template to edit. (required) - * @param embeddedEditUrlRequest (required) - * @return ApiResponse<EmbeddedEditUrlResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse embeddedEditUrlWithHttpInfo( - String templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'templateId' when calling embeddedEditUrl"); - } - if (embeddedEditUrlRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'embeddedEditUrlRequest' when calling" - + " embeddedEditUrl"); - } - - // Path parameters - String localVarPath = - "/embedded/edit_url/{template_id}" - .replaceAll( - "\\{template_id}", apiClient.escapeString(templateId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = embeddedEditUrlRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "EmbeddedApi.embeddedEditUrl", - localVarPath, - "POST", - new ArrayList<>(), - isFileTypeFound ? null : embeddedEditUrlRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Get Embedded Sign URL Retrieves an embedded object containing a signature url that can be - * opened in an iFrame. Note that templates created via the embedded template process will only - * be accessible through the API. - * - * @param signatureId The id of the signature to get a signature url for. (required) - * @return EmbeddedSignUrlResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public EmbeddedSignUrlResponse embeddedSignUrl(String signatureId) throws ApiException { - return embeddedSignUrlWithHttpInfo(signatureId).getData(); - } - - /** - * Get Embedded Sign URL Retrieves an embedded object containing a signature url that can be - * opened in an iFrame. Note that templates created via the embedded template process will only - * be accessible through the API. - * - * @param signatureId The id of the signature to get a signature url for. (required) - * @return ApiResponse<EmbeddedSignUrlResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse embeddedSignUrlWithHttpInfo(String signatureId) - throws ApiException { - - // Check required parameters - if (signatureId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureId' when calling embeddedSignUrl"); - } - - // Path parameters - String localVarPath = - "/embedded/sign_url/{signature_id}" - .replaceAll( - "\\{signature_id}", apiClient.escapeString(signatureId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "EmbeddedApi.embeddedSignUrl", - localVarPath, - "GET", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } -} + // Path parameters + String localVarPath = "/embedded/sign_url/{signature_id}" + .replaceAll("\\{signature_id}", apiClient.escapeString(signatureId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "EmbeddedApi.embeddedSignUrl", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java index 259f1117d..d6df171c9 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxApi.java @@ -1,435 +1,431 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; + +import javax.ws.rs.core.GenericType; + +import com.dropbox.sign.model.ErrorResponse; import com.dropbox.sign.model.FaxGetResponse; import com.dropbox.sign.model.FaxListResponse; import com.dropbox.sign.model.FaxSendRequest; import java.io.File; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class FaxApi { - private ApiClient apiClient; - - public FaxApi() { - this(Configuration.getDefaultApiClient()); + private ApiClient apiClient; + + public FaxApi() { + this(Configuration.getDefaultApiClient()); + } + + public FaxApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Delete Fax + * Deletes the specified Fax from the system + * @param faxId Fax ID (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void faxDelete(String faxId) throws ApiException { + faxDeleteWithHttpInfo(faxId); + } + + + /** + * Delete Fax + * Deletes the specified Fax from the system + * @param faxId Fax ID (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxDeleteWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException(400, "Missing the required parameter 'faxId' when calling faxDelete"); } - public FaxApi(ApiClient apiClient) { - this.apiClient = apiClient; + // Path parameters + String localVarPath = "/fax/{fax_id}" + .replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI( + "FaxApi.faxDelete", + localVarPath, + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); + + } + /** + * Download Fax Files + * Downloads files associated with a Fax + * @param faxId Fax ID (required) + * @return File + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public File faxFiles(String faxId) throws ApiException { + return faxFilesWithHttpInfo(faxId).getData(); + } + + + /** + * Download Fax Files + * Downloads files associated with a Fax + * @param faxId Fax ID (required) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxFilesWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException(400, "Missing the required parameter 'faxId' when calling faxFiles"); } - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; + // Path parameters + String localVarPath = "/fax/files/{fax_id}" + .replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.faxFiles", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Get Fax + * Returns information about a Fax + * @param faxId Fax ID (required) + * @return FaxGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxGetResponse faxGet(String faxId) throws ApiException { + return faxGetWithHttpInfo(faxId).getData(); + } + + + /** + * Get Fax + * Returns information about a Fax + * @param faxId Fax ID (required) + * @return ApiResponse<FaxGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxGetWithHttpInfo(String faxId) throws ApiException { + + // Check required parameters + if (faxId == null) { + throw new ApiException(400, "Missing the required parameter 'faxId' when calling faxGet"); } - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + // Path parameters + String localVarPath = "/fax/{fax_id}" + .replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.faxGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Lists Faxes + * Returns properties of multiple Faxes + * @param page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @return FaxListResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxListResponse faxList(Integer page, Integer pageSize) throws ApiException { + return faxListWithHttpInfo(page, pageSize).getData(); + } + + + /** + * @see FaxApi#faxList(Integer, Integer) + */ + public FaxListResponse faxList() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return faxListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see FaxApi#faxListWithHttpInfo(Integer, Integer) + */ + public ApiResponse faxListWithHttpInfo() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return faxListWithHttpInfo(page, pageSize); + } + + /** + * @see FaxApi#faxList(Integer, Integer) + */ + public FaxListResponse faxList(Integer page) throws ApiException { + Integer pageSize = 20; + + return faxListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see FaxApi#faxListWithHttpInfo(Integer, Integer) + */ + public ApiResponse faxListWithHttpInfo(Integer page) throws ApiException { + Integer pageSize = 20; + + return faxListWithHttpInfo(page, pageSize); + } + + + /** + * Lists Faxes + * Returns properties of multiple Faxes + * @param page Which page number of the Fax List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @return ApiResponse<FaxListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxListWithHttpInfo(Integer page, Integer pageSize) throws ApiException { + + if (page == null) { + page = 1; } - - /** - * Delete Fax Deletes the specified Fax from the system - * - * @param faxId Fax ID (required) - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public void faxDelete(String faxId) throws ApiException { - faxDeleteWithHttpInfo(faxId); + if (pageSize == null) { + pageSize = 20; } - - /** - * Delete Fax Deletes the specified Fax from the system - * - * @param faxId Fax ID (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse faxDeleteWithHttpInfo(String faxId) throws ApiException { - - // Check required parameters - if (faxId == null) { - throw new ApiException( - 400, "Missing the required parameter 'faxId' when calling faxDelete"); - } - - // Path parameters - String localVarPath = - "/fax/{fax_id}".replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key"}; - return apiClient.invokeAPI( - "FaxApi.faxDelete", - localVarPath, - "DELETE", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - null, - false); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.faxList", + "/fax/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Send Fax + * Creates and sends a new Fax with the submitted file(s) + * @param faxSendRequest (required) + * @return FaxGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxGetResponse faxSend(FaxSendRequest faxSendRequest) throws ApiException { + return faxSendWithHttpInfo(faxSendRequest).getData(); + } + + + /** + * Send Fax + * Creates and sends a new Fax with the submitted file(s) + * @param faxSendRequest (required) + * @return ApiResponse<FaxGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxSendWithHttpInfo(FaxSendRequest faxSendRequest) throws ApiException { + + // Check required parameters + if (faxSendRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxSendRequest' when calling faxSend"); } - /** - * Download Fax Files Downloads files associated with a Fax - * - * @param faxId Fax ID (required) - * @return File - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public File faxFiles(String faxId) throws ApiException { - return faxFilesWithHttpInfo(faxId).getData(); - } - - /** - * Download Fax Files Downloads files associated with a Fax - * - * @param faxId Fax ID (required) - * @return ApiResponse<File> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse faxFilesWithHttpInfo(String faxId) throws ApiException { - - // Check required parameters - if (faxId == null) { - throw new ApiException( - 400, "Missing the required parameter 'faxId' when calling faxFiles"); - } - - // Path parameters - String localVarPath = - "/fax/files/{fax_id}" - .replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "FaxApi.faxFiles", - localVarPath, - "GET", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Get Fax Returns information about a Fax - * - * @param faxId Fax ID (required) - * @return FaxGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FaxGetResponse faxGet(String faxId) throws ApiException { - return faxGetWithHttpInfo(faxId).getData(); - } - - /** - * Get Fax Returns information about a Fax - * - * @param faxId Fax ID (required) - * @return ApiResponse<FaxGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse faxGetWithHttpInfo(String faxId) throws ApiException { - - // Check required parameters - if (faxId == null) { - throw new ApiException( - 400, "Missing the required parameter 'faxId' when calling faxGet"); - } - - // Path parameters - String localVarPath = - "/fax/{fax_id}".replaceAll("\\{fax_id}", apiClient.escapeString(faxId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "FaxApi.faxGet", - localVarPath, - "GET", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Lists Faxes Returns properties of multiple Faxes - * - * @param page Which page number of the Fax List to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @return FaxListResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FaxListResponse faxList(Integer page, Integer pageSize) throws ApiException { - return faxListWithHttpInfo(page, pageSize).getData(); - } - - /** - * @see FaxApi#faxList(Integer, Integer) - */ - public FaxListResponse faxList() throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return faxListWithHttpInfo(page, pageSize).getData(); - } - - /** - * @see FaxApi#faxListWithHttpInfo(Integer, Integer) - */ - public ApiResponse faxListWithHttpInfo() throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return faxListWithHttpInfo(page, pageSize); - } - - /** - * @see FaxApi#faxList(Integer, Integer) - */ - public FaxListResponse faxList(Integer page) throws ApiException { - Integer pageSize = 20; - - return faxListWithHttpInfo(page, pageSize).getData(); - } - - /** - * @see FaxApi#faxListWithHttpInfo(Integer, Integer) - */ - public ApiResponse faxListWithHttpInfo(Integer page) throws ApiException { - Integer pageSize = 20; - - return faxListWithHttpInfo(page, pageSize); - } - - /** - * Lists Faxes Returns properties of multiple Faxes - * - * @param page Which page number of the Fax List to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @return ApiResponse<FaxListResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse faxListWithHttpInfo(Integer page, Integer pageSize) - throws ApiException { - - if (page == null) { - page = 1; - } - if (pageSize == null) { - pageSize = 20; - } - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "FaxApi.faxList", - "/fax/list", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Send Fax Creates and sends a new Fax with the submitted file(s) - * - * @param faxSendRequest (required) - * @return FaxGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FaxGetResponse faxSend(FaxSendRequest faxSendRequest) throws ApiException { - return faxSendWithHttpInfo(faxSendRequest).getData(); - } - - /** - * Send Fax Creates and sends a new Fax with the submitted file(s) - * - * @param faxSendRequest (required) - * @return ApiResponse<FaxGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse faxSendWithHttpInfo(FaxSendRequest faxSendRequest) - throws ApiException { - - // Check required parameters - if (faxSendRequest == null) { - throw new ApiException( - 400, "Missing the required parameter 'faxSendRequest' when calling faxSend"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = faxSendRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "FaxApi.faxSend", - "/fax/send", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : faxSendRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } -} + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxSendRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxApi.faxSend", + "/fax/send", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : faxSendRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxLineApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxLineApi.java index 346232fe7..a7ffc0ba3 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxLineApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxLineApi.java @@ -1,10 +1,14 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; + +import javax.ws.rs.core.GenericType; + +import com.dropbox.sign.model.ErrorResponse; import com.dropbox.sign.model.FaxLineAddUserRequest; import com.dropbox.sign.model.FaxLineAreaCodeGetResponse; import com.dropbox.sign.model.FaxLineCreateRequest; @@ -12,710 +16,667 @@ import com.dropbox.sign.model.FaxLineListResponse; import com.dropbox.sign.model.FaxLineRemoveUserRequest; import com.dropbox.sign.model.FaxLineResponse; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class FaxLineApi { - private ApiClient apiClient; - - public FaxLineApi() { - this(Configuration.getDefaultApiClient()); - } - - public FaxLineApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Add Fax Line User Grants a user access to the specified Fax Line. - * - * @param faxLineAddUserRequest (required) - * @return FaxLineResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FaxLineResponse faxLineAddUser(FaxLineAddUserRequest faxLineAddUserRequest) - throws ApiException { - return faxLineAddUserWithHttpInfo(faxLineAddUserRequest).getData(); - } - - /** - * Add Fax Line User Grants a user access to the specified Fax Line. - * - * @param faxLineAddUserRequest (required) - * @return ApiResponse<FaxLineResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse faxLineAddUserWithHttpInfo( - FaxLineAddUserRequest faxLineAddUserRequest) throws ApiException { - - // Check required parameters - if (faxLineAddUserRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'faxLineAddUserRequest' when calling" - + " faxLineAddUser"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = faxLineAddUserRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "FaxLineApi.faxLineAddUser", - "/fax_line/add_user", - "PUT", - new ArrayList<>(), - isFileTypeFound ? null : faxLineAddUserRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Get Available Fax Line Area Codes Returns a list of available area codes for a given - * state/province and city - * - * @param country Filter area codes by country (required) - * @param state Filter area codes by state (optional) - * @param province Filter area codes by province (optional) - * @param city Filter area codes by city (optional) - * @return FaxLineAreaCodeGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FaxLineAreaCodeGetResponse faxLineAreaCodeGet( - String country, String state, String province, String city) throws ApiException { - return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); - } - - /** - * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) - */ - public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country) throws ApiException { - String state = null; - String province = null; - String city = null; - - return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); - } - - /** - * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) - */ - public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country) - throws ApiException { - String state = null; - String province = null; - String city = null; - - return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); - } - - /** - * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) - */ - public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state) - throws ApiException { - String province = null; - String city = null; - - return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); - } - - /** - * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) - */ - public ApiResponse faxLineAreaCodeGetWithHttpInfo( - String country, String state) throws ApiException { - String province = null; - String city = null; - - return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); - } - - /** - * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) - */ - public FaxLineAreaCodeGetResponse faxLineAreaCodeGet( - String country, String state, String province) throws ApiException { - String city = null; - - return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); - } - - /** - * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) - */ - public ApiResponse faxLineAreaCodeGetWithHttpInfo( - String country, String state, String province) throws ApiException { - String city = null; - - return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); - } - - /** - * Get Available Fax Line Area Codes Returns a list of available area codes for a given - * state/province and city - * - * @param country Filter area codes by country (required) - * @param state Filter area codes by state (optional) - * @param province Filter area codes by province (optional) - * @param city Filter area codes by city (optional) - * @return ApiResponse<FaxLineAreaCodeGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse faxLineAreaCodeGetWithHttpInfo( - String country, String state, String province, String city) throws ApiException { - - // Check required parameters - if (country == null) { - throw new ApiException( - 400, - "Missing the required parameter 'country' when calling faxLineAreaCodeGet"); - } - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "country", country)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "state", state)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "province", province)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "city", city)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "FaxLineApi.faxLineAreaCodeGet", - "/fax_line/area_codes", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Purchase Fax Line Purchases a new Fax Line - * - * @param faxLineCreateRequest (required) - * @return FaxLineResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FaxLineResponse faxLineCreate(FaxLineCreateRequest faxLineCreateRequest) - throws ApiException { - return faxLineCreateWithHttpInfo(faxLineCreateRequest).getData(); - } - - /** - * Purchase Fax Line Purchases a new Fax Line - * - * @param faxLineCreateRequest (required) - * @return ApiResponse<FaxLineResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse faxLineCreateWithHttpInfo( - FaxLineCreateRequest faxLineCreateRequest) throws ApiException { - - // Check required parameters - if (faxLineCreateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'faxLineCreateRequest' when calling" - + " faxLineCreate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = faxLineCreateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "FaxLineApi.faxLineCreate", - "/fax_line/create", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : faxLineCreateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Delete Fax Line Deletes the specified Fax Line from the subscription. - * - * @param faxLineDeleteRequest (required) - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public void faxLineDelete(FaxLineDeleteRequest faxLineDeleteRequest) throws ApiException { - faxLineDeleteWithHttpInfo(faxLineDeleteRequest); - } - - /** - * Delete Fax Line Deletes the specified Fax Line from the subscription. - * - * @param faxLineDeleteRequest (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse faxLineDeleteWithHttpInfo(FaxLineDeleteRequest faxLineDeleteRequest) - throws ApiException { - - // Check required parameters - if (faxLineDeleteRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'faxLineDeleteRequest' when calling" - + " faxLineDelete"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = faxLineDeleteRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key"}; - return apiClient.invokeAPI( - "FaxLineApi.faxLineDelete", - "/fax_line", - "DELETE", - new ArrayList<>(), - isFileTypeFound ? null : faxLineDeleteRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - null, - false); - } - - /** - * Get Fax Line Returns the properties and settings of a Fax Line. - * - * @param number The Fax Line number (required) - * @return FaxLineResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FaxLineResponse faxLineGet(String number) throws ApiException { - return faxLineGetWithHttpInfo(number).getData(); - } - - /** - * Get Fax Line Returns the properties and settings of a Fax Line. - * - * @param number The Fax Line number (required) - * @return ApiResponse<FaxLineResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse faxLineGetWithHttpInfo(String number) throws ApiException { - - // Check required parameters - if (number == null) { - throw new ApiException( - 400, "Missing the required parameter 'number' when calling faxLineGet"); - } - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "number", number)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "FaxLineApi.faxLineGet", - "/fax_line", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * List Fax Lines Returns the properties and settings of multiple Fax Lines. - * - * @param accountId Account ID (optional) - * @param page Which page number of the Fax Line List to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @param showTeamLines Include Fax Lines belonging to team members in the list (optional) - * @return FaxLineListResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FaxLineListResponse faxLineList( - String accountId, Integer page, Integer pageSize, Boolean showTeamLines) - throws ApiException { - return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); - } - - /** - * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) - */ - public FaxLineListResponse faxLineList() throws ApiException { - String accountId = null; - Integer page = 1; - Integer pageSize = 20; - Boolean showTeamLines = null; - - return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); - } - - /** - * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) - */ - public ApiResponse faxLineListWithHttpInfo() throws ApiException { - String accountId = null; - Integer page = 1; - Integer pageSize = 20; - Boolean showTeamLines = null; - - return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); - } - - /** - * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) - */ - public FaxLineListResponse faxLineList(String accountId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - Boolean showTeamLines = null; - - return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); - } - - /** - * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) - */ - public ApiResponse faxLineListWithHttpInfo(String accountId) - throws ApiException { - Integer page = 1; - Integer pageSize = 20; - Boolean showTeamLines = null; - - return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); - } - - /** - * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) - */ - public FaxLineListResponse faxLineList(String accountId, Integer page) throws ApiException { - Integer pageSize = 20; - Boolean showTeamLines = null; - - return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); - } - - /** - * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) - */ - public ApiResponse faxLineListWithHttpInfo(String accountId, Integer page) - throws ApiException { - Integer pageSize = 20; - Boolean showTeamLines = null; - - return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); - } - - /** - * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) - */ - public FaxLineListResponse faxLineList(String accountId, Integer page, Integer pageSize) - throws ApiException { - Boolean showTeamLines = null; - - return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); - } - - /** - * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) - */ - public ApiResponse faxLineListWithHttpInfo( - String accountId, Integer page, Integer pageSize) throws ApiException { - Boolean showTeamLines = null; - - return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); - } - - /** - * List Fax Lines Returns the properties and settings of multiple Fax Lines. - * - * @param accountId Account ID (optional) - * @param page Which page number of the Fax Line List to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @param showTeamLines Include Fax Lines belonging to team members in the list (optional) - * @return ApiResponse<FaxLineListResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse faxLineListWithHttpInfo( - String accountId, Integer page, Integer pageSize, Boolean showTeamLines) - throws ApiException { - - if (page == null) { - page = 1; - } - if (pageSize == null) { - pageSize = 20; - } - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "account_id", accountId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "show_team_lines", showTeamLines)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "FaxLineApi.faxLineList", - "/fax_line/list", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Remove Fax Line Access Removes a user's access to the specified Fax Line - * - * @param faxLineRemoveUserRequest (required) - * @return FaxLineResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FaxLineResponse faxLineRemoveUser(FaxLineRemoveUserRequest faxLineRemoveUserRequest) - throws ApiException { - return faxLineRemoveUserWithHttpInfo(faxLineRemoveUserRequest).getData(); - } - - /** - * Remove Fax Line Access Removes a user's access to the specified Fax Line - * - * @param faxLineRemoveUserRequest (required) - * @return ApiResponse<FaxLineResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse faxLineRemoveUserWithHttpInfo( - FaxLineRemoveUserRequest faxLineRemoveUserRequest) throws ApiException { - - // Check required parameters - if (faxLineRemoveUserRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'faxLineRemoveUserRequest' when calling" - + " faxLineRemoveUser"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = faxLineRemoveUserRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "FaxLineApi.faxLineRemoveUser", - "/fax_line/remove_user", - "PUT", - new ArrayList<>(), - isFileTypeFound ? null : faxLineRemoveUserRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } -} + private ApiClient apiClient; + + public FaxLineApi() { + this(Configuration.getDefaultApiClient()); + } + + public FaxLineApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add Fax Line User + * Grants a user access to the specified Fax Line. + * @param faxLineAddUserRequest (required) + * @return FaxLineResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxLineResponse faxLineAddUser(FaxLineAddUserRequest faxLineAddUserRequest) throws ApiException { + return faxLineAddUserWithHttpInfo(faxLineAddUserRequest).getData(); + } + + + /** + * Add Fax Line User + * Grants a user access to the specified Fax Line. + * @param faxLineAddUserRequest (required) + * @return ApiResponse<FaxLineResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineAddUserWithHttpInfo(FaxLineAddUserRequest faxLineAddUserRequest) throws ApiException { + + // Check required parameters + if (faxLineAddUserRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineAddUserRequest' when calling faxLineAddUser"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineAddUserRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineAddUser", + "/fax_line/add_user", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : faxLineAddUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Get Available Fax Line Area Codes + * Returns a list of available area codes for a given state/province and city + * @param country Filter area codes by country (required) + * @param state Filter area codes by state (optional) + * @param province Filter area codes by province (optional) + * @param city Filter area codes by city (optional) + * @return FaxLineAreaCodeGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state, String province, String city) throws ApiException { + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + + /** + * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) + */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country) throws ApiException { + String state = null; + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) + */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country) throws ApiException { + String state = null; + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) + */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state) throws ApiException { + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) + */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country, String state) throws ApiException { + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) + */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state, String province) throws ApiException { + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) + */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country, String state, String province) throws ApiException { + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); + } + + + /** + * Get Available Fax Line Area Codes + * Returns a list of available area codes for a given state/province and city + * @param country Filter area codes by country (required) + * @param state Filter area codes by state (optional) + * @param province Filter area codes by province (optional) + * @param city Filter area codes by city (optional) + * @return ApiResponse<FaxLineAreaCodeGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country, String state, String province, String city) throws ApiException { + + // Check required parameters + if (country == null) { + throw new ApiException(400, "Missing the required parameter 'country' when calling faxLineAreaCodeGet"); + } + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "country", country) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "state", state)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "province", province)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "city", city)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineAreaCodeGet", + "/fax_line/area_codes", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Purchase Fax Line + * Purchases a new Fax Line + * @param faxLineCreateRequest (required) + * @return FaxLineResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxLineResponse faxLineCreate(FaxLineCreateRequest faxLineCreateRequest) throws ApiException { + return faxLineCreateWithHttpInfo(faxLineCreateRequest).getData(); + } + + + /** + * Purchase Fax Line + * Purchases a new Fax Line + * @param faxLineCreateRequest (required) + * @return ApiResponse<FaxLineResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineCreateWithHttpInfo(FaxLineCreateRequest faxLineCreateRequest) throws ApiException { + + // Check required parameters + if (faxLineCreateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineCreateRequest' when calling faxLineCreate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineCreate", + "/fax_line/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : faxLineCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Delete Fax Line + * Deletes the specified Fax Line from the subscription. + * @param faxLineDeleteRequest (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void faxLineDelete(FaxLineDeleteRequest faxLineDeleteRequest) throws ApiException { + faxLineDeleteWithHttpInfo(faxLineDeleteRequest); + } + + + /** + * Delete Fax Line + * Deletes the specified Fax Line from the subscription. + * @param faxLineDeleteRequest (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineDeleteWithHttpInfo(FaxLineDeleteRequest faxLineDeleteRequest) throws ApiException { + + // Check required parameters + if (faxLineDeleteRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineDeleteRequest' when calling faxLineDelete"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineDeleteRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineDelete", + "/fax_line", + "DELETE", + new ArrayList<>(), + isFileTypeFound ? null : faxLineDeleteRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); + + } + /** + * Get Fax Line + * Returns the properties and settings of a Fax Line. + * @param number The Fax Line number (required) + * @return FaxLineResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxLineResponse faxLineGet(String number) throws ApiException { + return faxLineGetWithHttpInfo(number).getData(); + } + + + /** + * Get Fax Line + * Returns the properties and settings of a Fax Line. + * @param number The Fax Line number (required) + * @return ApiResponse<FaxLineResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineGetWithHttpInfo(String number) throws ApiException { + + // Check required parameters + if (number == null) { + throw new ApiException(400, "Missing the required parameter 'number' when calling faxLineGet"); + } + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "number", number) + ); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineGet", + "/fax_line", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * List Fax Lines + * Returns the properties and settings of multiple Fax Lines. + * @param accountId Account ID (optional) + * @param page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param showTeamLines Include Fax Lines belonging to team members in the list (optional) + * @return FaxLineListResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxLineListResponse faxLineList(String accountId, Integer page, Integer pageSize, Boolean showTeamLines) throws ApiException { + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList(String accountId, Integer page, Integer pageSize) throws ApiException { + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo(String accountId, Integer page, Integer pageSize) throws ApiException { + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + + /** + * List Fax Lines + * Returns the properties and settings of multiple Fax Lines. + * @param accountId Account ID (optional) + * @param page Which page number of the Fax Line List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param showTeamLines Include Fax Lines belonging to team members in the list (optional) + * @return ApiResponse<FaxLineListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineListWithHttpInfo(String accountId, Integer page, Integer pageSize, Boolean showTeamLines) throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "show_team_lines", showTeamLines)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineList", + "/fax_line/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Remove Fax Line Access + * Removes a user's access to the specified Fax Line + * @param faxLineRemoveUserRequest (required) + * @return FaxLineResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FaxLineResponse faxLineRemoveUser(FaxLineRemoveUserRequest faxLineRemoveUserRequest) throws ApiException { + return faxLineRemoveUserWithHttpInfo(faxLineRemoveUserRequest).getData(); + } + + + /** + * Remove Fax Line Access + * Removes a user's access to the specified Fax Line + * @param faxLineRemoveUserRequest (required) + * @return ApiResponse<FaxLineResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineRemoveUserWithHttpInfo(FaxLineRemoveUserRequest faxLineRemoveUserRequest) throws ApiException { + + // Check required parameters + if (faxLineRemoveUserRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineRemoveUserRequest' when calling faxLineRemoveUser"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineRemoveUserRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineRemoveUser", + "/fax_line/remove_user", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : faxLineRemoveUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/OAuthApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/OAuthApi.java index 4286c030c..10aa3fa8e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/OAuthApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/OAuthApi.java @@ -1,194 +1,178 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; +import com.dropbox.sign.Pair; + +import javax.ws.rs.core.GenericType; + +import com.dropbox.sign.model.ErrorResponse; import com.dropbox.sign.model.OAuthTokenGenerateRequest; import com.dropbox.sign.model.OAuthTokenRefreshRequest; import com.dropbox.sign.model.OAuthTokenResponse; + import java.util.ArrayList; +import java.util.HashMap; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class OAuthApi { - private ApiClient apiClient; + private ApiClient apiClient; - public OAuthApi() { - this(Configuration.getDefaultApiClient()); - } + public OAuthApi() { + this(Configuration.getDefaultApiClient()); + } - public OAuthApi(ApiClient apiClient) { - this.apiClient = apiClient; - } + public OAuthApi(ApiClient apiClient) { + this.apiClient = apiClient; + } - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; - } + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } - /** - * OAuth Token Generate Once you have retrieved the code from the user callback, you will need - * to exchange it for an access token via a backend call. - * - * @param oauthTokenGenerateRequest (required) - * @return OAuthTokenResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public OAuthTokenResponse oauthTokenGenerate( - OAuthTokenGenerateRequest oauthTokenGenerateRequest) throws ApiException { - return oauthTokenGenerateWithHttpInfo(oauthTokenGenerateRequest).getData(); - } + /** + * OAuth Token Generate + * Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. + * @param oauthTokenGenerateRequest (required) + * @return OAuthTokenResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public OAuthTokenResponse oauthTokenGenerate(OAuthTokenGenerateRequest oauthTokenGenerateRequest) throws ApiException { + return oauthTokenGenerateWithHttpInfo(oauthTokenGenerateRequest).getData(); + } - /** - * OAuth Token Generate Once you have retrieved the code from the user callback, you will need - * to exchange it for an access token via a backend call. - * - * @param oauthTokenGenerateRequest (required) - * @return ApiResponse<OAuthTokenResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse oauthTokenGenerateWithHttpInfo( - OAuthTokenGenerateRequest oauthTokenGenerateRequest) throws ApiException { - - // Check required parameters - if (oauthTokenGenerateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'oauthTokenGenerateRequest' when calling" - + " oauthTokenGenerate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = oauthTokenGenerateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "OAuthApi.oauthTokenGenerate", - "/oauth/token", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : oauthTokenGenerateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - null, - localVarReturnType, - false); - } - /** - * OAuth Token Refresh Access tokens are only valid for a given period of time (typically one - * hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see - * `expires_in`), along with a refresh token that can be used to acquire a new access - * token after the current one has expired. - * - * @param oauthTokenRefreshRequest (required) - * @return OAuthTokenResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public OAuthTokenResponse oauthTokenRefresh(OAuthTokenRefreshRequest oauthTokenRefreshRequest) - throws ApiException { - return oauthTokenRefreshWithHttpInfo(oauthTokenRefreshRequest).getData(); + /** + * OAuth Token Generate + * Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. + * @param oauthTokenGenerateRequest (required) + * @return ApiResponse<OAuthTokenResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse oauthTokenGenerateWithHttpInfo(OAuthTokenGenerateRequest oauthTokenGenerateRequest) throws ApiException { + + // Check required parameters + if (oauthTokenGenerateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'oauthTokenGenerateRequest' when calling oauthTokenGenerate"); } - /** - * OAuth Token Refresh Access tokens are only valid for a given period of time (typically one - * hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see - * `expires_in`), along with a refresh token that can be used to acquire a new access - * token after the current one has expired. - * - * @param oauthTokenRefreshRequest (required) - * @return ApiResponse<OAuthTokenResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse oauthTokenRefreshWithHttpInfo( - OAuthTokenRefreshRequest oauthTokenRefreshRequest) throws ApiException { - - // Check required parameters - if (oauthTokenRefreshRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'oauthTokenRefreshRequest' when calling" - + " oauthTokenRefresh"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = oauthTokenRefreshRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "OAuthApi.oauthTokenRefresh", - "/oauth/token?refresh", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : oauthTokenRefreshRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - null, - localVarReturnType, - false); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = oauthTokenGenerateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "OAuthApi.oauthTokenGenerate", + "/oauth/token", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : oauthTokenGenerateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + null, + localVarReturnType, + false + ); + + } + /** + * OAuth Token Refresh + * Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired. + * @param oauthTokenRefreshRequest (required) + * @return OAuthTokenResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public OAuthTokenResponse oauthTokenRefresh(OAuthTokenRefreshRequest oauthTokenRefreshRequest) throws ApiException { + return oauthTokenRefreshWithHttpInfo(oauthTokenRefreshRequest).getData(); + } + + + /** + * OAuth Token Refresh + * Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired. + * @param oauthTokenRefreshRequest (required) + * @return ApiResponse<OAuthTokenResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse oauthTokenRefreshWithHttpInfo(OAuthTokenRefreshRequest oauthTokenRefreshRequest) throws ApiException { + + // Check required parameters + if (oauthTokenRefreshRequest == null) { + throw new ApiException(400, "Missing the required parameter 'oauthTokenRefreshRequest' when calling oauthTokenRefresh"); } -} + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = oauthTokenRefreshRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "OAuthApi.oauthTokenRefresh", + "/oauth/token?refresh", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : oauthTokenRefreshRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + null, + localVarReturnType, + false + ); + + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/ReportApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/ReportApi.java index 32c6bea91..37e086bd5 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/ReportApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/ReportApi.java @@ -1,122 +1,115 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; +import com.dropbox.sign.Pair; + +import javax.ws.rs.core.GenericType; + +import com.dropbox.sign.model.ErrorResponse; import com.dropbox.sign.model.ReportCreateRequest; import com.dropbox.sign.model.ReportCreateResponse; + import java.util.ArrayList; +import java.util.HashMap; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class ReportApi { - private ApiClient apiClient; + private ApiClient apiClient; - public ReportApi() { - this(Configuration.getDefaultApiClient()); - } + public ReportApi() { + this(Configuration.getDefaultApiClient()); + } - public ReportApi(ApiClient apiClient) { - this.apiClient = apiClient; - } + public ReportApi(ApiClient apiClient) { + this.apiClient = apiClient; + } - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; - } + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } - /** - * Create Report Request the creation of one or more report(s). When the report(s) have been - * generated, you will receive an email (one per requested report type) containing a link to - * download the report as a CSV file. The requested date range may be up to 12 months in - * duration, and `start_date` must not be more than 10 years in the past. - * - * @param reportCreateRequest (required) - * @return ReportCreateResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ReportCreateResponse reportCreate(ReportCreateRequest reportCreateRequest) - throws ApiException { - return reportCreateWithHttpInfo(reportCreateRequest).getData(); - } + /** + * Create Report + * Request the creation of one or more report(s). When the report(s) have been generated, you will receive an email (one per requested report type) containing a link to download the report as a CSV file. The requested date range may be up to 12 months in duration, and `start_date` must not be more than 10 years in the past. + * @param reportCreateRequest (required) + * @return ReportCreateResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ReportCreateResponse reportCreate(ReportCreateRequest reportCreateRequest) throws ApiException { + return reportCreateWithHttpInfo(reportCreateRequest).getData(); + } - /** - * Create Report Request the creation of one or more report(s). When the report(s) have been - * generated, you will receive an email (one per requested report type) containing a link to - * download the report as a CSV file. The requested date range may be up to 12 months in - * duration, and `start_date` must not be more than 10 years in the past. - * - * @param reportCreateRequest (required) - * @return ApiResponse<ReportCreateResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse reportCreateWithHttpInfo( - ReportCreateRequest reportCreateRequest) throws ApiException { - // Check required parameters - if (reportCreateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'reportCreateRequest' when calling" - + " reportCreate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = reportCreateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "ReportApi.reportCreate", - "/report/create", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : reportCreateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + /** + * Create Report + * Request the creation of one or more report(s). When the report(s) have been generated, you will receive an email (one per requested report type) containing a link to download the report as a CSV file. The requested date range may be up to 12 months in duration, and `start_date` must not be more than 10 years in the past. + * @param reportCreateRequest (required) + * @return ApiResponse<ReportCreateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse reportCreateWithHttpInfo(ReportCreateRequest reportCreateRequest) throws ApiException { + + // Check required parameters + if (reportCreateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'reportCreateRequest' when calling reportCreate"); } -} + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = reportCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "ReportApi.reportCreate", + "/report/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : reportCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java index acda9a05e..9c5dee17b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java @@ -1,11 +1,16 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; + +import javax.ws.rs.core.GenericType; + import com.dropbox.sign.model.BulkSendJobSendResponse; +import com.dropbox.sign.model.ErrorResponse; +import java.io.File; import com.dropbox.sign.model.FileResponse; import com.dropbox.sign.model.FileResponseDataUri; import com.dropbox.sign.model.SignatureRequestBulkCreateEmbeddedWithTemplateRequest; @@ -22,1969 +27,1557 @@ import com.dropbox.sign.model.SignatureRequestSendRequest; import com.dropbox.sign.model.SignatureRequestSendWithTemplateRequest; import com.dropbox.sign.model.SignatureRequestUpdateRequest; -import java.io.File; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class SignatureRequestApi { - private ApiClient apiClient; - - public SignatureRequestApi() { - this(Configuration.getDefaultApiClient()); - } - - public SignatureRequestApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Embedded Bulk Send with Template Creates BulkSendJob which sends up to 250 SignatureRequests - * in bulk based off of the provided Template(s) specified with the `template_ids` - * parameter to be signed in an embedded iFrame. These embedded signature requests can only be - * signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox - * Sign. **NOTE:** Only available for Standard plan and higher. - * - * @param signatureRequestBulkCreateEmbeddedWithTemplateRequest (required) - * @return BulkSendJobSendResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public BulkSendJobSendResponse signatureRequestBulkCreateEmbeddedWithTemplate( - SignatureRequestBulkCreateEmbeddedWithTemplateRequest - signatureRequestBulkCreateEmbeddedWithTemplateRequest) - throws ApiException { - return signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo( - signatureRequestBulkCreateEmbeddedWithTemplateRequest) - .getData(); - } - - /** - * Embedded Bulk Send with Template Creates BulkSendJob which sends up to 250 SignatureRequests - * in bulk based off of the provided Template(s) specified with the `template_ids` - * parameter to be signed in an embedded iFrame. These embedded signature requests can only be - * signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox - * Sign. **NOTE:** Only available for Standard plan and higher. - * - * @param signatureRequestBulkCreateEmbeddedWithTemplateRequest (required) - * @return ApiResponse<BulkSendJobSendResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse - signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo( - SignatureRequestBulkCreateEmbeddedWithTemplateRequest - signatureRequestBulkCreateEmbeddedWithTemplateRequest) - throws ApiException { - - // Check required parameters - if (signatureRequestBulkCreateEmbeddedWithTemplateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter" - + " 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' when calling" - + " signatureRequestBulkCreateEmbeddedWithTemplate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestBulkCreateEmbeddedWithTemplateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestBulkCreateEmbeddedWithTemplate", - "/signature_request/bulk_create_embedded_with_template", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : signatureRequestBulkCreateEmbeddedWithTemplateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Bulk Send with Template Creates BulkSendJob which sends up to 250 SignatureRequests in bulk - * based off of the provided Template(s) specified with the `template_ids` parameter. - * **NOTE:** Only available for Standard plan and higher. - * - * @param signatureRequestBulkSendWithTemplateRequest (required) - * @return BulkSendJobSendResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public BulkSendJobSendResponse signatureRequestBulkSendWithTemplate( - SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) - throws ApiException { - return signatureRequestBulkSendWithTemplateWithHttpInfo( - signatureRequestBulkSendWithTemplateRequest) - .getData(); - } - - /** - * Bulk Send with Template Creates BulkSendJob which sends up to 250 SignatureRequests in bulk - * based off of the provided Template(s) specified with the `template_ids` parameter. - * **NOTE:** Only available for Standard plan and higher. - * - * @param signatureRequestBulkSendWithTemplateRequest (required) - * @return ApiResponse<BulkSendJobSendResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestBulkSendWithTemplateWithHttpInfo( - SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) - throws ApiException { - - // Check required parameters - if (signatureRequestBulkSendWithTemplateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestBulkSendWithTemplateRequest'" - + " when calling signatureRequestBulkSendWithTemplate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestBulkSendWithTemplateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestBulkSendWithTemplate", - "/signature_request/bulk_send_with_template", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : signatureRequestBulkSendWithTemplateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Cancel Incomplete Signature Request Cancels an incomplete signature request. This action is - * **not reversible**. The request will be canceled and signers will no longer be able to sign. - * If they try to access the signature request they will receive a HTTP 410 status code - * indicating that the resource has been deleted. Cancelation is asynchronous and a successful - * call to this endpoint will return an empty 200 OK response if the signature request is - * eligible to be canceled and has been successfully queued. This 200 OK response does not - * indicate a successful cancelation of the signature request itself. The cancelation is - * confirmed via the `signature_request_canceled` event. It is recommended that a - * [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the - * `signature_request_canceled` event. This callback will be sent only when the - * cancelation has completed successfully. If a callback handler has been configured and the - * event has not been received within 60 minutes of making the call, check the status of the - * request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the - * cancelation if necessary. To be eligible for cancelation, a signature request must have been - * sent successfully, must not yet have been signed by all signers, and you must either be the - * sender or own the API app under which it was sent. A partially signed signature request can - * be canceled. **NOTE:** To remove your access to a completed signature request, use the - * endpoint: `POST /signature_request/remove/[:signature_request_id]`. - * - * @param signatureRequestId The id of the incomplete SignatureRequest to cancel. (required) - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public void signatureRequestCancel(String signatureRequestId) throws ApiException { - signatureRequestCancelWithHttpInfo(signatureRequestId); - } - - /** - * Cancel Incomplete Signature Request Cancels an incomplete signature request. This action is - * **not reversible**. The request will be canceled and signers will no longer be able to sign. - * If they try to access the signature request they will receive a HTTP 410 status code - * indicating that the resource has been deleted. Cancelation is asynchronous and a successful - * call to this endpoint will return an empty 200 OK response if the signature request is - * eligible to be canceled and has been successfully queued. This 200 OK response does not - * indicate a successful cancelation of the signature request itself. The cancelation is - * confirmed via the `signature_request_canceled` event. It is recommended that a - * [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the - * `signature_request_canceled` event. This callback will be sent only when the - * cancelation has completed successfully. If a callback handler has been configured and the - * event has not been received within 60 minutes of making the call, check the status of the - * request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the - * cancelation if necessary. To be eligible for cancelation, a signature request must have been - * sent successfully, must not yet have been signed by all signers, and you must either be the - * sender or own the API app under which it was sent. A partially signed signature request can - * be canceled. **NOTE:** To remove your access to a completed signature request, use the - * endpoint: `POST /signature_request/remove/[:signature_request_id]`. - * - * @param signatureRequestId The id of the incomplete SignatureRequest to cancel. (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestCancelWithHttpInfo(String signatureRequestId) - throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestCancel"); - } - - // Path parameters - String localVarPath = - "/signature_request/cancel/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestCancel", - localVarPath, - "POST", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - null, - false); - } - - /** - * Create Embedded Signature Request Creates a new SignatureRequest with the submitted documents - * to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature - * page will be affixed where all signers will be required to add their signature, signifying - * their agreement to all contained documents. Note that embedded signature requests can only be - * signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox - * Sign. - * - * @param signatureRequestCreateEmbeddedRequest (required) - * @return SignatureRequestGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestGetResponse signatureRequestCreateEmbedded( - SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) - throws ApiException { - return signatureRequestCreateEmbeddedWithHttpInfo(signatureRequestCreateEmbeddedRequest) - .getData(); - } - - /** - * Create Embedded Signature Request Creates a new SignatureRequest with the submitted documents - * to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature - * page will be affixed where all signers will be required to add their signature, signifying - * their agreement to all contained documents. Note that embedded signature requests can only be - * signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox - * Sign. - * - * @param signatureRequestCreateEmbeddedRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestCreateEmbeddedWithHttpInfo( - SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) - throws ApiException { - - // Check required parameters - if (signatureRequestCreateEmbeddedRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestCreateEmbeddedRequest' when" - + " calling signatureRequestCreateEmbedded"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestCreateEmbeddedRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestCreateEmbedded", - "/signature_request/create_embedded", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : signatureRequestCreateEmbeddedRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Create Embedded Signature Request with Template Creates a new SignatureRequest based on the - * given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests - * can only be signed in embedded iFrames whereas normal signature requests can only be signed - * on Dropbox Sign. - * - * @param signatureRequestCreateEmbeddedWithTemplateRequest (required) - * @return SignatureRequestGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestGetResponse signatureRequestCreateEmbeddedWithTemplate( - SignatureRequestCreateEmbeddedWithTemplateRequest - signatureRequestCreateEmbeddedWithTemplateRequest) - throws ApiException { - return signatureRequestCreateEmbeddedWithTemplateWithHttpInfo( - signatureRequestCreateEmbeddedWithTemplateRequest) - .getData(); - } - - /** - * Create Embedded Signature Request with Template Creates a new SignatureRequest based on the - * given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests - * can only be signed in embedded iFrames whereas normal signature requests can only be signed - * on Dropbox Sign. - * - * @param signatureRequestCreateEmbeddedWithTemplateRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse - signatureRequestCreateEmbeddedWithTemplateWithHttpInfo( - SignatureRequestCreateEmbeddedWithTemplateRequest - signatureRequestCreateEmbeddedWithTemplateRequest) - throws ApiException { - - // Check required parameters - if (signatureRequestCreateEmbeddedWithTemplateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter" - + " 'signatureRequestCreateEmbeddedWithTemplateRequest' when calling" - + " signatureRequestCreateEmbeddedWithTemplate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestCreateEmbeddedWithTemplateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestCreateEmbeddedWithTemplate", - "/signature_request/create_embedded_with_template", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : signatureRequestCreateEmbeddedWithTemplateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Edit Signature Request Edits and sends a SignatureRequest with the submitted documents. If - * `form_fields_per_document` is not specified, a signature page will be affixed where - * all signers will be required to add their signature, signifying their agreement to all - * contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. - * - * @param signatureRequestId The id of the SignatureRequest to edit. (required) - * @param signatureRequestEditRequest (required) - * @return SignatureRequestGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestGetResponse signatureRequestEdit( - String signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest) - throws ApiException { - return signatureRequestEditWithHttpInfo(signatureRequestId, signatureRequestEditRequest) - .getData(); - } - - /** - * Edit Signature Request Edits and sends a SignatureRequest with the submitted documents. If - * `form_fields_per_document` is not specified, a signature page will be affixed where - * all signers will be required to add their signature, signifying their agreement to all - * contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. - * - * @param signatureRequestId The id of the SignatureRequest to edit. (required) - * @param signatureRequestEditRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestEditWithHttpInfo( - String signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest) - throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestEdit"); - } - if (signatureRequestEditRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestEditRequest' when calling" - + " signatureRequestEdit"); - } - - // Path parameters - String localVarPath = - "/signature_request/edit/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestEditRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestEdit", - localVarPath, - "PUT", - new ArrayList<>(), - isFileTypeFound ? null : signatureRequestEditRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Edit Embedded Signature Request Edits a SignatureRequest with the submitted documents to be - * signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page - * will be affixed where all signers will be required to add their signature, signifying their - * agreement to all contained documents. Note that embedded signature requests can only be - * signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox - * Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. - * - * @param signatureRequestId The id of the SignatureRequest to edit. (required) - * @param signatureRequestEditEmbeddedRequest (required) - * @return SignatureRequestGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestGetResponse signatureRequestEditEmbedded( - String signatureRequestId, - SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest) - throws ApiException { - return signatureRequestEditEmbeddedWithHttpInfo( - signatureRequestId, signatureRequestEditEmbeddedRequest) - .getData(); + private ApiClient apiClient; + + public SignatureRequestApi() { + this(Configuration.getDefaultApiClient()); + } + + public SignatureRequestApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Embedded Bulk Send with Template + * Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Only available for Standard plan and higher. + * @param signatureRequestBulkCreateEmbeddedWithTemplateRequest (required) + * @return BulkSendJobSendResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public BulkSendJobSendResponse signatureRequestBulkCreateEmbeddedWithTemplate(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest) throws ApiException { + return signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(signatureRequestBulkCreateEmbeddedWithTemplateRequest).getData(); + } + + + /** + * Embedded Bulk Send with Template + * Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Only available for Standard plan and higher. + * @param signatureRequestBulkCreateEmbeddedWithTemplateRequest (required) + * @return ApiResponse<BulkSendJobSendResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest) throws ApiException { + + // Check required parameters + if (signatureRequestBulkCreateEmbeddedWithTemplateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' when calling signatureRequestBulkCreateEmbeddedWithTemplate"); } - /** - * Edit Embedded Signature Request Edits a SignatureRequest with the submitted documents to be - * signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page - * will be affixed where all signers will be required to add their signature, signifying their - * agreement to all contained documents. Note that embedded signature requests can only be - * signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox - * Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. - * - * @param signatureRequestId The id of the SignatureRequest to edit. (required) - * @param signatureRequestEditEmbeddedRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestEditEmbeddedWithHttpInfo( - String signatureRequestId, - SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest) - throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestEditEmbedded"); - } - if (signatureRequestEditEmbeddedRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestEditEmbeddedRequest' when" - + " calling signatureRequestEditEmbedded"); - } - - // Path parameters - String localVarPath = - "/signature_request/edit_embedded/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestEditEmbeddedRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestEditEmbedded", - localVarPath, - "PUT", - new ArrayList<>(), - isFileTypeFound ? null : signatureRequestEditEmbeddedRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestBulkCreateEmbeddedWithTemplateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestBulkCreateEmbeddedWithTemplate", + "/signature_request/bulk_create_embedded_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestBulkCreateEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Bulk Send with Template + * Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE:** Only available for Standard plan and higher. + * @param signatureRequestBulkSendWithTemplateRequest (required) + * @return BulkSendJobSendResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public BulkSendJobSendResponse signatureRequestBulkSendWithTemplate(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) throws ApiException { + return signatureRequestBulkSendWithTemplateWithHttpInfo(signatureRequestBulkSendWithTemplateRequest).getData(); + } + + + /** + * Bulk Send with Template + * Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE:** Only available for Standard plan and higher. + * @param signatureRequestBulkSendWithTemplateRequest (required) + * @return ApiResponse<BulkSendJobSendResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestBulkSendWithTemplateWithHttpInfo(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) throws ApiException { + + // Check required parameters + if (signatureRequestBulkSendWithTemplateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestBulkSendWithTemplateRequest' when calling signatureRequestBulkSendWithTemplate"); } - /** - * Edit Embedded Signature Request with Template Edits a SignatureRequest based on the given - * Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can - * only be signed in embedded iFrames whereas normal signature requests can only be signed on - * Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. - * - * @param signatureRequestId The id of the SignatureRequest to edit. (required) - * @param signatureRequestEditEmbeddedWithTemplateRequest (required) - * @return SignatureRequestGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestGetResponse signatureRequestEditEmbeddedWithTemplate( - String signatureRequestId, - SignatureRequestEditEmbeddedWithTemplateRequest - signatureRequestEditEmbeddedWithTemplateRequest) - throws ApiException { - return signatureRequestEditEmbeddedWithTemplateWithHttpInfo( - signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest) - .getData(); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestBulkSendWithTemplateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestBulkSendWithTemplate", + "/signature_request/bulk_send_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestBulkSendWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Cancel Incomplete Signature Request + * Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. + * @param signatureRequestId The id of the incomplete SignatureRequest to cancel. (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void signatureRequestCancel(String signatureRequestId) throws ApiException { + signatureRequestCancelWithHttpInfo(signatureRequestId); + } + + + /** + * Cancel Incomplete Signature Request + * Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. + * @param signatureRequestId The id of the incomplete SignatureRequest to cancel. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestCancelWithHttpInfo(String signatureRequestId) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestCancel"); } - /** - * Edit Embedded Signature Request with Template Edits a SignatureRequest based on the given - * Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can - * only be signed in embedded iFrames whereas normal signature requests can only be signed on - * Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. - * - * @param signatureRequestId The id of the SignatureRequest to edit. (required) - * @param signatureRequestEditEmbeddedWithTemplateRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse - signatureRequestEditEmbeddedWithTemplateWithHttpInfo( - String signatureRequestId, - SignatureRequestEditEmbeddedWithTemplateRequest - signatureRequestEditEmbeddedWithTemplateRequest) - throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestEditEmbeddedWithTemplate"); - } - if (signatureRequestEditEmbeddedWithTemplateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter" - + " 'signatureRequestEditEmbeddedWithTemplateRequest' when calling" - + " signatureRequestEditEmbeddedWithTemplate"); - } - - // Path parameters - String localVarPath = - "/signature_request/edit_embedded_with_template/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestEditEmbeddedWithTemplateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestEditEmbeddedWithTemplate", - localVarPath, - "PUT", - new ArrayList<>(), - isFileTypeFound ? null : signatureRequestEditEmbeddedWithTemplateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + // Path parameters + String localVarPath = "/signature_request/cancel/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestCancel", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); + + } + /** + * Create Embedded Signature Request + * Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + * @param signatureRequestCreateEmbeddedRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestCreateEmbedded(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) throws ApiException { + return signatureRequestCreateEmbeddedWithHttpInfo(signatureRequestCreateEmbeddedRequest).getData(); + } + + + /** + * Create Embedded Signature Request + * Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + * @param signatureRequestCreateEmbeddedRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestCreateEmbeddedWithHttpInfo(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) throws ApiException { + + // Check required parameters + if (signatureRequestCreateEmbeddedRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestCreateEmbeddedRequest' when calling signatureRequestCreateEmbedded"); } - /** - * Edit Signature Request With Template Edits and sends a SignatureRequest based off of the - * Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* - * deduct your signature request quota. - * - * @param signatureRequestId The id of the SignatureRequest to edit. (required) - * @param signatureRequestEditWithTemplateRequest (required) - * @return SignatureRequestGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestGetResponse signatureRequestEditWithTemplate( - String signatureRequestId, - SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest) - throws ApiException { - return signatureRequestEditWithTemplateWithHttpInfo( - signatureRequestId, signatureRequestEditWithTemplateRequest) - .getData(); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestCreateEmbeddedRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestCreateEmbedded", + "/signature_request/create_embedded", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestCreateEmbeddedRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Create Embedded Signature Request with Template + * Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + * @param signatureRequestCreateEmbeddedWithTemplateRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestCreateEmbeddedWithTemplate(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest) throws ApiException { + return signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(signatureRequestCreateEmbeddedWithTemplateRequest).getData(); + } + + + /** + * Create Embedded Signature Request with Template + * Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + * @param signatureRequestCreateEmbeddedWithTemplateRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest) throws ApiException { + + // Check required parameters + if (signatureRequestCreateEmbeddedWithTemplateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestCreateEmbeddedWithTemplateRequest' when calling signatureRequestCreateEmbeddedWithTemplate"); } - /** - * Edit Signature Request With Template Edits and sends a SignatureRequest based off of the - * Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* - * deduct your signature request quota. - * - * @param signatureRequestId The id of the SignatureRequest to edit. (required) - * @param signatureRequestEditWithTemplateRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestEditWithTemplateWithHttpInfo( - String signatureRequestId, - SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest) - throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestEditWithTemplate"); - } - if (signatureRequestEditWithTemplateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestEditWithTemplateRequest' when" - + " calling signatureRequestEditWithTemplate"); - } - - // Path parameters - String localVarPath = - "/signature_request/edit_with_template/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestEditWithTemplateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestEditWithTemplate", - localVarPath, - "PUT", - new ArrayList<>(), - isFileTypeFound ? null : signatureRequestEditWithTemplateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestCreateEmbeddedWithTemplateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestCreateEmbeddedWithTemplate", + "/signature_request/create_embedded_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestCreateEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Edit Signature Request + * Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestEdit(String signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest) throws ApiException { + return signatureRequestEditWithHttpInfo(signatureRequestId, signatureRequestEditRequest).getData(); + } + + + /** + * Edit Signature Request + * Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestEditWithHttpInfo(String signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestEdit"); } - - /** - * Download Files Obtain a copy of the current documents specified by the - * `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are - * currently being prepared, a status code of `409` will be returned instead. - * - * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @param fileType Set to `pdf` for a single merged document or `zip` for a - * collection of individual documents. (optional, default to pdf) - * @return File - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public File signatureRequestFiles(String signatureRequestId, String fileType) - throws ApiException { - return signatureRequestFilesWithHttpInfo(signatureRequestId, fileType).getData(); - } - - /** - * @see SignatureRequestApi#signatureRequestFiles(String, String) - */ - public File signatureRequestFiles(String signatureRequestId) throws ApiException { - String fileType = "pdf"; - - return signatureRequestFilesWithHttpInfo(signatureRequestId, fileType).getData(); - } - - /** - * @see SignatureRequestApi#signatureRequestFilesWithHttpInfo(String, String) - */ - public ApiResponse signatureRequestFilesWithHttpInfo(String signatureRequestId) - throws ApiException { - String fileType = "pdf"; - - return signatureRequestFilesWithHttpInfo(signatureRequestId, fileType); - } - - /** - * Download Files Obtain a copy of the current documents specified by the - * `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are - * currently being prepared, a status code of `409` will be returned instead. - * - * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @param fileType Set to `pdf` for a single merged document or `zip` for a - * collection of individual documents. (optional, default to pdf) - * @return ApiResponse<File> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestFilesWithHttpInfo( - String signatureRequestId, String fileType) throws ApiException { - - if (fileType == null) { - fileType = "pdf"; - } - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestFiles"); - } - - // Path parameters - String localVarPath = - "/signature_request/files/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "file_type", fileType)); - - String localVarAccept = - apiClient.selectHeaderAccept( - "application/pdf", "application/zip", "application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestFiles", - localVarPath, - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Download Files as Data Uri Obtain a copy of the current documents specified by the - * `signature_request_id` parameter. Returns a JSON object with a `data_uri` - * representing the base64 encoded file (PDFs only). If the files are currently being prepared, - * a status code of `409` will be returned instead. - * - * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @return FileResponseDataUri - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FileResponseDataUri signatureRequestFilesAsDataUri(String signatureRequestId) - throws ApiException { - return signatureRequestFilesAsDataUriWithHttpInfo(signatureRequestId).getData(); - } - - /** - * Download Files as Data Uri Obtain a copy of the current documents specified by the - * `signature_request_id` parameter. Returns a JSON object with a `data_uri` - * representing the base64 encoded file (PDFs only). If the files are currently being prepared, - * a status code of `409` will be returned instead. - * - * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @return ApiResponse<FileResponseDataUri> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestFilesAsDataUriWithHttpInfo( - String signatureRequestId) throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestFilesAsDataUri"); - } - - // Path parameters - String localVarPath = - "/signature_request/files_as_data_uri/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestFilesAsDataUri", - localVarPath, - "GET", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Download Files as File Url Obtain a copy of the current documents specified by the - * `signature_request_id` parameter. Returns a JSON object with a url to the file - * (PDFs only). If the files are currently being prepared, a status code of `409` will - * be returned instead. - * - * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @param forceDownload By default when opening the `file_url` a browser will download - * the PDF and save it locally. When set to `0` the PDF file will be displayed in - * the browser. (optional, default to 1) - * @return FileResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FileResponse signatureRequestFilesAsFileUrl( - String signatureRequestId, Integer forceDownload) throws ApiException { - return signatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload) - .getData(); - } - - /** - * @see SignatureRequestApi#signatureRequestFilesAsFileUrl(String, Integer) - */ - public FileResponse signatureRequestFilesAsFileUrl(String signatureRequestId) - throws ApiException { - Integer forceDownload = 1; - - return signatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload) - .getData(); - } - - /** - * @see SignatureRequestApi#signatureRequestFilesAsFileUrlWithHttpInfo(String, Integer) - */ - public ApiResponse signatureRequestFilesAsFileUrlWithHttpInfo( - String signatureRequestId) throws ApiException { - Integer forceDownload = 1; - - return signatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload); + if (signatureRequestEditRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestEditRequest' when calling signatureRequestEdit"); } - /** - * Download Files as File Url Obtain a copy of the current documents specified by the - * `signature_request_id` parameter. Returns a JSON object with a url to the file - * (PDFs only). If the files are currently being prepared, a status code of `409` will - * be returned instead. - * - * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @param forceDownload By default when opening the `file_url` a browser will download - * the PDF and save it locally. When set to `0` the PDF file will be displayed in - * the browser. (optional, default to 1) - * @return ApiResponse<FileResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestFilesAsFileUrlWithHttpInfo( - String signatureRequestId, Integer forceDownload) throws ApiException { - - if (forceDownload == null) { - forceDownload = 1; - } - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestFilesAsFileUrl"); - } - - // Path parameters - String localVarPath = - "/signature_request/files_as_file_url/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "force_download", forceDownload)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestFilesAsFileUrl", - localVarPath, - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + // Path parameters + String localVarPath = "/signature_request/edit/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestEditRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestEdit", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestEditRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Edit Embedded Signature Request + * Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditEmbeddedRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestEditEmbedded(String signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest) throws ApiException { + return signatureRequestEditEmbeddedWithHttpInfo(signatureRequestId, signatureRequestEditEmbeddedRequest).getData(); + } + + + /** + * Edit Embedded Signature Request + * Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditEmbeddedRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestEditEmbeddedWithHttpInfo(String signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestEditEmbedded"); } - - /** - * Get Signature Request Returns the status of the SignatureRequest specified by the - * `signature_request_id` parameter. - * - * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @return SignatureRequestGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestGetResponse signatureRequestGet(String signatureRequestId) - throws ApiException { - return signatureRequestGetWithHttpInfo(signatureRequestId).getData(); + if (signatureRequestEditEmbeddedRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestEditEmbeddedRequest' when calling signatureRequestEditEmbedded"); } - /** - * Get Signature Request Returns the status of the SignatureRequest specified by the - * `signature_request_id` parameter. - * - * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestGetWithHttpInfo( - String signatureRequestId) throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestGet"); - } - - // Path parameters - String localVarPath = - "/signature_request/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestGet", - localVarPath, - "GET", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + // Path parameters + String localVarPath = "/signature_request/edit_embedded/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestEditEmbeddedRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestEditEmbedded", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestEditEmbeddedRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Edit Embedded Signature Request with Template + * Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditEmbeddedWithTemplateRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestEditEmbeddedWithTemplate(String signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest) throws ApiException { + return signatureRequestEditEmbeddedWithTemplateWithHttpInfo(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest).getData(); + } + + + /** + * Edit Embedded Signature Request with Template + * Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditEmbeddedWithTemplateRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestEditEmbeddedWithTemplateWithHttpInfo(String signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestEditEmbeddedWithTemplate"); } - - /** - * List Signature Requests Returns a list of SignatureRequests that you can access. This - * includes SignatureRequests you have sent as well as received, but not ones that you have been - * CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about - * querying signature requests. - * - * @param accountId Which account to return SignatureRequests for. Must be a team member. Use - * `all` to indicate all team members. Defaults to your account. (optional) - * @param page Which page number of the SignatureRequest List to return. Defaults to - * `1`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @param query String that includes search terms and/or fields to be used to filter the - * SignatureRequest objects. (optional) - * @return SignatureRequestListResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestListResponse signatureRequestList( - String accountId, Integer page, Integer pageSize, String query) throws ApiException { - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); + if (signatureRequestEditEmbeddedWithTemplateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestEditEmbeddedWithTemplateRequest' when calling signatureRequestEditEmbeddedWithTemplate"); } - /** - * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) - */ - public SignatureRequestListResponse signatureRequestList() throws ApiException { - String accountId = null; - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); + // Path parameters + String localVarPath = "/signature_request/edit_embedded_with_template/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestEditEmbeddedWithTemplateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestEditEmbeddedWithTemplate", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestEditEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Edit Signature Request With Template + * Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* deduct your signature request quota. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditWithTemplateRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestEditWithTemplate(String signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest) throws ApiException { + return signatureRequestEditWithTemplateWithHttpInfo(signatureRequestId, signatureRequestEditWithTemplateRequest).getData(); + } + + + /** + * Edit Signature Request With Template + * Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* deduct your signature request quota. + * @param signatureRequestId The id of the SignatureRequest to edit. (required) + * @param signatureRequestEditWithTemplateRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestEditWithTemplateWithHttpInfo(String signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestEditWithTemplate"); } - - /** - * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse signatureRequestListWithHttpInfo() - throws ApiException { - String accountId = null; - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); + if (signatureRequestEditWithTemplateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestEditWithTemplateRequest' when calling signatureRequestEditWithTemplate"); } - /** - * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) - */ - public SignatureRequestListResponse signatureRequestList(String accountId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); + // Path parameters + String localVarPath = "/signature_request/edit_with_template/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestEditWithTemplateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestEditWithTemplate", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestEditWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Download Files + * Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. + * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @param fileType Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to pdf) + * @return File + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public File signatureRequestFiles(String signatureRequestId, String fileType) throws ApiException { + return signatureRequestFilesWithHttpInfo(signatureRequestId, fileType).getData(); + } + + + /** + * @see SignatureRequestApi#signatureRequestFiles(String, String) + */ + public File signatureRequestFiles(String signatureRequestId) throws ApiException { + String fileType = "pdf"; + + return signatureRequestFilesWithHttpInfo(signatureRequestId, fileType).getData(); + } + + /** + * @see SignatureRequestApi#signatureRequestFilesWithHttpInfo(String, String) + */ + public ApiResponse signatureRequestFilesWithHttpInfo(String signatureRequestId) throws ApiException { + String fileType = "pdf"; + + return signatureRequestFilesWithHttpInfo(signatureRequestId, fileType); + } + + + /** + * Download Files + * Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. + * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @param fileType Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to pdf) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestFilesWithHttpInfo(String signatureRequestId, String fileType) throws ApiException { + + if (fileType == null) { + fileType = "pdf"; } - - /** - * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse signatureRequestListWithHttpInfo( - String accountId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFiles"); } - /** - * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) - */ - public SignatureRequestListResponse signatureRequestList(String accountId, Integer page) - throws ApiException { - Integer pageSize = 20; - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); + // Path parameters + String localVarPath = "/signature_request/files/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "file_type", fileType) + ); + + String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "application/zip", "application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestFiles", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Download Files as Data Uri + * Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @return FileResponseDataUri + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FileResponseDataUri signatureRequestFilesAsDataUri(String signatureRequestId) throws ApiException { + return signatureRequestFilesAsDataUriWithHttpInfo(signatureRequestId).getData(); + } + + + /** + * Download Files as Data Uri + * Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @return ApiResponse<FileResponseDataUri> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestFilesAsDataUriWithHttpInfo(String signatureRequestId) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFilesAsDataUri"); } - /** - * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse signatureRequestListWithHttpInfo( - String accountId, Integer page) throws ApiException { - Integer pageSize = 20; - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); + // Path parameters + String localVarPath = "/signature_request/files_as_data_uri/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestFilesAsDataUri", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Download Files as File Url + * Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @param forceDownload By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @return FileResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FileResponse signatureRequestFilesAsFileUrl(String signatureRequestId, Integer forceDownload) throws ApiException { + return signatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload).getData(); + } + + + /** + * @see SignatureRequestApi#signatureRequestFilesAsFileUrl(String, Integer) + */ + public FileResponse signatureRequestFilesAsFileUrl(String signatureRequestId) throws ApiException { + Integer forceDownload = 1; + + return signatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload).getData(); + } + + /** + * @see SignatureRequestApi#signatureRequestFilesAsFileUrlWithHttpInfo(String, Integer) + */ + public ApiResponse signatureRequestFilesAsFileUrlWithHttpInfo(String signatureRequestId) throws ApiException { + Integer forceDownload = 1; + + return signatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload); + } + + + /** + * Download Files as File Url + * Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @param forceDownload By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @return ApiResponse<FileResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestFilesAsFileUrlWithHttpInfo(String signatureRequestId, Integer forceDownload) throws ApiException { + + if (forceDownload == null) { + forceDownload = 1; } - - /** - * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) - */ - public SignatureRequestListResponse signatureRequestList( - String accountId, Integer page, Integer pageSize) throws ApiException { - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFilesAsFileUrl"); } - /** - * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse signatureRequestListWithHttpInfo( - String accountId, Integer page, Integer pageSize) throws ApiException { - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); - } - - /** - * List Signature Requests Returns a list of SignatureRequests that you can access. This - * includes SignatureRequests you have sent as well as received, but not ones that you have been - * CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about - * querying signature requests. - * - * @param accountId Which account to return SignatureRequests for. Must be a team member. Use - * `all` to indicate all team members. Defaults to your account. (optional) - * @param page Which page number of the SignatureRequest List to return. Defaults to - * `1`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @param query String that includes search terms and/or fields to be used to filter the - * SignatureRequest objects. (optional) - * @return ApiResponse<SignatureRequestListResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestListWithHttpInfo( - String accountId, Integer page, Integer pageSize, String query) throws ApiException { - - if (page == null) { - page = 1; - } - if (pageSize == null) { - pageSize = 20; - } - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "account_id", accountId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestList", - "/signature_request/list", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Release On-Hold Signature Request Releases a held SignatureRequest that was claimed and - * prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft - * must indicate at Draft creation that the SignatureRequest created from the Draft should be - * held. Releasing the SignatureRequest will send requests to all signers. - * - * @param signatureRequestId The id of the SignatureRequest to release. (required) - * @return SignatureRequestGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestGetResponse signatureRequestReleaseHold(String signatureRequestId) - throws ApiException { - return signatureRequestReleaseHoldWithHttpInfo(signatureRequestId).getData(); + // Path parameters + String localVarPath = "/signature_request/files_as_file_url/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "force_download", forceDownload) + ); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestFilesAsFileUrl", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Get Signature Request + * Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. + * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestGet(String signatureRequestId) throws ApiException { + return signatureRequestGetWithHttpInfo(signatureRequestId).getData(); + } + + + /** + * Get Signature Request + * Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. + * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestGetWithHttpInfo(String signatureRequestId) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestGet"); } - /** - * Release On-Hold Signature Request Releases a held SignatureRequest that was claimed and - * prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft - * must indicate at Draft creation that the SignatureRequest created from the Draft should be - * held. Releasing the SignatureRequest will send requests to all signers. - * - * @param signatureRequestId The id of the SignatureRequest to release. (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestReleaseHoldWithHttpInfo( - String signatureRequestId) throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestReleaseHold"); - } - - // Path parameters - String localVarPath = - "/signature_request/release_hold/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestReleaseHold", - localVarPath, - "POST", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + // Path parameters + String localVarPath = "/signature_request/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * List Signature Requests + * Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. + * @param accountId Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @return SignatureRequestListResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestListResponse signatureRequestList(String accountId, Integer page, Integer pageSize, String query) throws ApiException { + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + + /** + * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) + */ + public SignatureRequestListResponse signatureRequestList() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse signatureRequestListWithHttpInfo() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); + } + + /** + * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) + */ + public SignatureRequestListResponse signatureRequestList(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse signatureRequestListWithHttpInfo(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); + } + + /** + * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) + */ + public SignatureRequestListResponse signatureRequestList(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse signatureRequestListWithHttpInfo(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); + } + + /** + * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) + */ + public SignatureRequestListResponse signatureRequestList(String accountId, Integer page, Integer pageSize) throws ApiException { + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse signatureRequestListWithHttpInfo(String accountId, Integer page, Integer pageSize) throws ApiException { + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); + } + + + /** + * List Signature Requests + * Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. + * @param accountId Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @return ApiResponse<SignatureRequestListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestListWithHttpInfo(String accountId, Integer page, Integer pageSize, String query) throws ApiException { + + if (page == null) { + page = 1; } - - /** - * Send Request Reminder Sends an email to the signer reminding them to sign the signature - * request. You cannot send a reminder within 1 hour of the last reminder that was sent. This - * includes manual AND automatic reminders. **NOTE:** This action can **not** be used with - * embedded signature requests. - * - * @param signatureRequestId The id of the SignatureRequest to send a reminder for. (required) - * @param signatureRequestRemindRequest (required) - * @return SignatureRequestGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestGetResponse signatureRequestRemind( - String signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) - throws ApiException { - return signatureRequestRemindWithHttpInfo(signatureRequestId, signatureRequestRemindRequest) - .getData(); + if (pageSize == null) { + pageSize = 20; } - - /** - * Send Request Reminder Sends an email to the signer reminding them to sign the signature - * request. You cannot send a reminder within 1 hour of the last reminder that was sent. This - * includes manual AND automatic reminders. **NOTE:** This action can **not** be used with - * embedded signature requests. - * - * @param signatureRequestId The id of the SignatureRequest to send a reminder for. (required) - * @param signatureRequestRemindRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestRemindWithHttpInfo( - String signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) - throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestRemind"); - } - if (signatureRequestRemindRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestRemindRequest' when calling" - + " signatureRequestRemind"); - } - - // Path parameters - String localVarPath = - "/signature_request/remind/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestRemindRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestRemind", - localVarPath, - "POST", - new ArrayList<>(), - isFileTypeFound ? null : signatureRequestRemindRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestList", + "/signature_request/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Release On-Hold Signature Request + * Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. + * @param signatureRequestId The id of the SignatureRequest to release. (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestReleaseHold(String signatureRequestId) throws ApiException { + return signatureRequestReleaseHoldWithHttpInfo(signatureRequestId).getData(); + } + + + /** + * Release On-Hold Signature Request + * Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. + * @param signatureRequestId The id of the SignatureRequest to release. (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestReleaseHoldWithHttpInfo(String signatureRequestId) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestReleaseHold"); } - /** - * Remove Signature Request Access Removes your access to a completed signature request. This - * action is **not reversible**. The signature request must be fully executed by all parties - * (signed or declined to sign). Other parties will continue to maintain access to the completed - * signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous - * and your access will be immediately removed. Upon successful removal, this endpoint will - * return a 200 OK response. - * - * @param signatureRequestId The id of the SignatureRequest to remove. (required) - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public void signatureRequestRemove(String signatureRequestId) throws ApiException { - signatureRequestRemoveWithHttpInfo(signatureRequestId); + // Path parameters + String localVarPath = "/signature_request/release_hold/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestReleaseHold", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Send Request Reminder + * Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE:** This action can **not** be used with embedded signature requests. + * @param signatureRequestId The id of the SignatureRequest to send a reminder for. (required) + * @param signatureRequestRemindRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestRemind(String signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) throws ApiException { + return signatureRequestRemindWithHttpInfo(signatureRequestId, signatureRequestRemindRequest).getData(); + } + + + /** + * Send Request Reminder + * Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE:** This action can **not** be used with embedded signature requests. + * @param signatureRequestId The id of the SignatureRequest to send a reminder for. (required) + * @param signatureRequestRemindRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestRemindWithHttpInfo(String signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestRemind"); } - - /** - * Remove Signature Request Access Removes your access to a completed signature request. This - * action is **not reversible**. The signature request must be fully executed by all parties - * (signed or declined to sign). Other parties will continue to maintain access to the completed - * signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous - * and your access will be immediately removed. Upon successful removal, this endpoint will - * return a 200 OK response. - * - * @param signatureRequestId The id of the SignatureRequest to remove. (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestRemoveWithHttpInfo(String signatureRequestId) - throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestRemove"); - } - - // Path parameters - String localVarPath = - "/signature_request/remove/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key"}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestRemove", - localVarPath, - "POST", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - null, - false); + if (signatureRequestRemindRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestRemindRequest' when calling signatureRequestRemind"); } - /** - * Send Signature Request Creates and sends a new SignatureRequest with the submitted documents. - * If `form_fields_per_document` is not specified, a signature page will be affixed - * where all signers will be required to add their signature, signifying their agreement to all - * contained documents. - * - * @param signatureRequestSendRequest (required) - * @return SignatureRequestGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestGetResponse signatureRequestSend( - SignatureRequestSendRequest signatureRequestSendRequest) throws ApiException { - return signatureRequestSendWithHttpInfo(signatureRequestSendRequest).getData(); + // Path parameters + String localVarPath = "/signature_request/remind/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestRemindRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestRemind", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestRemindRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Remove Signature Request Access + * Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. + * @param signatureRequestId The id of the SignatureRequest to remove. (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void signatureRequestRemove(String signatureRequestId) throws ApiException { + signatureRequestRemoveWithHttpInfo(signatureRequestId); + } + + + /** + * Remove Signature Request Access + * Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. + * @param signatureRequestId The id of the SignatureRequest to remove. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestRemoveWithHttpInfo(String signatureRequestId) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestRemove"); } - /** - * Send Signature Request Creates and sends a new SignatureRequest with the submitted documents. - * If `form_fields_per_document` is not specified, a signature page will be affixed - * where all signers will be required to add their signature, signifying their agreement to all - * contained documents. - * - * @param signatureRequestSendRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestSendWithHttpInfo( - SignatureRequestSendRequest signatureRequestSendRequest) throws ApiException { - - // Check required parameters - if (signatureRequestSendRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestSendRequest' when calling" - + " signatureRequestSend"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestSendRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestSend", - "/signature_request/send", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : signatureRequestSendRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + // Path parameters + String localVarPath = "/signature_request/remove/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestRemove", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); + + } + /** + * Send Signature Request + * Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. + * @param signatureRequestSendRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestSend(SignatureRequestSendRequest signatureRequestSendRequest) throws ApiException { + return signatureRequestSendWithHttpInfo(signatureRequestSendRequest).getData(); + } + + + /** + * Send Signature Request + * Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. + * @param signatureRequestSendRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestSendWithHttpInfo(SignatureRequestSendRequest signatureRequestSendRequest) throws ApiException { + + // Check required parameters + if (signatureRequestSendRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestSendRequest' when calling signatureRequestSend"); } - /** - * Send with Template Creates and sends a new SignatureRequest based off of the Template(s) - * specified with the `template_ids` parameter. - * - * @param signatureRequestSendWithTemplateRequest (required) - * @return SignatureRequestGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestGetResponse signatureRequestSendWithTemplate( - SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) - throws ApiException { - return signatureRequestSendWithTemplateWithHttpInfo(signatureRequestSendWithTemplateRequest) - .getData(); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestSendRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestSend", + "/signature_request/send", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestSendRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Send with Template + * Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. + * @param signatureRequestSendWithTemplateRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestSendWithTemplate(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) throws ApiException { + return signatureRequestSendWithTemplateWithHttpInfo(signatureRequestSendWithTemplateRequest).getData(); + } + + + /** + * Send with Template + * Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. + * @param signatureRequestSendWithTemplateRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestSendWithTemplateWithHttpInfo(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) throws ApiException { + + // Check required parameters + if (signatureRequestSendWithTemplateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestSendWithTemplateRequest' when calling signatureRequestSendWithTemplate"); } - /** - * Send with Template Creates and sends a new SignatureRequest based off of the Template(s) - * specified with the `template_ids` parameter. - * - * @param signatureRequestSendWithTemplateRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestSendWithTemplateWithHttpInfo( - SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) - throws ApiException { - - // Check required parameters - if (signatureRequestSendWithTemplateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestSendWithTemplateRequest' when" - + " calling signatureRequestSendWithTemplate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestSendWithTemplateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestSendWithTemplate", - "/signature_request/send_with_template", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : signatureRequestSendWithTemplateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestSendWithTemplateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestSendWithTemplate", + "/signature_request/send_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestSendWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Update Signature Request + * Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE:** This action cannot be performed on a signature request with an appended signature page. + * @param signatureRequestId The id of the SignatureRequest to update. (required) + * @param signatureRequestUpdateRequest (required) + * @return SignatureRequestGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public SignatureRequestGetResponse signatureRequestUpdate(String signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) throws ApiException { + return signatureRequestUpdateWithHttpInfo(signatureRequestId, signatureRequestUpdateRequest).getData(); + } + + + /** + * Update Signature Request + * Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE:** This action cannot be performed on a signature request with an appended signature page. + * @param signatureRequestId The id of the SignatureRequest to update. (required) + * @param signatureRequestUpdateRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestUpdateWithHttpInfo(String signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestUpdate"); } - - /** - * Update Signature Request Updates the email address and/or the name for a given signer on a - * signature request. You can listen for the `signature_request_email_bounce` event on - * your app or account to detect bounced emails, and respond with this method. Updating the - * email address of a signer will generate a new `signature_id` value. **NOTE:** This - * action cannot be performed on a signature request with an appended signature page. - * - * @param signatureRequestId The id of the SignatureRequest to update. (required) - * @param signatureRequestUpdateRequest (required) - * @return SignatureRequestGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public SignatureRequestGetResponse signatureRequestUpdate( - String signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) - throws ApiException { - return signatureRequestUpdateWithHttpInfo(signatureRequestId, signatureRequestUpdateRequest) - .getData(); + if (signatureRequestUpdateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestUpdateRequest' when calling signatureRequestUpdate"); } - /** - * Update Signature Request Updates the email address and/or the name for a given signer on a - * signature request. You can listen for the `signature_request_email_bounce` event on - * your app or account to detect bounced emails, and respond with this method. Updating the - * email address of a signer will generate a new `signature_id` value. **NOTE:** This - * action cannot be performed on a signature request with an appended signature page. - * - * @param signatureRequestId The id of the SignatureRequest to update. (required) - * @param signatureRequestUpdateRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestUpdateWithHttpInfo( - String signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) - throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " signatureRequestUpdate"); - } - if (signatureRequestUpdateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestUpdateRequest' when calling" - + " signatureRequestUpdate"); - } - - // Path parameters - String localVarPath = - "/signature_request/update/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestUpdateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "SignatureRequestApi.signatureRequestUpdate", - localVarPath, - "POST", - new ArrayList<>(), - isFileTypeFound ? null : signatureRequestUpdateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } -} + // Path parameters + String localVarPath = "/signature_request/update/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestUpdateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestUpdate", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/TeamApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/TeamApi.java index 7ccffdb6d..730ccfcac 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/TeamApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/TeamApi.java @@ -1,10 +1,14 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; + +import javax.ws.rs.core.GenericType; + +import com.dropbox.sign.model.ErrorResponse; import com.dropbox.sign.model.TeamAddMemberRequest; import com.dropbox.sign.model.TeamCreateRequest; import com.dropbox.sign.model.TeamGetInfoResponse; @@ -14,904 +18,847 @@ import com.dropbox.sign.model.TeamRemoveMemberRequest; import com.dropbox.sign.model.TeamSubTeamsResponse; import com.dropbox.sign.model.TeamUpdateRequest; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class TeamApi { - private ApiClient apiClient; - - public TeamApi() { - this(Configuration.getDefaultApiClient()); - } - - public TeamApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Add User to Team Invites a user (specified using the `email_address` parameter) to - * your Team. If the user does not currently have a Dropbox Sign Account, a new one will be - * created for them. If a user is already a part of another Team, a - * `team_invite_failed` error will be returned. - * - * @param teamAddMemberRequest (required) - * @param teamId The id of the team. (optional) - * @return TeamGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TeamGetResponse teamAddMember(TeamAddMemberRequest teamAddMemberRequest, String teamId) - throws ApiException { - return teamAddMemberWithHttpInfo(teamAddMemberRequest, teamId).getData(); - } - - /** - * @see TeamApi#teamAddMember(TeamAddMemberRequest, String) - */ - public TeamGetResponse teamAddMember(TeamAddMemberRequest teamAddMemberRequest) - throws ApiException { - String teamId = null; - - return teamAddMemberWithHttpInfo(teamAddMemberRequest, teamId).getData(); - } - - /** - * @see TeamApi#teamAddMemberWithHttpInfo(TeamAddMemberRequest, String) - */ - public ApiResponse teamAddMemberWithHttpInfo( - TeamAddMemberRequest teamAddMemberRequest) throws ApiException { - String teamId = null; - - return teamAddMemberWithHttpInfo(teamAddMemberRequest, teamId); - } - - /** - * Add User to Team Invites a user (specified using the `email_address` parameter) to - * your Team. If the user does not currently have a Dropbox Sign Account, a new one will be - * created for them. If a user is already a part of another Team, a - * `team_invite_failed` error will be returned. - * - * @param teamAddMemberRequest (required) - * @param teamId The id of the team. (optional) - * @return ApiResponse<TeamGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse teamAddMemberWithHttpInfo( - TeamAddMemberRequest teamAddMemberRequest, String teamId) throws ApiException { - - // Check required parameters - if (teamAddMemberRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'teamAddMemberRequest' when calling" - + " teamAddMember"); - } - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "team_id", teamId)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = teamAddMemberRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "TeamApi.teamAddMember", - "/team/add_member", - "PUT", - localVarQueryParams, - isFileTypeFound ? null : teamAddMemberRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Create Team Creates a new Team and makes you a member. You must not currently belong to a - * Team to invoke. - * - * @param teamCreateRequest (required) - * @return TeamGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TeamGetResponse teamCreate(TeamCreateRequest teamCreateRequest) throws ApiException { - return teamCreateWithHttpInfo(teamCreateRequest).getData(); - } - - /** - * Create Team Creates a new Team and makes you a member. You must not currently belong to a - * Team to invoke. - * - * @param teamCreateRequest (required) - * @return ApiResponse<TeamGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse teamCreateWithHttpInfo(TeamCreateRequest teamCreateRequest) - throws ApiException { - - // Check required parameters - if (teamCreateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'teamCreateRequest' when calling teamCreate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = teamCreateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "TeamApi.teamCreate", - "/team/create", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : teamCreateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Delete Team Deletes your Team. Can only be invoked when you have a Team with only one member - * (yourself). - * - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public void teamDelete() throws ApiException { - teamDeleteWithHttpInfo(); - } - - /** - * Delete Team Deletes your Team. Can only be invoked when you have a Team with only one member - * (yourself). - * - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse teamDeleteWithHttpInfo() throws ApiException { - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - return apiClient.invokeAPI( - "TeamApi.teamDelete", - "/team/destroy", - "DELETE", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - null, - false); - } - - /** - * Get Team Returns information about your Team as well as a list of its members. If you do not - * belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. - * - * @return TeamGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TeamGetResponse teamGet() throws ApiException { - return teamGetWithHttpInfo().getData(); - } - - /** - * Get Team Returns information about your Team as well as a list of its members. If you do not - * belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. - * - * @return ApiResponse<TeamGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse teamGetWithHttpInfo() throws ApiException { - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "TeamApi.teamGet", - "/team", - "GET", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Get Team Info Provides information about a team. - * - * @param teamId The id of the team. (optional) - * @return TeamGetInfoResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TeamGetInfoResponse teamInfo(String teamId) throws ApiException { - return teamInfoWithHttpInfo(teamId).getData(); - } - - /** - * @see TeamApi#teamInfo(String) - */ - public TeamGetInfoResponse teamInfo() throws ApiException { - String teamId = null; - - return teamInfoWithHttpInfo(teamId).getData(); - } - - /** - * @see TeamApi#teamInfoWithHttpInfo(String) - */ - public ApiResponse teamInfoWithHttpInfo() throws ApiException { - String teamId = null; - - return teamInfoWithHttpInfo(teamId); - } - - /** - * Get Team Info Provides information about a team. - * - * @param teamId The id of the team. (optional) - * @return ApiResponse<TeamGetInfoResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse teamInfoWithHttpInfo(String teamId) - throws ApiException { - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "team_id", teamId)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TeamApi.teamInfo", - "/team/info", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * List Team Invites Provides a list of team invites (and their roles). - * - * @param emailAddress The email address for which to display the team invites. (optional) - * @return TeamInvitesResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TeamInvitesResponse teamInvites(String emailAddress) throws ApiException { - return teamInvitesWithHttpInfo(emailAddress).getData(); - } - - /** - * @see TeamApi#teamInvites(String) - */ - public TeamInvitesResponse teamInvites() throws ApiException { - String emailAddress = null; - - return teamInvitesWithHttpInfo(emailAddress).getData(); - } - - /** - * @see TeamApi#teamInvitesWithHttpInfo(String) - */ - public ApiResponse teamInvitesWithHttpInfo() throws ApiException { - String emailAddress = null; - - return teamInvitesWithHttpInfo(emailAddress); - } - - /** - * List Team Invites Provides a list of team invites (and their roles). - * - * @param emailAddress The email address for which to display the team invites. (optional) - * @return ApiResponse<TeamInvitesResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse teamInvitesWithHttpInfo(String emailAddress) - throws ApiException { - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "email_address", emailAddress)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TeamApi.teamInvites", - "/team/invites", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * List Team Members Provides a paginated list of members (and their roles) that belong to a - * given team. - * - * @param teamId The id of the team that a member list is being requested from. (required) - * @param page Which page number of the team member list to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @return TeamMembersResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TeamMembersResponse teamMembers(String teamId, Integer page, Integer pageSize) - throws ApiException { - return teamMembersWithHttpInfo(teamId, page, pageSize).getData(); - } - - /** - * @see TeamApi#teamMembers(String, Integer, Integer) - */ - public TeamMembersResponse teamMembers(String teamId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return teamMembersWithHttpInfo(teamId, page, pageSize).getData(); - } - - /** - * @see TeamApi#teamMembersWithHttpInfo(String, Integer, Integer) - */ - public ApiResponse teamMembersWithHttpInfo(String teamId) - throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return teamMembersWithHttpInfo(teamId, page, pageSize); - } - - /** - * @see TeamApi#teamMembers(String, Integer, Integer) - */ - public TeamMembersResponse teamMembers(String teamId, Integer page) throws ApiException { - Integer pageSize = 20; - - return teamMembersWithHttpInfo(teamId, page, pageSize).getData(); - } - - /** - * @see TeamApi#teamMembersWithHttpInfo(String, Integer, Integer) - */ - public ApiResponse teamMembersWithHttpInfo(String teamId, Integer page) - throws ApiException { - Integer pageSize = 20; - - return teamMembersWithHttpInfo(teamId, page, pageSize); - } - - /** - * List Team Members Provides a paginated list of members (and their roles) that belong to a - * given team. - * - * @param teamId The id of the team that a member list is being requested from. (required) - * @param page Which page number of the team member list to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @return ApiResponse<TeamMembersResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse teamMembersWithHttpInfo( - String teamId, Integer page, Integer pageSize) throws ApiException { - - if (page == null) { - page = 1; - } - if (pageSize == null) { - pageSize = 20; - } - // Check required parameters - if (teamId == null) { - throw new ApiException( - 400, "Missing the required parameter 'teamId' when calling teamMembers"); - } - - // Path parameters - String localVarPath = - "/team/members/{team_id}" - .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TeamApi.teamMembers", - localVarPath, - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Remove User from Team Removes the provided user Account from your Team. If the Account had an - * outstanding invitation to your Team, the invitation will be expired. If you choose to - * transfer documents from the removed Account to an Account provided in the - * `new_owner_email_address` parameter (available only for Enterprise plans), the - * response status code will be 201, which indicates that your request has been queued but not - * fully executed. - * - * @param teamRemoveMemberRequest (required) - * @return TeamGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TeamGetResponse teamRemoveMember(TeamRemoveMemberRequest teamRemoveMemberRequest) - throws ApiException { - return teamRemoveMemberWithHttpInfo(teamRemoveMemberRequest).getData(); - } - - /** - * Remove User from Team Removes the provided user Account from your Team. If the Account had an - * outstanding invitation to your Team, the invitation will be expired. If you choose to - * transfer documents from the removed Account to an Account provided in the - * `new_owner_email_address` parameter (available only for Enterprise plans), the - * response status code will be 201, which indicates that your request has been queued but not - * fully executed. - * - * @param teamRemoveMemberRequest (required) - * @return ApiResponse<TeamGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse teamRemoveMemberWithHttpInfo( - TeamRemoveMemberRequest teamRemoveMemberRequest) throws ApiException { - - // Check required parameters - if (teamRemoveMemberRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'teamRemoveMemberRequest' when calling" - + " teamRemoveMember"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = teamRemoveMemberRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "TeamApi.teamRemoveMember", - "/team/remove_member", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : teamRemoveMemberRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * List Sub Teams Provides a paginated list of sub teams that belong to a given team. - * - * @param teamId The id of the parent Team. (required) - * @param page Which page number of the SubTeam List to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @return TeamSubTeamsResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TeamSubTeamsResponse teamSubTeams(String teamId, Integer page, Integer pageSize) - throws ApiException { - return teamSubTeamsWithHttpInfo(teamId, page, pageSize).getData(); - } - - /** - * @see TeamApi#teamSubTeams(String, Integer, Integer) - */ - public TeamSubTeamsResponse teamSubTeams(String teamId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return teamSubTeamsWithHttpInfo(teamId, page, pageSize).getData(); - } - - /** - * @see TeamApi#teamSubTeamsWithHttpInfo(String, Integer, Integer) - */ - public ApiResponse teamSubTeamsWithHttpInfo(String teamId) - throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return teamSubTeamsWithHttpInfo(teamId, page, pageSize); - } - - /** - * @see TeamApi#teamSubTeams(String, Integer, Integer) - */ - public TeamSubTeamsResponse teamSubTeams(String teamId, Integer page) throws ApiException { - Integer pageSize = 20; - - return teamSubTeamsWithHttpInfo(teamId, page, pageSize).getData(); - } - - /** - * @see TeamApi#teamSubTeamsWithHttpInfo(String, Integer, Integer) - */ - public ApiResponse teamSubTeamsWithHttpInfo(String teamId, Integer page) - throws ApiException { - Integer pageSize = 20; - - return teamSubTeamsWithHttpInfo(teamId, page, pageSize); - } - - /** - * List Sub Teams Provides a paginated list of sub teams that belong to a given team. - * - * @param teamId The id of the parent Team. (required) - * @param page Which page number of the SubTeam List to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @return ApiResponse<TeamSubTeamsResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse teamSubTeamsWithHttpInfo( - String teamId, Integer page, Integer pageSize) throws ApiException { - - if (page == null) { - page = 1; - } - if (pageSize == null) { - pageSize = 20; - } - // Check required parameters - if (teamId == null) { - throw new ApiException( - 400, "Missing the required parameter 'teamId' when calling teamSubTeams"); - } - - // Path parameters - String localVarPath = - "/team/sub_teams/{team_id}" - .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TeamApi.teamSubTeams", - localVarPath, - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Update Team Updates the name of your Team. - * - * @param teamUpdateRequest (required) - * @return TeamGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TeamGetResponse teamUpdate(TeamUpdateRequest teamUpdateRequest) throws ApiException { - return teamUpdateWithHttpInfo(teamUpdateRequest).getData(); - } - - /** - * Update Team Updates the name of your Team. - * - * @param teamUpdateRequest (required) - * @return ApiResponse<TeamGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse teamUpdateWithHttpInfo(TeamUpdateRequest teamUpdateRequest) - throws ApiException { - - // Check required parameters - if (teamUpdateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'teamUpdateRequest' when calling teamUpdate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = teamUpdateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "TeamApi.teamUpdate", - "/team", - "PUT", - new ArrayList<>(), - isFileTypeFound ? null : teamUpdateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } -} + private ApiClient apiClient; + + public TeamApi() { + this(Configuration.getDefaultApiClient()); + } + + public TeamApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add User to Team + * Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. + * @param teamAddMemberRequest (required) + * @param teamId The id of the team. (optional) + * @return TeamGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TeamGetResponse teamAddMember(TeamAddMemberRequest teamAddMemberRequest, String teamId) throws ApiException { + return teamAddMemberWithHttpInfo(teamAddMemberRequest, teamId).getData(); + } + + + /** + * @see TeamApi#teamAddMember(TeamAddMemberRequest, String) + */ + public TeamGetResponse teamAddMember(TeamAddMemberRequest teamAddMemberRequest) throws ApiException { + String teamId = null; + + return teamAddMemberWithHttpInfo(teamAddMemberRequest, teamId).getData(); + } + + /** + * @see TeamApi#teamAddMemberWithHttpInfo(TeamAddMemberRequest, String) + */ + public ApiResponse teamAddMemberWithHttpInfo(TeamAddMemberRequest teamAddMemberRequest) throws ApiException { + String teamId = null; + + return teamAddMemberWithHttpInfo(teamAddMemberRequest, teamId); + } + + + /** + * Add User to Team + * Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. + * @param teamAddMemberRequest (required) + * @param teamId The id of the team. (optional) + * @return ApiResponse<TeamGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse teamAddMemberWithHttpInfo(TeamAddMemberRequest teamAddMemberRequest, String teamId) throws ApiException { + + // Check required parameters + if (teamAddMemberRequest == null) { + throw new ApiException(400, "Missing the required parameter 'teamAddMemberRequest' when calling teamAddMember"); + } + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "team_id", teamId) + ); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = teamAddMemberRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamAddMember", + "/team/add_member", + "PUT", + localVarQueryParams, + isFileTypeFound ? null : teamAddMemberRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Create Team + * Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. + * @param teamCreateRequest (required) + * @return TeamGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TeamGetResponse teamCreate(TeamCreateRequest teamCreateRequest) throws ApiException { + return teamCreateWithHttpInfo(teamCreateRequest).getData(); + } + + + /** + * Create Team + * Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. + * @param teamCreateRequest (required) + * @return ApiResponse<TeamGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse teamCreateWithHttpInfo(TeamCreateRequest teamCreateRequest) throws ApiException { + + // Check required parameters + if (teamCreateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'teamCreateRequest' when calling teamCreate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = teamCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamCreate", + "/team/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : teamCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Delete Team + * Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void teamDelete() throws ApiException { + teamDeleteWithHttpInfo(); + } + + + /** + * Delete Team + * Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse teamDeleteWithHttpInfo() throws ApiException { + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + return apiClient.invokeAPI( + "TeamApi.teamDelete", + "/team/destroy", + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); + + } + /** + * Get Team + * Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. + * @return TeamGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TeamGetResponse teamGet() throws ApiException { + return teamGetWithHttpInfo().getData(); + } + + + /** + * Get Team + * Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. + * @return ApiResponse<TeamGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse teamGetWithHttpInfo() throws ApiException { + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamGet", + "/team", + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Get Team Info + * Provides information about a team. + * @param teamId The id of the team. (optional) + * @return TeamGetInfoResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TeamGetInfoResponse teamInfo(String teamId) throws ApiException { + return teamInfoWithHttpInfo(teamId).getData(); + } + + + /** + * @see TeamApi#teamInfo(String) + */ + public TeamGetInfoResponse teamInfo() throws ApiException { + String teamId = null; + + return teamInfoWithHttpInfo(teamId).getData(); + } + + /** + * @see TeamApi#teamInfoWithHttpInfo(String) + */ + public ApiResponse teamInfoWithHttpInfo() throws ApiException { + String teamId = null; + + return teamInfoWithHttpInfo(teamId); + } + + + /** + * Get Team Info + * Provides information about a team. + * @param teamId The id of the team. (optional) + * @return ApiResponse<TeamGetInfoResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse teamInfoWithHttpInfo(String teamId) throws ApiException { + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "team_id", teamId) + ); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamInfo", + "/team/info", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * List Team Invites + * Provides a list of team invites (and their roles). + * @param emailAddress The email address for which to display the team invites. (optional) + * @return TeamInvitesResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TeamInvitesResponse teamInvites(String emailAddress) throws ApiException { + return teamInvitesWithHttpInfo(emailAddress).getData(); + } + + + /** + * @see TeamApi#teamInvites(String) + */ + public TeamInvitesResponse teamInvites() throws ApiException { + String emailAddress = null; + + return teamInvitesWithHttpInfo(emailAddress).getData(); + } + + /** + * @see TeamApi#teamInvitesWithHttpInfo(String) + */ + public ApiResponse teamInvitesWithHttpInfo() throws ApiException { + String emailAddress = null; + + return teamInvitesWithHttpInfo(emailAddress); + } + + + /** + * List Team Invites + * Provides a list of team invites (and their roles). + * @param emailAddress The email address for which to display the team invites. (optional) + * @return ApiResponse<TeamInvitesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse teamInvitesWithHttpInfo(String emailAddress) throws ApiException { + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "email_address", emailAddress) + ); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamInvites", + "/team/invites", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * List Team Members + * Provides a paginated list of members (and their roles) that belong to a given team. + * @param teamId The id of the team that a member list is being requested from. (required) + * @param page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @return TeamMembersResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TeamMembersResponse teamMembers(String teamId, Integer page, Integer pageSize) throws ApiException { + return teamMembersWithHttpInfo(teamId, page, pageSize).getData(); + } + + + /** + * @see TeamApi#teamMembers(String, Integer, Integer) + */ + public TeamMembersResponse teamMembers(String teamId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return teamMembersWithHttpInfo(teamId, page, pageSize).getData(); + } + + /** + * @see TeamApi#teamMembersWithHttpInfo(String, Integer, Integer) + */ + public ApiResponse teamMembersWithHttpInfo(String teamId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return teamMembersWithHttpInfo(teamId, page, pageSize); + } + + /** + * @see TeamApi#teamMembers(String, Integer, Integer) + */ + public TeamMembersResponse teamMembers(String teamId, Integer page) throws ApiException { + Integer pageSize = 20; + + return teamMembersWithHttpInfo(teamId, page, pageSize).getData(); + } + + /** + * @see TeamApi#teamMembersWithHttpInfo(String, Integer, Integer) + */ + public ApiResponse teamMembersWithHttpInfo(String teamId, Integer page) throws ApiException { + Integer pageSize = 20; + + return teamMembersWithHttpInfo(teamId, page, pageSize); + } + + + /** + * List Team Members + * Provides a paginated list of members (and their roles) that belong to a given team. + * @param teamId The id of the team that a member list is being requested from. (required) + * @param page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @return ApiResponse<TeamMembersResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse teamMembersWithHttpInfo(String teamId, Integer page, Integer pageSize) throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // Check required parameters + if (teamId == null) { + throw new ApiException(400, "Missing the required parameter 'teamId' when calling teamMembers"); + } + + // Path parameters + String localVarPath = "/team/members/{team_id}" + .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamMembers", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Remove User from Team + * Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. + * @param teamRemoveMemberRequest (required) + * @return TeamGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TeamGetResponse teamRemoveMember(TeamRemoveMemberRequest teamRemoveMemberRequest) throws ApiException { + return teamRemoveMemberWithHttpInfo(teamRemoveMemberRequest).getData(); + } + + + /** + * Remove User from Team + * Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. + * @param teamRemoveMemberRequest (required) + * @return ApiResponse<TeamGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse teamRemoveMemberWithHttpInfo(TeamRemoveMemberRequest teamRemoveMemberRequest) throws ApiException { + + // Check required parameters + if (teamRemoveMemberRequest == null) { + throw new ApiException(400, "Missing the required parameter 'teamRemoveMemberRequest' when calling teamRemoveMember"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = teamRemoveMemberRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamRemoveMember", + "/team/remove_member", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : teamRemoveMemberRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * List Sub Teams + * Provides a paginated list of sub teams that belong to a given team. + * @param teamId The id of the parent Team. (required) + * @param page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @return TeamSubTeamsResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TeamSubTeamsResponse teamSubTeams(String teamId, Integer page, Integer pageSize) throws ApiException { + return teamSubTeamsWithHttpInfo(teamId, page, pageSize).getData(); + } + + + /** + * @see TeamApi#teamSubTeams(String, Integer, Integer) + */ + public TeamSubTeamsResponse teamSubTeams(String teamId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return teamSubTeamsWithHttpInfo(teamId, page, pageSize).getData(); + } + + /** + * @see TeamApi#teamSubTeamsWithHttpInfo(String, Integer, Integer) + */ + public ApiResponse teamSubTeamsWithHttpInfo(String teamId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return teamSubTeamsWithHttpInfo(teamId, page, pageSize); + } + + /** + * @see TeamApi#teamSubTeams(String, Integer, Integer) + */ + public TeamSubTeamsResponse teamSubTeams(String teamId, Integer page) throws ApiException { + Integer pageSize = 20; + + return teamSubTeamsWithHttpInfo(teamId, page, pageSize).getData(); + } + + /** + * @see TeamApi#teamSubTeamsWithHttpInfo(String, Integer, Integer) + */ + public ApiResponse teamSubTeamsWithHttpInfo(String teamId, Integer page) throws ApiException { + Integer pageSize = 20; + + return teamSubTeamsWithHttpInfo(teamId, page, pageSize); + } + + + /** + * List Sub Teams + * Provides a paginated list of sub teams that belong to a given team. + * @param teamId The id of the parent Team. (required) + * @param page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @return ApiResponse<TeamSubTeamsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse teamSubTeamsWithHttpInfo(String teamId, Integer page, Integer pageSize) throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // Check required parameters + if (teamId == null) { + throw new ApiException(400, "Missing the required parameter 'teamId' when calling teamSubTeams"); + } + + // Path parameters + String localVarPath = "/team/sub_teams/{team_id}" + .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamSubTeams", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Update Team + * Updates the name of your Team. + * @param teamUpdateRequest (required) + * @return TeamGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TeamGetResponse teamUpdate(TeamUpdateRequest teamUpdateRequest) throws ApiException { + return teamUpdateWithHttpInfo(teamUpdateRequest).getData(); + } + + + /** + * Update Team + * Updates the name of your Team. + * @param teamUpdateRequest (required) + * @return ApiResponse<TeamGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse teamUpdateWithHttpInfo(TeamUpdateRequest teamUpdateRequest) throws ApiException { + + // Check required parameters + if (teamUpdateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'teamUpdateRequest' when calling teamUpdate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = teamUpdateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamUpdate", + "/team", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : teamUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/TemplateApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/TemplateApi.java index 14eeae070..607a5a571 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/TemplateApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/TemplateApi.java @@ -1,10 +1,15 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; + +import javax.ws.rs.core.GenericType; + +import com.dropbox.sign.model.ErrorResponse; +import java.io.File; import com.dropbox.sign.model.FileResponse; import com.dropbox.sign.model.FileResponseDataUri; import com.dropbox.sign.model.TemplateAddUserRequest; @@ -12,1101 +17,1025 @@ import com.dropbox.sign.model.TemplateCreateEmbeddedDraftResponse; import com.dropbox.sign.model.TemplateCreateRequest; import com.dropbox.sign.model.TemplateCreateResponse; +import com.dropbox.sign.model.TemplateEditRequest; +import com.dropbox.sign.model.TemplateEditResponse; import com.dropbox.sign.model.TemplateGetResponse; import com.dropbox.sign.model.TemplateListResponse; import com.dropbox.sign.model.TemplateRemoveUserRequest; import com.dropbox.sign.model.TemplateUpdateFilesRequest; import com.dropbox.sign.model.TemplateUpdateFilesResponse; -import java.io.File; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class TemplateApi { - private ApiClient apiClient; - - public TemplateApi() { - this(Configuration.getDefaultApiClient()); - } - - public TemplateApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; - } - - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Add User to Template Gives the specified Account access to the specified Template. The - * specified Account must be a part of your Team. - * - * @param templateId The id of the Template to give the Account access to. (required) - * @param templateAddUserRequest (required) - * @return TemplateGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TemplateGetResponse templateAddUser( - String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException { - return templateAddUserWithHttpInfo(templateId, templateAddUserRequest).getData(); - } - - /** - * Add User to Template Gives the specified Account access to the specified Template. The - * specified Account must be a part of your Team. - * - * @param templateId The id of the Template to give the Account access to. (required) - * @param templateAddUserRequest (required) - * @return ApiResponse<TemplateGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse templateAddUserWithHttpInfo( - String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'templateId' when calling templateAddUser"); - } - if (templateAddUserRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'templateAddUserRequest' when calling" - + " templateAddUser"); - } - - // Path parameters - String localVarPath = - "/template/add_user/{template_id}" - .replaceAll( - "\\{template_id}", apiClient.escapeString(templateId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = templateAddUserRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateAddUser", - localVarPath, - "POST", - new ArrayList<>(), - isFileTypeFound ? null : templateAddUserRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Create Template Creates a template that can then be used. - * - * @param templateCreateRequest (required) - * @return TemplateCreateResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TemplateCreateResponse templateCreate(TemplateCreateRequest templateCreateRequest) - throws ApiException { - return templateCreateWithHttpInfo(templateCreateRequest).getData(); - } - - /** - * Create Template Creates a template that can then be used. - * - * @param templateCreateRequest (required) - * @return ApiResponse<TemplateCreateResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse templateCreateWithHttpInfo( - TemplateCreateRequest templateCreateRequest) throws ApiException { - - // Check required parameters - if (templateCreateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'templateCreateRequest' when calling" - + " templateCreate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = templateCreateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateCreate", - "/template/create", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : templateCreateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Create Embedded Template Draft The first step in an embedded template workflow. Creates a - * draft template that can then be further set up in the template 'edit' stage. - * - * @param templateCreateEmbeddedDraftRequest (required) - * @return TemplateCreateEmbeddedDraftResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TemplateCreateEmbeddedDraftResponse templateCreateEmbeddedDraft( - TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) - throws ApiException { - return templateCreateEmbeddedDraftWithHttpInfo(templateCreateEmbeddedDraftRequest) - .getData(); - } - - /** - * Create Embedded Template Draft The first step in an embedded template workflow. Creates a - * draft template that can then be further set up in the template 'edit' stage. - * - * @param templateCreateEmbeddedDraftRequest (required) - * @return ApiResponse<TemplateCreateEmbeddedDraftResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse templateCreateEmbeddedDraftWithHttpInfo( - TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) - throws ApiException { - - // Check required parameters - if (templateCreateEmbeddedDraftRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'templateCreateEmbeddedDraftRequest' when" - + " calling templateCreateEmbeddedDraft"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = templateCreateEmbeddedDraftRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateCreateEmbeddedDraft", - "/template/create_embedded_draft", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : templateCreateEmbeddedDraftRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Delete Template Completely deletes the template specified from the account. - * - * @param templateId The id of the Template to delete. (required) - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public void templateDelete(String templateId) throws ApiException { - templateDeleteWithHttpInfo(templateId); - } - - /** - * Delete Template Completely deletes the template specified from the account. - * - * @param templateId The id of the Template to delete. (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse templateDeleteWithHttpInfo(String templateId) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException( - 400, "Missing the required parameter 'templateId' when calling templateDelete"); - } - - // Path parameters - String localVarPath = - "/template/delete/{template_id}" - .replaceAll( - "\\{template_id}", apiClient.escapeString(templateId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - return apiClient.invokeAPI( - "TemplateApi.templateDelete", - localVarPath, - "POST", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - null, - false); - } - - /** - * Get Template Files Obtain a copy of the current documents specified by the - * `template_id` parameter. Returns a PDF or ZIP file. If the files are currently - * being prepared, a status code of `409` will be returned instead. In this case - * please wait for the `template_created` callback event. - * - * @param templateId The id of the template files to retrieve. (required) - * @param fileType Set to `pdf` for a single merged document or `zip` for a - * collection of individual documents. (optional) - * @return File - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public File templateFiles(String templateId, String fileType) throws ApiException { - return templateFilesWithHttpInfo(templateId, fileType).getData(); + private ApiClient apiClient; + + public TemplateApi() { + this(Configuration.getDefaultApiClient()); + } + + public TemplateApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add User to Template + * Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. + * @param templateId The id of the Template to give the Account access to. (required) + * @param templateAddUserRequest (required) + * @return TemplateGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TemplateGetResponse templateAddUser(String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException { + return templateAddUserWithHttpInfo(templateId, templateAddUserRequest).getData(); + } + + + /** + * Add User to Template + * Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. + * @param templateId The id of the Template to give the Account access to. (required) + * @param templateAddUserRequest (required) + * @return ApiResponse<TemplateGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateAddUserWithHttpInfo(String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateAddUser"); } - - /** - * @see TemplateApi#templateFiles(String, String) - */ - public File templateFiles(String templateId) throws ApiException { - String fileType = null; - - return templateFilesWithHttpInfo(templateId, fileType).getData(); - } - - /** - * @see TemplateApi#templateFilesWithHttpInfo(String, String) - */ - public ApiResponse templateFilesWithHttpInfo(String templateId) throws ApiException { - String fileType = null; - - return templateFilesWithHttpInfo(templateId, fileType); - } - - /** - * Get Template Files Obtain a copy of the current documents specified by the - * `template_id` parameter. Returns a PDF or ZIP file. If the files are currently - * being prepared, a status code of `409` will be returned instead. In this case - * please wait for the `template_created` callback event. - * - * @param templateId The id of the template files to retrieve. (required) - * @param fileType Set to `pdf` for a single merged document or `zip` for a - * collection of individual documents. (optional) - * @return ApiResponse<File> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse templateFilesWithHttpInfo(String templateId, String fileType) - throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException( - 400, "Missing the required parameter 'templateId' when calling templateFiles"); - } - - // Path parameters - String localVarPath = - "/template/files/{template_id}" - .replaceAll( - "\\{template_id}", apiClient.escapeString(templateId.toString())); - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "file_type", fileType)); - - String localVarAccept = - apiClient.selectHeaderAccept( - "application/pdf", "application/zip", "application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateFiles", - localVarPath, - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Get Template Files as Data Uri Obtain a copy of the current documents specified by the - * `template_id` parameter. Returns a JSON object with a `data_uri` - * representing the base64 encoded file (PDFs only). If the files are currently being prepared, - * a status code of `409` will be returned instead. In this case please wait for the - * `template_created` callback event. - * - * @param templateId The id of the template files to retrieve. (required) - * @return FileResponseDataUri - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FileResponseDataUri templateFilesAsDataUri(String templateId) throws ApiException { - return templateFilesAsDataUriWithHttpInfo(templateId).getData(); - } - - /** - * Get Template Files as Data Uri Obtain a copy of the current documents specified by the - * `template_id` parameter. Returns a JSON object with a `data_uri` - * representing the base64 encoded file (PDFs only). If the files are currently being prepared, - * a status code of `409` will be returned instead. In this case please wait for the - * `template_created` callback event. - * - * @param templateId The id of the template files to retrieve. (required) - * @return ApiResponse<FileResponseDataUri> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse templateFilesAsDataUriWithHttpInfo(String templateId) - throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'templateId' when calling" - + " templateFilesAsDataUri"); - } - - // Path parameters - String localVarPath = - "/template/files_as_data_uri/{template_id}" - .replaceAll( - "\\{template_id}", apiClient.escapeString(templateId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateFilesAsDataUri", - localVarPath, - "GET", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - - /** - * Get Template Files as File Url Obtain a copy of the current documents specified by the - * `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). - * If the files are currently being prepared, a status code of `409` will be returned - * instead. In this case please wait for the `template_created` callback event. - * - * @param templateId The id of the template files to retrieve. (required) - * @param forceDownload By default when opening the `file_url` a browser will download - * the PDF and save it locally. When set to `0` the PDF file will be displayed in - * the browser. (optional, default to 1) - * @return FileResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public FileResponse templateFilesAsFileUrl(String templateId, Integer forceDownload) - throws ApiException { - return templateFilesAsFileUrlWithHttpInfo(templateId, forceDownload).getData(); - } - - /** - * @see TemplateApi#templateFilesAsFileUrl(String, Integer) - */ - public FileResponse templateFilesAsFileUrl(String templateId) throws ApiException { - Integer forceDownload = 1; - - return templateFilesAsFileUrlWithHttpInfo(templateId, forceDownload).getData(); - } - - /** - * @see TemplateApi#templateFilesAsFileUrlWithHttpInfo(String, Integer) - */ - public ApiResponse templateFilesAsFileUrlWithHttpInfo(String templateId) - throws ApiException { - Integer forceDownload = 1; - - return templateFilesAsFileUrlWithHttpInfo(templateId, forceDownload); + if (templateAddUserRequest == null) { + throw new ApiException(400, "Missing the required parameter 'templateAddUserRequest' when calling templateAddUser"); } - /** - * Get Template Files as File Url Obtain a copy of the current documents specified by the - * `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). - * If the files are currently being prepared, a status code of `409` will be returned - * instead. In this case please wait for the `template_created` callback event. - * - * @param templateId The id of the template files to retrieve. (required) - * @param forceDownload By default when opening the `file_url` a browser will download - * the PDF and save it locally. When set to `0` the PDF file will be displayed in - * the browser. (optional, default to 1) - * @return ApiResponse<FileResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse templateFilesAsFileUrlWithHttpInfo( - String templateId, Integer forceDownload) throws ApiException { - - if (forceDownload == null) { - forceDownload = 1; - } - // Check required parameters - if (templateId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'templateId' when calling" - + " templateFilesAsFileUrl"); - } - - // Path parameters - String localVarPath = - "/template/files_as_file_url/{template_id}" - .replaceAll( - "\\{template_id}", apiClient.escapeString(templateId.toString())); - - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "force_download", forceDownload)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateFilesAsFileUrl", - localVarPath, - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + // Path parameters + String localVarPath = "/template/add_user/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = templateAddUserRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateAddUser", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateAddUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Create Template + * Creates a template that can then be used. + * @param templateCreateRequest (required) + * @return TemplateCreateResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TemplateCreateResponse templateCreate(TemplateCreateRequest templateCreateRequest) throws ApiException { + return templateCreateWithHttpInfo(templateCreateRequest).getData(); + } + + + /** + * Create Template + * Creates a template that can then be used. + * @param templateCreateRequest (required) + * @return ApiResponse<TemplateCreateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateCreateWithHttpInfo(TemplateCreateRequest templateCreateRequest) throws ApiException { + + // Check required parameters + if (templateCreateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'templateCreateRequest' when calling templateCreate"); } - /** - * Get Template Returns the Template specified by the `template_id` parameter. - * - * @param templateId The id of the Template to retrieve. (required) - * @return TemplateGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TemplateGetResponse templateGet(String templateId) throws ApiException { - return templateGetWithHttpInfo(templateId).getData(); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = templateCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateCreate", + "/template/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Create Embedded Template Draft + * The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage. + * @param templateCreateEmbeddedDraftRequest (required) + * @return TemplateCreateEmbeddedDraftResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TemplateCreateEmbeddedDraftResponse templateCreateEmbeddedDraft(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) throws ApiException { + return templateCreateEmbeddedDraftWithHttpInfo(templateCreateEmbeddedDraftRequest).getData(); + } + + + /** + * Create Embedded Template Draft + * The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage. + * @param templateCreateEmbeddedDraftRequest (required) + * @return ApiResponse<TemplateCreateEmbeddedDraftResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateCreateEmbeddedDraftWithHttpInfo(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) throws ApiException { + + // Check required parameters + if (templateCreateEmbeddedDraftRequest == null) { + throw new ApiException(400, "Missing the required parameter 'templateCreateEmbeddedDraftRequest' when calling templateCreateEmbeddedDraft"); } - /** - * Get Template Returns the Template specified by the `template_id` parameter. - * - * @param templateId The id of the Template to retrieve. (required) - * @return ApiResponse<TemplateGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse templateGetWithHttpInfo(String templateId) - throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException( - 400, "Missing the required parameter 'templateId' when calling templateGet"); - } - - // Path parameters - String localVarPath = - "/template/{template_id}" - .replaceAll( - "\\{template_id}", apiClient.escapeString(templateId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateGet", - localVarPath, - "GET", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = templateCreateEmbeddedDraftRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateCreateEmbeddedDraft", + "/template/create_embedded_draft", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateCreateEmbeddedDraftRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Delete Template + * Completely deletes the template specified from the account. + * @param templateId The id of the Template to delete. (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void templateDelete(String templateId) throws ApiException { + templateDeleteWithHttpInfo(templateId); + } + + + /** + * Delete Template + * Completely deletes the template specified from the account. + * @param templateId The id of the Template to delete. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateDeleteWithHttpInfo(String templateId) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateDelete"); } - /** - * List Templates Returns a list of the Templates that are accessible by you. Take a look at our - * [search guide](/api/reference/search/) to learn more about querying templates. - * - * @param accountId Which account to return Templates for. Must be a team member. Use - * `all` to indicate all team members. Defaults to your account. (optional) - * @param page Which page number of the Template List to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @param query String that includes search terms and/or fields to be used to filter the - * Template objects. (optional) - * @return TemplateListResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TemplateListResponse templateList( - String accountId, Integer page, Integer pageSize, String query) throws ApiException { - return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + // Path parameters + String localVarPath = "/template/delete/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + return apiClient.invokeAPI( + "TemplateApi.templateDelete", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); + + } + /** + * _t__TemplateEdit::SUMMARY + * _t__TemplateEdit::DESCRIPTION + * @param templateId _t__TemplateEdit::TEMPLATE_ID (required) + * @param templateEditRequest (required) + * @return TemplateEditResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TemplateEditResponse templateEdit(String templateId, TemplateEditRequest templateEditRequest) throws ApiException { + return templateEditWithHttpInfo(templateId, templateEditRequest).getData(); + } + + + /** + * _t__TemplateEdit::SUMMARY + * _t__TemplateEdit::DESCRIPTION + * @param templateId _t__TemplateEdit::TEMPLATE_ID (required) + * @param templateEditRequest (required) + * @return ApiResponse<TemplateEditResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateEditWithHttpInfo(String templateId, TemplateEditRequest templateEditRequest) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateEdit"); } - - /** - * @see TemplateApi#templateList(String, Integer, Integer, String) - */ - public TemplateListResponse templateList() throws ApiException { - String accountId = null; - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + if (templateEditRequest == null) { + throw new ApiException(400, "Missing the required parameter 'templateEditRequest' when calling templateEdit"); } - /** - * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse templateListWithHttpInfo() throws ApiException { - String accountId = null; - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query); + // Path parameters + String localVarPath = "/template/edit/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = templateEditRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateEdit", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateEditRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Get Template Files + * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + * @param templateId The id of the template files to retrieve. (required) + * @param fileType Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @return File + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public File templateFiles(String templateId, String fileType) throws ApiException { + return templateFilesWithHttpInfo(templateId, fileType).getData(); + } + + + /** + * @see TemplateApi#templateFiles(String, String) + */ + public File templateFiles(String templateId) throws ApiException { + String fileType = null; + + return templateFilesWithHttpInfo(templateId, fileType).getData(); + } + + /** + * @see TemplateApi#templateFilesWithHttpInfo(String, String) + */ + public ApiResponse templateFilesWithHttpInfo(String templateId) throws ApiException { + String fileType = null; + + return templateFilesWithHttpInfo(templateId, fileType); + } + + + /** + * Get Template Files + * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + * @param templateId The id of the template files to retrieve. (required) + * @param fileType Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateFilesWithHttpInfo(String templateId, String fileType) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFiles"); } - /** - * @see TemplateApi#templateList(String, Integer, Integer, String) - */ - public TemplateListResponse templateList(String accountId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + // Path parameters + String localVarPath = "/template/files/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "file_type", fileType) + ); + + String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "application/zip", "application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateFiles", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Get Template Files as Data Uri + * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + * @param templateId The id of the template files to retrieve. (required) + * @return FileResponseDataUri + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FileResponseDataUri templateFilesAsDataUri(String templateId) throws ApiException { + return templateFilesAsDataUriWithHttpInfo(templateId).getData(); + } + + + /** + * Get Template Files as Data Uri + * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + * @param templateId The id of the template files to retrieve. (required) + * @return ApiResponse<FileResponseDataUri> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateFilesAsDataUriWithHttpInfo(String templateId) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFilesAsDataUri"); } - /** - * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse templateListWithHttpInfo(String accountId) - throws ApiException { - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query); + // Path parameters + String localVarPath = "/template/files_as_data_uri/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateFilesAsDataUri", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Get Template Files as File Url + * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + * @param templateId The id of the template files to retrieve. (required) + * @param forceDownload By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @return FileResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public FileResponse templateFilesAsFileUrl(String templateId, Integer forceDownload) throws ApiException { + return templateFilesAsFileUrlWithHttpInfo(templateId, forceDownload).getData(); + } + + + /** + * @see TemplateApi#templateFilesAsFileUrl(String, Integer) + */ + public FileResponse templateFilesAsFileUrl(String templateId) throws ApiException { + Integer forceDownload = 1; + + return templateFilesAsFileUrlWithHttpInfo(templateId, forceDownload).getData(); + } + + /** + * @see TemplateApi#templateFilesAsFileUrlWithHttpInfo(String, Integer) + */ + public ApiResponse templateFilesAsFileUrlWithHttpInfo(String templateId) throws ApiException { + Integer forceDownload = 1; + + return templateFilesAsFileUrlWithHttpInfo(templateId, forceDownload); + } + + + /** + * Get Template Files as File Url + * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + * @param templateId The id of the template files to retrieve. (required) + * @param forceDownload By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @return ApiResponse<FileResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateFilesAsFileUrlWithHttpInfo(String templateId, Integer forceDownload) throws ApiException { + + if (forceDownload == null) { + forceDownload = 1; } - - /** - * @see TemplateApi#templateList(String, Integer, Integer, String) - */ - public TemplateListResponse templateList(String accountId, Integer page) throws ApiException { - Integer pageSize = 20; - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + // Check required parameters + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFilesAsFileUrl"); } - /** - * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse templateListWithHttpInfo( - String accountId, Integer page) throws ApiException { - Integer pageSize = 20; - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query); + // Path parameters + String localVarPath = "/template/files_as_file_url/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "force_download", forceDownload) + ); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateFilesAsFileUrl", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Get Template + * Returns the Template specified by the `template_id` parameter. + * @param templateId The id of the Template to retrieve. (required) + * @return TemplateGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TemplateGetResponse templateGet(String templateId) throws ApiException { + return templateGetWithHttpInfo(templateId).getData(); + } + + + /** + * Get Template + * Returns the Template specified by the `template_id` parameter. + * @param templateId The id of the Template to retrieve. (required) + * @return ApiResponse<TemplateGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateGetWithHttpInfo(String templateId) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateGet"); } - /** - * @see TemplateApi#templateList(String, Integer, Integer, String) - */ - public TemplateListResponse templateList(String accountId, Integer page, Integer pageSize) - throws ApiException { - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + // Path parameters + String localVarPath = "/template/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * List Templates + * Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. + * @param accountId Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @return TemplateListResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TemplateListResponse templateList(String accountId, Integer page, Integer pageSize, String query) throws ApiException { + return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + + /** + * @see TemplateApi#templateList(String, Integer, Integer, String) + */ + public TemplateListResponse templateList() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse templateListWithHttpInfo() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query); + } + + /** + * @see TemplateApi#templateList(String, Integer, Integer, String) + */ + public TemplateListResponse templateList(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse templateListWithHttpInfo(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query); + } + + /** + * @see TemplateApi#templateList(String, Integer, Integer, String) + */ + public TemplateListResponse templateList(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse templateListWithHttpInfo(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query); + } + + /** + * @see TemplateApi#templateList(String, Integer, Integer, String) + */ + public TemplateListResponse templateList(String accountId, Integer page, Integer pageSize) throws ApiException { + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse templateListWithHttpInfo(String accountId, Integer page, Integer pageSize) throws ApiException { + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query); + } + + + /** + * List Templates + * Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. + * @param accountId Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @return ApiResponse<TemplateListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateListWithHttpInfo(String accountId, Integer page, Integer pageSize, String query) throws ApiException { + + if (page == null) { + page = 1; } - - /** - * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse templateListWithHttpInfo( - String accountId, Integer page, Integer pageSize) throws ApiException { - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query); + if (pageSize == null) { + pageSize = 20; } - - /** - * List Templates Returns a list of the Templates that are accessible by you. Take a look at our - * [search guide](/api/reference/search/) to learn more about querying templates. - * - * @param accountId Which account to return Templates for. Must be a team member. Use - * `all` to indicate all team members. Defaults to your account. (optional) - * @param page Which page number of the Template List to return. Defaults to `1`. - * (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and - * `100`. Default is `20`. (optional, default to 20) - * @param query String that includes search terms and/or fields to be used to filter the - * Template objects. (optional) - * @return ApiResponse<TemplateListResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse templateListWithHttpInfo( - String accountId, Integer page, Integer pageSize, String query) throws ApiException { - - if (page == null) { - page = 1; - } - if (pageSize == null) { - pageSize = 20; - } - // Query parameters - List localVarQueryParams = - new ArrayList<>(apiClient.parameterToPairs("", "account_id", accountId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateList", - "/template/list", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateList", + "/template/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Remove User from Template + * Removes the specified Account's access to the specified Template. + * @param templateId The id of the Template to remove the Account's access to. (required) + * @param templateRemoveUserRequest (required) + * @return TemplateGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TemplateGetResponse templateRemoveUser(String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) throws ApiException { + return templateRemoveUserWithHttpInfo(templateId, templateRemoveUserRequest).getData(); + } + + + /** + * Remove User from Template + * Removes the specified Account's access to the specified Template. + * @param templateId The id of the Template to remove the Account's access to. (required) + * @param templateRemoveUserRequest (required) + * @return ApiResponse<TemplateGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateRemoveUserWithHttpInfo(String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateRemoveUser"); } - - /** - * Remove User from Template Removes the specified Account's access to the specified - * Template. - * - * @param templateId The id of the Template to remove the Account's access to. (required) - * @param templateRemoveUserRequest (required) - * @return TemplateGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TemplateGetResponse templateRemoveUser( - String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) - throws ApiException { - return templateRemoveUserWithHttpInfo(templateId, templateRemoveUserRequest).getData(); + if (templateRemoveUserRequest == null) { + throw new ApiException(400, "Missing the required parameter 'templateRemoveUserRequest' when calling templateRemoveUser"); } - /** - * Remove User from Template Removes the specified Account's access to the specified - * Template. - * - * @param templateId The id of the Template to remove the Account's access to. (required) - * @param templateRemoveUserRequest (required) - * @return ApiResponse<TemplateGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse templateRemoveUserWithHttpInfo( - String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) - throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'templateId' when calling templateRemoveUser"); - } - if (templateRemoveUserRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'templateRemoveUserRequest' when calling" - + " templateRemoveUser"); - } - - // Path parameters - String localVarPath = - "/template/remove_user/{template_id}" - .replaceAll( - "\\{template_id}", apiClient.escapeString(templateId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = templateRemoveUserRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateRemoveUser", - localVarPath, - "POST", - new ArrayList<>(), - isFileTypeFound ? null : templateRemoveUserRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); + // Path parameters + String localVarPath = "/template/remove_user/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = templateRemoveUserRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateRemoveUser", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateRemoveUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Update Template Files + * Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). + * @param templateId The ID of the template whose files to update. (required) + * @param templateUpdateFilesRequest (required) + * @return TemplateUpdateFilesResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TemplateUpdateFilesResponse templateUpdateFiles(String templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) throws ApiException { + return templateUpdateFilesWithHttpInfo(templateId, templateUpdateFilesRequest).getData(); + } + + + /** + * Update Template Files + * Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). + * @param templateId The ID of the template whose files to update. (required) + * @param templateUpdateFilesRequest (required) + * @return ApiResponse<TemplateUpdateFilesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateUpdateFilesWithHttpInfo(String templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateUpdateFiles"); } - - /** - * Update Template Files Overlays a new file with the overlay of an existing template. The new - * file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) - * being replaced. This will not overwrite or in any way affect the existing template. Both the - * existing template and new template will be available for use after executing this endpoint. - * Also note that this will decrement your template quota. Overlaying new files is asynchronous - * and a successful call to this endpoint will return 200 OK response if the request passes - * initial validation checks. It is recommended that a callback be implemented to listen for the - * callback event. A `template_created` event will be sent when the files are updated - * or a `template_error` event will be sent if there was a problem while updating the - * files. If a callback handler has been configured and the event has not been received within - * 60 minutes of making the call, check the status of the request in the API dashboard and retry - * the request if necessary. If the page orientation or page count is different from the - * original template document, we will notify you with a `template_error` [callback - * event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). - * - * @param templateId The ID of the template whose files to update. (required) - * @param templateUpdateFilesRequest (required) - * @return TemplateUpdateFilesResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TemplateUpdateFilesResponse templateUpdateFiles( - String templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) - throws ApiException { - return templateUpdateFilesWithHttpInfo(templateId, templateUpdateFilesRequest).getData(); + if (templateUpdateFilesRequest == null) { + throw new ApiException(400, "Missing the required parameter 'templateUpdateFilesRequest' when calling templateUpdateFiles"); } - /** - * Update Template Files Overlays a new file with the overlay of an existing template. The new - * file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) - * being replaced. This will not overwrite or in any way affect the existing template. Both the - * existing template and new template will be available for use after executing this endpoint. - * Also note that this will decrement your template quota. Overlaying new files is asynchronous - * and a successful call to this endpoint will return 200 OK response if the request passes - * initial validation checks. It is recommended that a callback be implemented to listen for the - * callback event. A `template_created` event will be sent when the files are updated - * or a `template_error` event will be sent if there was a problem while updating the - * files. If a callback handler has been configured and the event has not been received within - * 60 minutes of making the call, check the status of the request in the API dashboard and retry - * the request if necessary. If the page orientation or page count is different from the - * original template document, we will notify you with a `template_error` [callback - * event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). - * - * @param templateId The ID of the template whose files to update. (required) - * @param templateUpdateFilesRequest (required) - * @return ApiResponse<TemplateUpdateFilesResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse templateUpdateFilesWithHttpInfo( - String templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) - throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'templateId' when calling templateUpdateFiles"); - } - if (templateUpdateFilesRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'templateUpdateFilesRequest' when calling" - + " templateUpdateFiles"); - } - - // Path parameters - String localVarPath = - "/template/update_files/{template_id}" - .replaceAll( - "\\{template_id}", apiClient.escapeString(templateId.toString())); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = templateUpdateFilesRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateUpdateFiles", - localVarPath, - "POST", - new ArrayList<>(), - isFileTypeFound ? null : templateUpdateFilesRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } -} + // Path parameters + String localVarPath = "/template/update_files/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = templateUpdateFilesRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateUpdateFiles", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateUpdateFilesRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java index 61289c29f..4e2bb27d0 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java @@ -1,407 +1,319 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; +import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; +import com.dropbox.sign.Pair; + +import javax.ws.rs.core.GenericType; + +import com.dropbox.sign.model.ErrorResponse; import com.dropbox.sign.model.UnclaimedDraftCreateEmbeddedRequest; import com.dropbox.sign.model.UnclaimedDraftCreateEmbeddedWithTemplateRequest; import com.dropbox.sign.model.UnclaimedDraftCreateRequest; import com.dropbox.sign.model.UnclaimedDraftCreateResponse; import com.dropbox.sign.model.UnclaimedDraftEditAndResendRequest; + import java.util.ArrayList; +import java.util.HashMap; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class UnclaimedDraftApi { - private ApiClient apiClient; + private ApiClient apiClient; - public UnclaimedDraftApi() { - this(Configuration.getDefaultApiClient()); - } + public UnclaimedDraftApi() { + this(Configuration.getDefaultApiClient()); + } - public UnclaimedDraftApi(ApiClient apiClient) { - this.apiClient = apiClient; - } + public UnclaimedDraftApi(ApiClient apiClient) { + this.apiClient = apiClient; + } - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; - } + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create Unclaimed Draft + * Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the \"Sign and send\" or the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. + * @param unclaimedDraftCreateRequest (required) + * @return UnclaimedDraftCreateResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public UnclaimedDraftCreateResponse unclaimedDraftCreate(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) throws ApiException { + return unclaimedDraftCreateWithHttpInfo(unclaimedDraftCreateRequest).getData(); + } - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - /** - * Create Unclaimed Draft Creates a new Draft that can be claimed using the claim URL. The first - * authenticated user to access the URL will claim the Draft and will be shown either the - * \"Sign and send\" or the \"Request signature\" page with the Draft - * loaded. Subsequent access to the claim URL will result in a 404. - * - * @param unclaimedDraftCreateRequest (required) - * @return UnclaimedDraftCreateResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public UnclaimedDraftCreateResponse unclaimedDraftCreate( - UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) throws ApiException { - return unclaimedDraftCreateWithHttpInfo(unclaimedDraftCreateRequest).getData(); + /** + * Create Unclaimed Draft + * Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the \"Sign and send\" or the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. + * @param unclaimedDraftCreateRequest (required) + * @return ApiResponse<UnclaimedDraftCreateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse unclaimedDraftCreateWithHttpInfo(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) throws ApiException { + + // Check required parameters + if (unclaimedDraftCreateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateRequest' when calling unclaimedDraftCreate"); } - /** - * Create Unclaimed Draft Creates a new Draft that can be claimed using the claim URL. The first - * authenticated user to access the URL will claim the Draft and will be shown either the - * \"Sign and send\" or the \"Request signature\" page with the Draft - * loaded. Subsequent access to the claim URL will result in a 404. - * - * @param unclaimedDraftCreateRequest (required) - * @return ApiResponse<UnclaimedDraftCreateResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse unclaimedDraftCreateWithHttpInfo( - UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) throws ApiException { + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = unclaimedDraftCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftCreate", + "/unclaimed_draft/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - // Check required parameters - if (unclaimedDraftCreateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'unclaimedDraftCreateRequest' when calling" - + " unclaimedDraftCreate"); - } + } + /** + * Create Embedded Unclaimed Draft + * Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + * @param unclaimedDraftCreateEmbeddedRequest (required) + * @return UnclaimedDraftCreateResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public UnclaimedDraftCreateResponse unclaimedDraftCreateEmbedded(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) throws ApiException { + return unclaimedDraftCreateEmbeddedWithHttpInfo(unclaimedDraftCreateEmbeddedRequest).getData(); + } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = unclaimedDraftCreateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "UnclaimedDraftApi.unclaimedDraftCreate", - "/unclaimed_draft/create", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : unclaimedDraftCreateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - /** - * Create Embedded Unclaimed Draft Creates a new Draft that can be claimed and used in an - * embedded iFrame. The first authenticated user to access the URL will claim the Draft and will - * be shown the \"Request signature\" page with the Draft loaded. Subsequent access to - * the claim URL will result in a `404`. For this embedded endpoint the - * `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed - * drafts can only be accessed in embedded iFrames whereas normal drafts can be used and - * accessed on Dropbox Sign. - * - * @param unclaimedDraftCreateEmbeddedRequest (required) - * @return UnclaimedDraftCreateResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public UnclaimedDraftCreateResponse unclaimedDraftCreateEmbedded( - UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) - throws ApiException { - return unclaimedDraftCreateEmbeddedWithHttpInfo(unclaimedDraftCreateEmbeddedRequest) - .getData(); + /** + * Create Embedded Unclaimed Draft + * Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + * @param unclaimedDraftCreateEmbeddedRequest (required) + * @return ApiResponse<UnclaimedDraftCreateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse unclaimedDraftCreateEmbeddedWithHttpInfo(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) throws ApiException { + + // Check required parameters + if (unclaimedDraftCreateEmbeddedRequest == null) { + throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateEmbeddedRequest' when calling unclaimedDraftCreateEmbedded"); } - /** - * Create Embedded Unclaimed Draft Creates a new Draft that can be claimed and used in an - * embedded iFrame. The first authenticated user to access the URL will claim the Draft and will - * be shown the \"Request signature\" page with the Draft loaded. Subsequent access to - * the claim URL will result in a `404`. For this embedded endpoint the - * `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed - * drafts can only be accessed in embedded iFrames whereas normal drafts can be used and - * accessed on Dropbox Sign. - * - * @param unclaimedDraftCreateEmbeddedRequest (required) - * @return ApiResponse<UnclaimedDraftCreateResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse unclaimedDraftCreateEmbeddedWithHttpInfo( - UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) - throws ApiException { + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = unclaimedDraftCreateEmbeddedRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftCreateEmbedded", + "/unclaimed_draft/create_embedded", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftCreateEmbeddedRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - // Check required parameters - if (unclaimedDraftCreateEmbeddedRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'unclaimedDraftCreateEmbeddedRequest' when" - + " calling unclaimedDraftCreateEmbedded"); - } + } + /** + * Create Embedded Unclaimed Draft with Template + * Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + * @param unclaimedDraftCreateEmbeddedWithTemplateRequest (required) + * @return UnclaimedDraftCreateResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public UnclaimedDraftCreateResponse unclaimedDraftCreateEmbeddedWithTemplate(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest) throws ApiException { + return unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(unclaimedDraftCreateEmbeddedWithTemplateRequest).getData(); + } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = unclaimedDraftCreateEmbeddedRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "UnclaimedDraftApi.unclaimedDraftCreateEmbedded", - "/unclaimed_draft/create_embedded", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : unclaimedDraftCreateEmbeddedRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - /** - * Create Embedded Unclaimed Draft with Template Creates a new Draft with a previously saved - * template(s) that can be claimed and used in an embedded iFrame. The first authenticated user - * to access the URL will claim the Draft and will be shown the \"Request signature\" - * page with the Draft loaded. Subsequent access to the claim URL will result in a - * `404`. For this embedded endpoint the `requester_email_address` parameter - * is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames - * whereas normal drafts can be used and accessed on Dropbox Sign. - * - * @param unclaimedDraftCreateEmbeddedWithTemplateRequest (required) - * @return UnclaimedDraftCreateResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public UnclaimedDraftCreateResponse unclaimedDraftCreateEmbeddedWithTemplate( - UnclaimedDraftCreateEmbeddedWithTemplateRequest - unclaimedDraftCreateEmbeddedWithTemplateRequest) - throws ApiException { - return unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo( - unclaimedDraftCreateEmbeddedWithTemplateRequest) - .getData(); + /** + * Create Embedded Unclaimed Draft with Template + * Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + * @param unclaimedDraftCreateEmbeddedWithTemplateRequest (required) + * @return ApiResponse<UnclaimedDraftCreateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest) throws ApiException { + + // Check required parameters + if (unclaimedDraftCreateEmbeddedWithTemplateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateEmbeddedWithTemplateRequest' when calling unclaimedDraftCreateEmbeddedWithTemplate"); } - /** - * Create Embedded Unclaimed Draft with Template Creates a new Draft with a previously saved - * template(s) that can be claimed and used in an embedded iFrame. The first authenticated user - * to access the URL will claim the Draft and will be shown the \"Request signature\" - * page with the Draft loaded. Subsequent access to the claim URL will result in a - * `404`. For this embedded endpoint the `requester_email_address` parameter - * is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames - * whereas normal drafts can be used and accessed on Dropbox Sign. - * - * @param unclaimedDraftCreateEmbeddedWithTemplateRequest (required) - * @return ApiResponse<UnclaimedDraftCreateResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse - unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo( - UnclaimedDraftCreateEmbeddedWithTemplateRequest - unclaimedDraftCreateEmbeddedWithTemplateRequest) - throws ApiException { + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = unclaimedDraftCreateEmbeddedWithTemplateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftCreateEmbeddedWithTemplate", + "/unclaimed_draft/create_embedded_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftCreateEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - // Check required parameters - if (unclaimedDraftCreateEmbeddedWithTemplateRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter" - + " 'unclaimedDraftCreateEmbeddedWithTemplateRequest' when calling" - + " unclaimedDraftCreateEmbeddedWithTemplate"); - } + } + /** + * Edit and Resend Unclaimed Draft + * Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + * @param signatureRequestId The ID of the signature request to edit and resend. (required) + * @param unclaimedDraftEditAndResendRequest (required) + * @return UnclaimedDraftCreateResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public UnclaimedDraftCreateResponse unclaimedDraftEditAndResend(String signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) throws ApiException { + return unclaimedDraftEditAndResendWithHttpInfo(signatureRequestId, unclaimedDraftEditAndResendRequest).getData(); + } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = unclaimedDraftCreateEmbeddedWithTemplateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType( - "application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "UnclaimedDraftApi.unclaimedDraftCreateEmbeddedWithTemplate", - "/unclaimed_draft/create_embedded_with_template", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : unclaimedDraftCreateEmbeddedWithTemplateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } - /** - * Edit and Resend Unclaimed Draft Creates a new signature request from an embedded request that - * can be edited prior to being sent to the recipients. Parameter `test_mode` can be - * edited prior to request. Signers can be edited in embedded editor. Requester's email - * address will remain unchanged if `requester_email_address` parameter is not set. - * **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal - * drafts can be used and accessed on Dropbox Sign. - * - * @param signatureRequestId The ID of the signature request to edit and resend. (required) - * @param unclaimedDraftEditAndResendRequest (required) - * @return UnclaimedDraftCreateResponse - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public UnclaimedDraftCreateResponse unclaimedDraftEditAndResend( - String signatureRequestId, - UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) - throws ApiException { - return unclaimedDraftEditAndResendWithHttpInfo( - signatureRequestId, unclaimedDraftEditAndResendRequest) - .getData(); + /** + * Edit and Resend Unclaimed Draft + * Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + * @param signatureRequestId The ID of the signature request to edit and resend. (required) + * @param unclaimedDraftEditAndResendRequest (required) + * @return ApiResponse<UnclaimedDraftCreateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse unclaimedDraftEditAndResendWithHttpInfo(String signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling unclaimedDraftEditAndResend"); + } + if (unclaimedDraftEditAndResendRequest == null) { + throw new ApiException(400, "Missing the required parameter 'unclaimedDraftEditAndResendRequest' when calling unclaimedDraftEditAndResend"); } - /** - * Edit and Resend Unclaimed Draft Creates a new signature request from an embedded request that - * can be edited prior to being sent to the recipients. Parameter `test_mode` can be - * edited prior to request. Signers can be edited in embedded editor. Requester's email - * address will remain unchanged if `requester_email_address` parameter is not set. - * **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal - * drafts can be used and accessed on Dropbox Sign. - * - * @param signatureRequestId The ID of the signature request to edit and resend. (required) - * @param unclaimedDraftEditAndResendRequest (required) - * @return ApiResponse<UnclaimedDraftCreateResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse unclaimedDraftEditAndResendWithHttpInfo( - String signatureRequestId, - UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) - throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signatureRequestId' when calling" - + " unclaimedDraftEditAndResend"); - } - if (unclaimedDraftEditAndResendRequest == null) { - throw new ApiException( - 400, - "Missing the required parameter 'unclaimedDraftEditAndResendRequest' when" - + " calling unclaimedDraftEditAndResend"); - } + // Path parameters + String localVarPath = "/unclaimed_draft/edit_and_resend/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); - // Path parameters - String localVarPath = - "/unclaimed_draft/edit_and_resend/{signature_request_id}" - .replaceAll( - "\\{signature_request_id}", - apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = unclaimedDraftEditAndResendRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftEditAndResend", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftEditAndResendRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = unclaimedDraftEditAndResendRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = - isFileTypeFound - ? "multipart/form-data" - : apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = - new GenericType() {}; - return apiClient.invokeAPI( - "UnclaimedDraftApi.unclaimedDraftEditAndResend", - localVarPath, - "POST", - new ArrayList<>(), - isFileTypeFound ? null : unclaimedDraftEditAndResendRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false); - } -} + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java index 9f8742a3d..73cb13080 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java @@ -10,77 +10,70 @@ * Do not edit the class manually. */ + package com.dropbox.sign.auth; -import com.dropbox.sign.ApiException; import com.dropbox.sign.Pair; +import com.dropbox.sign.ApiException; + import java.net.URI; -import java.util.List; import java.util.Map; +import java.util.List; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; + private final String location; + private final String paramName; - private String apiKey; - private String apiKeyPrefix; + private String apiKey; + private String apiKeyPrefix; - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } - public String getLocation() { - return location; - } + public String getLocation() { + return location; + } - public String getParamName() { - return paramName; - } + public String getParamName() { + return paramName; + } - public String getApiKey() { - return apiKey; - } + public String getApiKey() { + return apiKey; + } - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } - public String getApiKeyPrefix() { - return apiKeyPrefix; - } + public String getApiKeyPrefix() { + return apiKeyPrefix; + } - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = 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); - } + @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/sdks/java-v1/src/main/java/com/dropbox/sign/auth/Authentication.java b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/Authentication.java index 9d183342d..c5dc49d38 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/Authentication.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/Authentication.java @@ -10,13 +10,15 @@ * Do not edit the class manually. */ + package com.dropbox.sign.auth; -import com.dropbox.sign.ApiException; import com.dropbox.sign.Pair; +import com.dropbox.sign.ApiException; + import java.net.URI; -import java.util.List; import java.util.Map; +import java.util.List; public interface Authentication { /** @@ -26,12 +28,6 @@ public interface Authentication { * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters */ - void applyToParams( - List queryParams, - Map headerParams, - Map cookieParams, - String payload, - String method, - URI uri) - throws ApiException; + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; + } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java index 9fd1f753b..6f976099b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java @@ -10,55 +10,46 @@ * Do not edit the class manually. */ + package com.dropbox.sign.auth; -import com.dropbox.sign.ApiException; import com.dropbox.sign.Pair; -import java.net.URI; -import java.nio.charset.StandardCharsets; +import com.dropbox.sign.ApiException; + import java.util.Base64; -import java.util.List; +import java.nio.charset.StandardCharsets; + +import java.net.URI; import java.util.Map; +import java.util.List; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HttpBasicAuth implements Authentication { - private String username; - private String password; + private String username; + private String password; - public String getUsername() { - return username; - } + public String getUsername() { + return username; + } - public void setUsername(String username) { - this.username = username; - } + public void setUsername(String username) { + this.username = username; + } - public String getPassword() { - return password; - } + public String getPassword() { + return password; + } - public void setPassword(String password) { - this.password = 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; - } - String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.put( - "Authorization", - "Basic " - + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java index a77c13eda..18bfdae7d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java @@ -10,64 +10,53 @@ * Do not edit the class manually. */ + package com.dropbox.sign.auth; -import com.dropbox.sign.ApiException; import com.dropbox.sign.Pair; +import com.dropbox.sign.ApiException; + import java.net.URI; -import java.util.List; import java.util.Map; +import java.util.List; -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class HttpBearerAuth implements Authentication { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; + 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; } - /** - * 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); + } - headerParams.put( - "Authorization", - (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java index 4e340e3f1..b9d0399d1 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java @@ -10,17 +10,21 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Map; +import com.dropbox.sign.ApiException; import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; import javax.ws.rs.core.GenericType; -/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +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", comments = "Generator version: 7.12.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -50,22 +54,17 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * @return an instance of the actual schema/object */ @JsonValue - public Object getActualInstance() { - return instance; - } + 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; - } + 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 + * 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 */ @@ -77,7 +76,7 @@ private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { if (object.getActualInstance() == null) { return null; } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { - return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); } else { return object.getActualInstance(); } @@ -104,8 +103,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). + * 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) { @@ -122,9 +121,9 @@ public boolean equals(Object o) { 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); + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); } @Override @@ -144,4 +143,7 @@ public Boolean isNullable() { return Boolean.FALSE; } } + + + } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java index 9d881c79f..77b722648 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java @@ -10,307 +10,323 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** AccountCreateRequest */ + +import com.dropbox.sign.ApiException; +/** + * AccountCreateRequest + */ @JsonPropertyOrder({ - AccountCreateRequest.JSON_PROPERTY_EMAIL_ADDRESS, - AccountCreateRequest.JSON_PROPERTY_CLIENT_ID, - AccountCreateRequest.JSON_PROPERTY_CLIENT_SECRET, - AccountCreateRequest.JSON_PROPERTY_LOCALE + AccountCreateRequest.JSON_PROPERTY_EMAIL_ADDRESS, + AccountCreateRequest.JSON_PROPERTY_CLIENT_ID, + AccountCreateRequest.JSON_PROPERTY_CLIENT_SECRET, + AccountCreateRequest.JSON_PROPERTY_LOCALE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class AccountCreateRequest { - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nonnull private String emailAddress; - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nullable private String clientId; - - public static final String JSON_PROPERTY_CLIENT_SECRET = "client_secret"; - @javax.annotation.Nullable private String clientSecret; - - public static final String JSON_PROPERTY_LOCALE = "locale"; - @javax.annotation.Nullable private String locale; - - public AccountCreateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static AccountCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountCreateRequest.class); + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nonnull + private String emailAddress; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_CLIENT_SECRET = "client_secret"; + @javax.annotation.Nullable + private String clientSecret; + + public static final String JSON_PROPERTY_LOCALE = "locale"; + @javax.annotation.Nullable + private String locale; + + public AccountCreateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public AccountCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountCreateRequest.class); + } + + static public AccountCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + AccountCreateRequest.class + ); + } + + public AccountCreateRequest emailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The email address which will be associated with the new Account. + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + } + + + public AccountCreateRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) + * @return clientId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public AccountCreateRequest clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) + * @return clientSecret + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientSecret() { + return clientSecret; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public AccountCreateRequest locale(@javax.annotation.Nullable String locale) { + this.locale = locale; + return this; + } + + /** + * The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. + * @return locale + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLocale() { + return locale; + } + + + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocale(@javax.annotation.Nullable String locale) { + this.locale = locale; + } + + + /** + * Return true if this AccountCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public static AccountCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), AccountCreateRequest.class); - } - - public AccountCreateRequest emailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address which will be associated with the new Account. - * - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getEmailAddress() { - return emailAddress; - } - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; - } - - public AccountCreateRequest clientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Used when creating a new account with OAuth authorization. See [OAuth 2.0 - * Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) - * - * @return clientId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - } - - public AccountCreateRequest clientSecret(@javax.annotation.Nullable String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** - * Used when creating a new account with OAuth authorization. See [OAuth 2.0 - * Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) - * - * @return clientSecret - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientSecret() { - return clientSecret; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientSecret(@javax.annotation.Nullable String clientSecret) { - this.clientSecret = clientSecret; - } - - public AccountCreateRequest locale(@javax.annotation.Nullable String locale) { - this.locale = locale; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + AccountCreateRequest accountCreateRequest = (AccountCreateRequest) o; + return Objects.equals(this.emailAddress, accountCreateRequest.emailAddress) && + Objects.equals(this.clientId, accountCreateRequest.clientId) && + Objects.equals(this.clientSecret, accountCreateRequest.clientSecret) && + Objects.equals(this.locale, accountCreateRequest.locale); + } + + @Override + public int hashCode() { + return Objects.hash(emailAddress, clientId, clientSecret, locale); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountCreateRequest {\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - /** - * The locale used in this Account. Check out the list of [supported - * locales](/api/reference/constants/#supported-locales) to learn more about the possible - * values. - * - * @return locale - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LOCALE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLocale() { - return locale; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_LOCALE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLocale(@javax.annotation.Nullable String locale) { - this.locale = locale; + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } } + if (clientSecret != null) { + if (isFileTypeOrListOfFiles(clientSecret)) { + fileTypeFound = true; + } - /** Return true if this AccountCreateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (clientSecret.getClass().equals(java.io.File.class) || + clientSecret.getClass().equals(Integer.class) || + clientSecret.getClass().equals(String.class) || + clientSecret.getClass().isEnum()) { + map.put("client_secret", clientSecret); + } else if (isListOfFile(clientSecret)) { + for(int i = 0; i< getListSize(clientSecret); i++) { + map.put("client_secret[" + i + "]", getFromList(clientSecret, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("client_secret", JSON.getDefault().getMapper().writeValueAsString(clientSecret)); } - AccountCreateRequest accountCreateRequest = (AccountCreateRequest) o; - return Objects.equals(this.emailAddress, accountCreateRequest.emailAddress) - && Objects.equals(this.clientId, accountCreateRequest.clientId) - && Objects.equals(this.clientSecret, accountCreateRequest.clientSecret) - && Objects.equals(this.locale, accountCreateRequest.locale); } + if (locale != null) { + if (isFileTypeOrListOfFiles(locale)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(emailAddress, clientId, clientSecret, locale); + if (locale.getClass().equals(java.io.File.class) || + locale.getClass().equals(Integer.class) || + locale.getClass().equals(String.class) || + locale.getClass().isEnum()) { + map.put("locale", locale); + } else if (isListOfFile(locale)) { + for(int i = 0; i< getListSize(locale); i++) { + map.put("locale[" + i + "]", getFromList(locale, i)); + } + } + else { + map.put("locale", JSON.getDefault().getMapper().writeValueAsString(locale)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountCreateRequest {\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); - sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (clientSecret != null) { - if (isFileTypeOrListOfFiles(clientSecret)) { - fileTypeFound = true; - } - - if (clientSecret.getClass().equals(java.io.File.class) - || clientSecret.getClass().equals(Integer.class) - || clientSecret.getClass().equals(String.class) - || clientSecret.getClass().isEnum()) { - map.put("client_secret", clientSecret); - } else if (isListOfFile(clientSecret)) { - for (int i = 0; i < getListSize(clientSecret); i++) { - map.put("client_secret[" + i + "]", getFromList(clientSecret, i)); - } - } else { - map.put( - "client_secret", - JSON.getDefault().getMapper().writeValueAsString(clientSecret)); - } - } - if (locale != null) { - if (isFileTypeOrListOfFiles(locale)) { - fileTypeFound = true; - } - - if (locale.getClass().equals(java.io.File.class) - || locale.getClass().equals(Integer.class) - || locale.getClass().equals(String.class) - || locale.getClass().isEnum()) { - map.put("locale", locale); - } else if (isListOfFile(locale)) { - for (int i = 0; i < getListSize(locale); i++) { - map.put("locale[" + i + "]", getFromList(locale, i)); - } - } else { - map.put("locale", JSON.getDefault().getMapper().writeValueAsString(locale)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java index 328622b72..4dc6d09bb 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java @@ -10,266 +10,285 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.AccountResponse; +import com.dropbox.sign.model.OAuthTokenResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** AccountCreateResponse */ + +import com.dropbox.sign.ApiException; +/** + * AccountCreateResponse + */ @JsonPropertyOrder({ - AccountCreateResponse.JSON_PROPERTY_ACCOUNT, - AccountCreateResponse.JSON_PROPERTY_OAUTH_DATA, - AccountCreateResponse.JSON_PROPERTY_WARNINGS + AccountCreateResponse.JSON_PROPERTY_ACCOUNT, + AccountCreateResponse.JSON_PROPERTY_OAUTH_DATA, + AccountCreateResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class AccountCreateResponse { - public static final String JSON_PROPERTY_ACCOUNT = "account"; - @javax.annotation.Nonnull private AccountResponse account; - - public static final String JSON_PROPERTY_OAUTH_DATA = "oauth_data"; - @javax.annotation.Nullable private OAuthTokenResponse oauthData; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public AccountCreateResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static AccountCreateResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountCreateResponse.class); - } - - public static AccountCreateResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), AccountCreateResponse.class); - } - - public AccountCreateResponse account(@javax.annotation.Nonnull AccountResponse account) { - this.account = account; - return this; - } - - /** - * Get account - * - * @return account - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public AccountResponse getAccount() { - return account; + public static final String JSON_PROPERTY_ACCOUNT = "account"; + @javax.annotation.Nonnull + private AccountResponse account; + + public static final String JSON_PROPERTY_OAUTH_DATA = "oauth_data"; + @javax.annotation.Nullable + private OAuthTokenResponse oauthData; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public AccountCreateResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public AccountCreateResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountCreateResponse.class); + } + + static public AccountCreateResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + AccountCreateResponse.class + ); + } + + public AccountCreateResponse account(@javax.annotation.Nonnull AccountResponse account) { + this.account = account; + return this; + } + + /** + * Get account + * @return account + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AccountResponse getAccount() { + return account; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAccount(@javax.annotation.Nonnull AccountResponse account) { + this.account = account; + } + + + public AccountCreateResponse oauthData(@javax.annotation.Nullable OAuthTokenResponse oauthData) { + this.oauthData = oauthData; + return this; + } + + /** + * Get oauthData + * @return oauthData + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OAUTH_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OAuthTokenResponse getOauthData() { + return oauthData; + } + + + @JsonProperty(JSON_PROPERTY_OAUTH_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOauthData(@javax.annotation.Nullable OAuthTokenResponse oauthData) { + this.oauthData = oauthData; + } + + + public AccountCreateResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public AccountCreateResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } - - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setAccount(@javax.annotation.Nonnull AccountResponse account) { - this.account = account; + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this AccountCreateResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public AccountCreateResponse oauthData( - @javax.annotation.Nullable OAuthTokenResponse oauthData) { - this.oauthData = oauthData; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - /** - * Get oauthData - * - * @return oauthData - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OAUTH_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OAuthTokenResponse getOauthData() { - return oauthData; - } - - @JsonProperty(JSON_PROPERTY_OAUTH_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOauthData(@javax.annotation.Nullable OAuthTokenResponse oauthData) { - this.oauthData = oauthData; - } - - public AccountCreateResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public AccountCreateResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + AccountCreateResponse accountCreateResponse = (AccountCreateResponse) o; + return Objects.equals(this.account, accountCreateResponse.account) && + Objects.equals(this.oauthData, accountCreateResponse.oauthData) && + Objects.equals(this.warnings, accountCreateResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(account, oauthData, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountCreateResponse {\n"); + sb.append(" account: ").append(toIndentedString(account)).append("\n"); + sb.append(" oauthData: ").append(toIndentedString(oauthData)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (account != null) { + if (isFileTypeOrListOfFiles(account)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; + if (account.getClass().equals(java.io.File.class) || + account.getClass().equals(Integer.class) || + account.getClass().equals(String.class) || + account.getClass().isEnum()) { + map.put("account", account); + } else if (isListOfFile(account)) { + for(int i = 0; i< getListSize(account); i++) { + map.put("account[" + i + "]", getFromList(account, i)); + } + } + else { + map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); + } } + if (oauthData != null) { + if (isFileTypeOrListOfFiles(oauthData)) { + fileTypeFound = true; + } - /** Return true if this AccountCreateResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (oauthData.getClass().equals(java.io.File.class) || + oauthData.getClass().equals(Integer.class) || + oauthData.getClass().equals(String.class) || + oauthData.getClass().isEnum()) { + map.put("oauth_data", oauthData); + } else if (isListOfFile(oauthData)) { + for(int i = 0; i< getListSize(oauthData); i++) { + map.put("oauth_data[" + i + "]", getFromList(oauthData, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("oauth_data", JSON.getDefault().getMapper().writeValueAsString(oauthData)); } - AccountCreateResponse accountCreateResponse = (AccountCreateResponse) o; - return Objects.equals(this.account, accountCreateResponse.account) - && Objects.equals(this.oauthData, accountCreateResponse.oauthData) - && Objects.equals(this.warnings, accountCreateResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(account, oauthData, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountCreateResponse {\n"); - sb.append(" account: ").append(toIndentedString(account)).append("\n"); - sb.append(" oauthData: ").append(toIndentedString(oauthData)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (account != null) { - if (isFileTypeOrListOfFiles(account)) { - fileTypeFound = true; - } - - if (account.getClass().equals(java.io.File.class) - || account.getClass().equals(Integer.class) - || account.getClass().equals(String.class) - || account.getClass().isEnum()) { - map.put("account", account); - } else if (isListOfFile(account)) { - for (int i = 0; i < getListSize(account); i++) { - map.put("account[" + i + "]", getFromList(account, i)); - } - } else { - map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); - } - } - if (oauthData != null) { - if (isFileTypeOrListOfFiles(oauthData)) { - fileTypeFound = true; - } - - if (oauthData.getClass().equals(java.io.File.class) - || oauthData.getClass().equals(Integer.class) - || oauthData.getClass().equals(String.class) - || oauthData.getClass().isEnum()) { - map.put("oauth_data", oauthData); - } else if (isListOfFile(oauthData)) { - for (int i = 0; i < getListSize(oauthData); i++) { - map.put("oauth_data[" + i + "]", getFromList(oauthData, i)); - } - } else { - map.put( - "oauth_data", - JSON.getDefault().getMapper().writeValueAsString(oauthData)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountGetResponse.java index c63b7c4b9..2dbe8e562 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountGetResponse.java @@ -10,215 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.AccountResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** AccountGetResponse */ + +import com.dropbox.sign.ApiException; +/** + * AccountGetResponse + */ @JsonPropertyOrder({ - AccountGetResponse.JSON_PROPERTY_ACCOUNT, - AccountGetResponse.JSON_PROPERTY_WARNINGS + AccountGetResponse.JSON_PROPERTY_ACCOUNT, + AccountGetResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class AccountGetResponse { - public static final String JSON_PROPERTY_ACCOUNT = "account"; - @javax.annotation.Nonnull private AccountResponse account; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public AccountGetResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static AccountGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountGetResponse.class); - } - - public static AccountGetResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), AccountGetResponse.class); - } - - public AccountGetResponse account(@javax.annotation.Nonnull AccountResponse account) { - this.account = account; - return this; - } - - /** - * Get account - * - * @return account - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public AccountResponse getAccount() { - return account; - } - - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setAccount(@javax.annotation.Nonnull AccountResponse account) { - this.account = account; - } - - public AccountGetResponse warnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public AccountGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_ACCOUNT = "account"; + @javax.annotation.Nonnull + private AccountResponse account; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public AccountGetResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public AccountGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountGetResponse.class); + } + + static public AccountGetResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + AccountGetResponse.class + ); + } + + public AccountGetResponse account(@javax.annotation.Nonnull AccountResponse account) { + this.account = account; + return this; + } + + /** + * Get account + * @return account + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AccountResponse getAccount() { + return account; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAccount(@javax.annotation.Nonnull AccountResponse account) { + this.account = account; + } + + + public AccountGetResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public AccountGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this AccountGetResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountGetResponse accountGetResponse = (AccountGetResponse) o; + return Objects.equals(this.account, accountGetResponse.account) && + Objects.equals(this.warnings, accountGetResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(account, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountGetResponse {\n"); + sb.append(" account: ").append(toIndentedString(account)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (account != null) { + if (isFileTypeOrListOfFiles(account)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this AccountGetResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (account.getClass().equals(java.io.File.class) || + account.getClass().equals(Integer.class) || + account.getClass().equals(String.class) || + account.getClass().isEnum()) { + map.put("account", account); + } else if (isListOfFile(account)) { + for(int i = 0; i< getListSize(account); i++) { + map.put("account[" + i + "]", getFromList(account, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); } - AccountGetResponse accountGetResponse = (AccountGetResponse) o; - return Objects.equals(this.account, accountGetResponse.account) - && Objects.equals(this.warnings, accountGetResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(account, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountGetResponse {\n"); - sb.append(" account: ").append(toIndentedString(account)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (account != null) { - if (isFileTypeOrListOfFiles(account)) { - fileTypeFound = true; - } - - if (account.getClass().equals(java.io.File.class) - || account.getClass().equals(Integer.class) - || account.getClass().equals(String.class) - || account.getClass().isEnum()) { - map.put("account", account); - } else if (isListOfFile(account)) { - for (int i = 0; i < getListSize(account); i++) { - map.put("account[" + i + "]", getFromList(account, i)); - } - } else { - map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponse.java index 02ee9cf83..b5ba617d8 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponse.java @@ -10,645 +10,682 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.AccountResponseQuotas; +import com.dropbox.sign.model.AccountResponseUsage; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** AccountResponse */ + +import com.dropbox.sign.ApiException; +/** + * AccountResponse + */ @JsonPropertyOrder({ - AccountResponse.JSON_PROPERTY_ACCOUNT_ID, - AccountResponse.JSON_PROPERTY_EMAIL_ADDRESS, - AccountResponse.JSON_PROPERTY_IS_LOCKED, - AccountResponse.JSON_PROPERTY_IS_PAID_HS, - AccountResponse.JSON_PROPERTY_IS_PAID_HF, - AccountResponse.JSON_PROPERTY_QUOTAS, - AccountResponse.JSON_PROPERTY_CALLBACK_URL, - AccountResponse.JSON_PROPERTY_ROLE_CODE, - AccountResponse.JSON_PROPERTY_TEAM_ID, - AccountResponse.JSON_PROPERTY_LOCALE, - AccountResponse.JSON_PROPERTY_USAGE + AccountResponse.JSON_PROPERTY_ACCOUNT_ID, + AccountResponse.JSON_PROPERTY_EMAIL_ADDRESS, + AccountResponse.JSON_PROPERTY_IS_LOCKED, + AccountResponse.JSON_PROPERTY_IS_PAID_HS, + AccountResponse.JSON_PROPERTY_IS_PAID_HF, + AccountResponse.JSON_PROPERTY_QUOTAS, + AccountResponse.JSON_PROPERTY_CALLBACK_URL, + AccountResponse.JSON_PROPERTY_ROLE_CODE, + AccountResponse.JSON_PROPERTY_TEAM_ID, + AccountResponse.JSON_PROPERTY_LOCALE, + AccountResponse.JSON_PROPERTY_USAGE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class AccountResponse { - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - @javax.annotation.Nullable private String accountId; - - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; - - public static final String JSON_PROPERTY_IS_LOCKED = "is_locked"; - @javax.annotation.Nullable private Boolean isLocked; - - public static final String JSON_PROPERTY_IS_PAID_HS = "is_paid_hs"; - @javax.annotation.Nullable private Boolean isPaidHs; - - public static final String JSON_PROPERTY_IS_PAID_HF = "is_paid_hf"; - @javax.annotation.Nullable private Boolean isPaidHf; - - public static final String JSON_PROPERTY_QUOTAS = "quotas"; - @javax.annotation.Nullable private AccountResponseQuotas quotas; - - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - @javax.annotation.Nullable private String callbackUrl; - - public static final String JSON_PROPERTY_ROLE_CODE = "role_code"; - @javax.annotation.Nullable private String roleCode; - - public static final String JSON_PROPERTY_TEAM_ID = "team_id"; - @javax.annotation.Nullable private String teamId; - - public static final String JSON_PROPERTY_LOCALE = "locale"; - @javax.annotation.Nullable private String locale; - - public static final String JSON_PROPERTY_USAGE = "usage"; - @javax.annotation.Nullable private AccountResponseUsage usage; - - public AccountResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static AccountResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountResponse.class); - } - - public static AccountResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), AccountResponse.class); - } - - public AccountResponse accountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; - } - - /** - * The ID of the Account - * - * @return accountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccountId() { - return accountId; - } - - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - } - - public AccountResponse emailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address associated with the Account. - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; - } - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - } - - public AccountResponse isLocked(@javax.annotation.Nullable Boolean isLocked) { - this.isLocked = isLocked; - return this; - } - - /** - * Returns `true` if the user has been locked out of their account by a team admin. - * - * @return isLocked - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_LOCKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsLocked() { - return isLocked; - } - - @JsonProperty(JSON_PROPERTY_IS_LOCKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsLocked(@javax.annotation.Nullable Boolean isLocked) { - this.isLocked = isLocked; - } - - public AccountResponse isPaidHs(@javax.annotation.Nullable Boolean isPaidHs) { - this.isPaidHs = isPaidHs; - return this; - } - - /** - * Returns `true` if the user has a paid Dropbox Sign account. - * - * @return isPaidHs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_PAID_HS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsPaidHs() { - return isPaidHs; - } - - @JsonProperty(JSON_PROPERTY_IS_PAID_HS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsPaidHs(@javax.annotation.Nullable Boolean isPaidHs) { - this.isPaidHs = isPaidHs; - } - - public AccountResponse isPaidHf(@javax.annotation.Nullable Boolean isPaidHf) { - this.isPaidHf = isPaidHf; - return this; - } - - /** - * Returns `true` if the user has a paid HelloFax account. - * - * @return isPaidHf - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_PAID_HF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsPaidHf() { - return isPaidHf; - } - - @JsonProperty(JSON_PROPERTY_IS_PAID_HF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsPaidHf(@javax.annotation.Nullable Boolean isPaidHf) { - this.isPaidHf = isPaidHf; - } - - public AccountResponse quotas(@javax.annotation.Nullable AccountResponseQuotas quotas) { - this.quotas = quotas; - return this; - } - - /** - * Get quotas - * - * @return quotas - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUOTAS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AccountResponseQuotas getQuotas() { - return quotas; - } - - @JsonProperty(JSON_PROPERTY_QUOTAS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setQuotas(@javax.annotation.Nullable AccountResponseQuotas quotas) { - this.quotas = quotas; - } - - public AccountResponse callbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } - - /** - * The URL that Dropbox Sign events will `POST` to. - * - * @return callbackUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCallbackUrl() { - return callbackUrl; - } - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - public AccountResponse roleCode(@javax.annotation.Nullable String roleCode) { - this.roleCode = roleCode; - return this; - } - - /** - * The membership role for the team. - * - * @return roleCode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ROLE_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRoleCode() { - return roleCode; - } - - @JsonProperty(JSON_PROPERTY_ROLE_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRoleCode(@javax.annotation.Nullable String roleCode) { - this.roleCode = roleCode; - } + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + @javax.annotation.Nullable + private String accountId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; + + public static final String JSON_PROPERTY_IS_LOCKED = "is_locked"; + @javax.annotation.Nullable + private Boolean isLocked; + + public static final String JSON_PROPERTY_IS_PAID_HS = "is_paid_hs"; + @javax.annotation.Nullable + private Boolean isPaidHs; + + public static final String JSON_PROPERTY_IS_PAID_HF = "is_paid_hf"; + @javax.annotation.Nullable + private Boolean isPaidHf; + + public static final String JSON_PROPERTY_QUOTAS = "quotas"; + @javax.annotation.Nullable + private AccountResponseQuotas quotas; + + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + @javax.annotation.Nullable + private String callbackUrl; + + public static final String JSON_PROPERTY_ROLE_CODE = "role_code"; + @javax.annotation.Nullable + private String roleCode; + + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + @javax.annotation.Nullable + private String teamId; + + public static final String JSON_PROPERTY_LOCALE = "locale"; + @javax.annotation.Nullable + private String locale; + + public static final String JSON_PROPERTY_USAGE = "usage"; + @javax.annotation.Nullable + private AccountResponseUsage usage; + + public AccountResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public AccountResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountResponse.class); + } + + static public AccountResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + AccountResponse.class + ); + } + + public AccountResponse accountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The ID of the Account + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + } + + + public AccountResponse emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The email address associated with the Account. + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + public AccountResponse isLocked(@javax.annotation.Nullable Boolean isLocked) { + this.isLocked = isLocked; + return this; + } + + /** + * Returns `true` if the user has been locked out of their account by a team admin. + * @return isLocked + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_LOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsLocked() { + return isLocked; + } + + + @JsonProperty(JSON_PROPERTY_IS_LOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsLocked(@javax.annotation.Nullable Boolean isLocked) { + this.isLocked = isLocked; + } + + + public AccountResponse isPaidHs(@javax.annotation.Nullable Boolean isPaidHs) { + this.isPaidHs = isPaidHs; + return this; + } + + /** + * Returns `true` if the user has a paid Dropbox Sign account. + * @return isPaidHs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_PAID_HS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsPaidHs() { + return isPaidHs; + } + + + @JsonProperty(JSON_PROPERTY_IS_PAID_HS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaidHs(@javax.annotation.Nullable Boolean isPaidHs) { + this.isPaidHs = isPaidHs; + } + + + public AccountResponse isPaidHf(@javax.annotation.Nullable Boolean isPaidHf) { + this.isPaidHf = isPaidHf; + return this; + } + + /** + * Returns `true` if the user has a paid HelloFax account. + * @return isPaidHf + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_PAID_HF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsPaidHf() { + return isPaidHf; + } + + + @JsonProperty(JSON_PROPERTY_IS_PAID_HF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaidHf(@javax.annotation.Nullable Boolean isPaidHf) { + this.isPaidHf = isPaidHf; + } + + + public AccountResponse quotas(@javax.annotation.Nullable AccountResponseQuotas quotas) { + this.quotas = quotas; + return this; + } + + /** + * Get quotas + * @return quotas + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUOTAS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AccountResponseQuotas getQuotas() { + return quotas; + } + + + @JsonProperty(JSON_PROPERTY_QUOTAS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuotas(@javax.annotation.Nullable AccountResponseQuotas quotas) { + this.quotas = quotas; + } + + + public AccountResponse callbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; + } + + /** + * The URL that Dropbox Sign events will `POST` to. + * @return callbackUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCallbackUrl() { + return callbackUrl; + } + + + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + } + + + public AccountResponse roleCode(@javax.annotation.Nullable String roleCode) { + this.roleCode = roleCode; + return this; + } + + /** + * The membership role for the team. + * @return roleCode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRoleCode() { + return roleCode; + } + + + @JsonProperty(JSON_PROPERTY_ROLE_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRoleCode(@javax.annotation.Nullable String roleCode) { + this.roleCode = roleCode; + } + + + public AccountResponse teamId(@javax.annotation.Nullable String teamId) { + this.teamId = teamId; + return this; + } + + /** + * The id of the team account belongs to. + * @return teamId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTeamId() { + return teamId; + } + + + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTeamId(@javax.annotation.Nullable String teamId) { + this.teamId = teamId; + } + + + public AccountResponse locale(@javax.annotation.Nullable String locale) { + this.locale = locale; + return this; + } + + /** + * The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. + * @return locale + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLocale() { + return locale; + } + + + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocale(@javax.annotation.Nullable String locale) { + this.locale = locale; + } + + + public AccountResponse usage(@javax.annotation.Nullable AccountResponseUsage usage) { + this.usage = usage; + return this; + } + + /** + * Get usage + * @return usage + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AccountResponseUsage getUsage() { + return usage; + } + + + @JsonProperty(JSON_PROPERTY_USAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsage(@javax.annotation.Nullable AccountResponseUsage usage) { + this.usage = usage; + } + + + /** + * Return true if this AccountResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountResponse accountResponse = (AccountResponse) o; + return Objects.equals(this.accountId, accountResponse.accountId) && + Objects.equals(this.emailAddress, accountResponse.emailAddress) && + Objects.equals(this.isLocked, accountResponse.isLocked) && + Objects.equals(this.isPaidHs, accountResponse.isPaidHs) && + Objects.equals(this.isPaidHf, accountResponse.isPaidHf) && + Objects.equals(this.quotas, accountResponse.quotas) && + Objects.equals(this.callbackUrl, accountResponse.callbackUrl) && + Objects.equals(this.roleCode, accountResponse.roleCode) && + Objects.equals(this.teamId, accountResponse.teamId) && + Objects.equals(this.locale, accountResponse.locale) && + Objects.equals(this.usage, accountResponse.usage); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress, isLocked, isPaidHs, isPaidHf, quotas, callbackUrl, roleCode, teamId, locale, usage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountResponse {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" isLocked: ").append(toIndentedString(isLocked)).append("\n"); + sb.append(" isPaidHs: ").append(toIndentedString(isPaidHs)).append("\n"); + sb.append(" isPaidHf: ").append(toIndentedString(isPaidHf)).append("\n"); + sb.append(" quotas: ").append(toIndentedString(quotas)).append("\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" roleCode: ").append(toIndentedString(roleCode)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); + sb.append(" usage: ").append(toIndentedString(usage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } - public AccountResponse teamId(@javax.annotation.Nullable String teamId) { - this.teamId = teamId; - return this; + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - /** - * The id of the team account belongs to. - * - * @return teamId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTeamId() { - return teamId; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } + if (isLocked != null) { + if (isFileTypeOrListOfFiles(isLocked)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTeamId(@javax.annotation.Nullable String teamId) { - this.teamId = teamId; + if (isLocked.getClass().equals(java.io.File.class) || + isLocked.getClass().equals(Integer.class) || + isLocked.getClass().equals(String.class) || + isLocked.getClass().isEnum()) { + map.put("is_locked", isLocked); + } else if (isListOfFile(isLocked)) { + for(int i = 0; i< getListSize(isLocked); i++) { + map.put("is_locked[" + i + "]", getFromList(isLocked, i)); + } + } + else { + map.put("is_locked", JSON.getDefault().getMapper().writeValueAsString(isLocked)); + } } + if (isPaidHs != null) { + if (isFileTypeOrListOfFiles(isPaidHs)) { + fileTypeFound = true; + } - public AccountResponse locale(@javax.annotation.Nullable String locale) { - this.locale = locale; - return this; + if (isPaidHs.getClass().equals(java.io.File.class) || + isPaidHs.getClass().equals(Integer.class) || + isPaidHs.getClass().equals(String.class) || + isPaidHs.getClass().isEnum()) { + map.put("is_paid_hs", isPaidHs); + } else if (isListOfFile(isPaidHs)) { + for(int i = 0; i< getListSize(isPaidHs); i++) { + map.put("is_paid_hs[" + i + "]", getFromList(isPaidHs, i)); + } + } + else { + map.put("is_paid_hs", JSON.getDefault().getMapper().writeValueAsString(isPaidHs)); + } } + if (isPaidHf != null) { + if (isFileTypeOrListOfFiles(isPaidHf)) { + fileTypeFound = true; + } - /** - * The locale used in this Account. Check out the list of [supported - * locales](/api/reference/constants/#supported-locales) to learn more about the possible - * values. - * - * @return locale - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LOCALE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLocale() { - return locale; + if (isPaidHf.getClass().equals(java.io.File.class) || + isPaidHf.getClass().equals(Integer.class) || + isPaidHf.getClass().equals(String.class) || + isPaidHf.getClass().isEnum()) { + map.put("is_paid_hf", isPaidHf); + } else if (isListOfFile(isPaidHf)) { + for(int i = 0; i< getListSize(isPaidHf); i++) { + map.put("is_paid_hf[" + i + "]", getFromList(isPaidHf, i)); + } + } + else { + map.put("is_paid_hf", JSON.getDefault().getMapper().writeValueAsString(isPaidHf)); + } } + if (quotas != null) { + if (isFileTypeOrListOfFiles(quotas)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_LOCALE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLocale(@javax.annotation.Nullable String locale) { - this.locale = locale; + if (quotas.getClass().equals(java.io.File.class) || + quotas.getClass().equals(Integer.class) || + quotas.getClass().equals(String.class) || + quotas.getClass().isEnum()) { + map.put("quotas", quotas); + } else if (isListOfFile(quotas)) { + for(int i = 0; i< getListSize(quotas); i++) { + map.put("quotas[" + i + "]", getFromList(quotas, i)); + } + } + else { + map.put("quotas", JSON.getDefault().getMapper().writeValueAsString(quotas)); + } } + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; + } - public AccountResponse usage(@javax.annotation.Nullable AccountResponseUsage usage) { - this.usage = usage; - return this; + if (callbackUrl.getClass().equals(java.io.File.class) || + callbackUrl.getClass().equals(Integer.class) || + callbackUrl.getClass().equals(String.class) || + callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for(int i = 0; i< getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } + else { + map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } } + if (roleCode != null) { + if (isFileTypeOrListOfFiles(roleCode)) { + fileTypeFound = true; + } - /** - * Get usage - * - * @return usage - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AccountResponseUsage getUsage() { - return usage; + if (roleCode.getClass().equals(java.io.File.class) || + roleCode.getClass().equals(Integer.class) || + roleCode.getClass().equals(String.class) || + roleCode.getClass().isEnum()) { + map.put("role_code", roleCode); + } else if (isListOfFile(roleCode)) { + for(int i = 0; i< getListSize(roleCode); i++) { + map.put("role_code[" + i + "]", getFromList(roleCode, i)); + } + } + else { + map.put("role_code", JSON.getDefault().getMapper().writeValueAsString(roleCode)); + } } + if (teamId != null) { + if (isFileTypeOrListOfFiles(teamId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_USAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsage(@javax.annotation.Nullable AccountResponseUsage usage) { - this.usage = usage; + if (teamId.getClass().equals(java.io.File.class) || + teamId.getClass().equals(Integer.class) || + teamId.getClass().equals(String.class) || + teamId.getClass().isEnum()) { + map.put("team_id", teamId); + } else if (isListOfFile(teamId)) { + for(int i = 0; i< getListSize(teamId); i++) { + map.put("team_id[" + i + "]", getFromList(teamId, i)); + } + } + else { + map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); + } } + if (locale != null) { + if (isFileTypeOrListOfFiles(locale)) { + fileTypeFound = true; + } - /** Return true if this AccountResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AccountResponse accountResponse = (AccountResponse) o; - return Objects.equals(this.accountId, accountResponse.accountId) - && Objects.equals(this.emailAddress, accountResponse.emailAddress) - && Objects.equals(this.isLocked, accountResponse.isLocked) - && Objects.equals(this.isPaidHs, accountResponse.isPaidHs) - && Objects.equals(this.isPaidHf, accountResponse.isPaidHf) - && Objects.equals(this.quotas, accountResponse.quotas) - && Objects.equals(this.callbackUrl, accountResponse.callbackUrl) - && Objects.equals(this.roleCode, accountResponse.roleCode) - && Objects.equals(this.teamId, accountResponse.teamId) - && Objects.equals(this.locale, accountResponse.locale) - && Objects.equals(this.usage, accountResponse.usage); + if (locale.getClass().equals(java.io.File.class) || + locale.getClass().equals(Integer.class) || + locale.getClass().equals(String.class) || + locale.getClass().isEnum()) { + map.put("locale", locale); + } else if (isListOfFile(locale)) { + for(int i = 0; i< getListSize(locale); i++) { + map.put("locale[" + i + "]", getFromList(locale, i)); + } + } + else { + map.put("locale", JSON.getDefault().getMapper().writeValueAsString(locale)); + } } + if (usage != null) { + if (isFileTypeOrListOfFiles(usage)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - accountId, - emailAddress, - isLocked, - isPaidHs, - isPaidHf, - quotas, - callbackUrl, - roleCode, - teamId, - locale, - usage); + if (usage.getClass().equals(java.io.File.class) || + usage.getClass().equals(Integer.class) || + usage.getClass().equals(String.class) || + usage.getClass().isEnum()) { + map.put("usage", usage); + } else if (isListOfFile(usage)) { + for(int i = 0; i< getListSize(usage); i++) { + map.put("usage[" + i + "]", getFromList(usage, i)); + } + } + else { + map.put("usage", JSON.getDefault().getMapper().writeValueAsString(usage)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountResponse {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" isLocked: ").append(toIndentedString(isLocked)).append("\n"); - sb.append(" isPaidHs: ").append(toIndentedString(isPaidHs)).append("\n"); - sb.append(" isPaidHf: ").append(toIndentedString(isPaidHf)).append("\n"); - sb.append(" quotas: ").append(toIndentedString(quotas)).append("\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" roleCode: ").append(toIndentedString(roleCode)).append("\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); - sb.append(" usage: ").append(toIndentedString(usage)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } - - if (accountId.getClass().equals(java.io.File.class) - || accountId.getClass().equals(Integer.class) - || accountId.getClass().equals(String.class) - || accountId.getClass().isEnum()) { - map.put("account_id", accountId); - } else if (isListOfFile(accountId)) { - for (int i = 0; i < getListSize(accountId); i++) { - map.put("account_id[" + i + "]", getFromList(accountId, i)); - } - } else { - map.put( - "account_id", - JSON.getDefault().getMapper().writeValueAsString(accountId)); - } - } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - if (isLocked != null) { - if (isFileTypeOrListOfFiles(isLocked)) { - fileTypeFound = true; - } - - if (isLocked.getClass().equals(java.io.File.class) - || isLocked.getClass().equals(Integer.class) - || isLocked.getClass().equals(String.class) - || isLocked.getClass().isEnum()) { - map.put("is_locked", isLocked); - } else if (isListOfFile(isLocked)) { - for (int i = 0; i < getListSize(isLocked); i++) { - map.put("is_locked[" + i + "]", getFromList(isLocked, i)); - } - } else { - map.put( - "is_locked", - JSON.getDefault().getMapper().writeValueAsString(isLocked)); - } - } - if (isPaidHs != null) { - if (isFileTypeOrListOfFiles(isPaidHs)) { - fileTypeFound = true; - } - - if (isPaidHs.getClass().equals(java.io.File.class) - || isPaidHs.getClass().equals(Integer.class) - || isPaidHs.getClass().equals(String.class) - || isPaidHs.getClass().isEnum()) { - map.put("is_paid_hs", isPaidHs); - } else if (isListOfFile(isPaidHs)) { - for (int i = 0; i < getListSize(isPaidHs); i++) { - map.put("is_paid_hs[" + i + "]", getFromList(isPaidHs, i)); - } - } else { - map.put( - "is_paid_hs", - JSON.getDefault().getMapper().writeValueAsString(isPaidHs)); - } - } - if (isPaidHf != null) { - if (isFileTypeOrListOfFiles(isPaidHf)) { - fileTypeFound = true; - } - - if (isPaidHf.getClass().equals(java.io.File.class) - || isPaidHf.getClass().equals(Integer.class) - || isPaidHf.getClass().equals(String.class) - || isPaidHf.getClass().isEnum()) { - map.put("is_paid_hf", isPaidHf); - } else if (isListOfFile(isPaidHf)) { - for (int i = 0; i < getListSize(isPaidHf); i++) { - map.put("is_paid_hf[" + i + "]", getFromList(isPaidHf, i)); - } - } else { - map.put( - "is_paid_hf", - JSON.getDefault().getMapper().writeValueAsString(isPaidHf)); - } - } - if (quotas != null) { - if (isFileTypeOrListOfFiles(quotas)) { - fileTypeFound = true; - } - - if (quotas.getClass().equals(java.io.File.class) - || quotas.getClass().equals(Integer.class) - || quotas.getClass().equals(String.class) - || quotas.getClass().isEnum()) { - map.put("quotas", quotas); - } else if (isListOfFile(quotas)) { - for (int i = 0; i < getListSize(quotas); i++) { - map.put("quotas[" + i + "]", getFromList(quotas, i)); - } - } else { - map.put("quotas", JSON.getDefault().getMapper().writeValueAsString(quotas)); - } - } - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } - - if (callbackUrl.getClass().equals(java.io.File.class) - || callbackUrl.getClass().equals(Integer.class) - || callbackUrl.getClass().equals(String.class) - || callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for (int i = 0; i < getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } else { - map.put( - "callback_url", - JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); - } - } - if (roleCode != null) { - if (isFileTypeOrListOfFiles(roleCode)) { - fileTypeFound = true; - } - - if (roleCode.getClass().equals(java.io.File.class) - || roleCode.getClass().equals(Integer.class) - || roleCode.getClass().equals(String.class) - || roleCode.getClass().isEnum()) { - map.put("role_code", roleCode); - } else if (isListOfFile(roleCode)) { - for (int i = 0; i < getListSize(roleCode); i++) { - map.put("role_code[" + i + "]", getFromList(roleCode, i)); - } - } else { - map.put( - "role_code", - JSON.getDefault().getMapper().writeValueAsString(roleCode)); - } - } - if (teamId != null) { - if (isFileTypeOrListOfFiles(teamId)) { - fileTypeFound = true; - } - - if (teamId.getClass().equals(java.io.File.class) - || teamId.getClass().equals(Integer.class) - || teamId.getClass().equals(String.class) - || teamId.getClass().isEnum()) { - map.put("team_id", teamId); - } else if (isListOfFile(teamId)) { - for (int i = 0; i < getListSize(teamId); i++) { - map.put("team_id[" + i + "]", getFromList(teamId, i)); - } - } else { - map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); - } - } - if (locale != null) { - if (isFileTypeOrListOfFiles(locale)) { - fileTypeFound = true; - } - - if (locale.getClass().equals(java.io.File.class) - || locale.getClass().equals(Integer.class) - || locale.getClass().equals(String.class) - || locale.getClass().isEnum()) { - map.put("locale", locale); - } else if (isListOfFile(locale)) { - for (int i = 0; i < getListSize(locale); i++) { - map.put("locale[" + i + "]", getFromList(locale, i)); - } - } else { - map.put("locale", JSON.getDefault().getMapper().writeValueAsString(locale)); - } - } - if (usage != null) { - if (isFileTypeOrListOfFiles(usage)) { - fileTypeFound = true; - } - - if (usage.getClass().equals(java.io.File.class) - || usage.getClass().equals(Integer.class) - || usage.getClass().equals(String.class) - || usage.getClass().isEnum()) { - map.put("usage", usage); - } else if (isListOfFile(usage)) { - for (int i = 0; i < getListSize(usage); i++) { - map.put("usage[" + i + "]", getFromList(usage, i)); - } - } else { - map.put("usage", JSON.getDefault().getMapper().writeValueAsString(usage)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java index 9385b863c..38793ba5c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java @@ -10,425 +10,425 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** Details concerning remaining monthly quotas. */ + +import com.dropbox.sign.ApiException; +/** + * Details concerning remaining monthly quotas. + */ @JsonPropertyOrder({ - AccountResponseQuotas.JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT, - AccountResponseQuotas.JSON_PROPERTY_DOCUMENTS_LEFT, - AccountResponseQuotas.JSON_PROPERTY_TEMPLATES_TOTAL, - AccountResponseQuotas.JSON_PROPERTY_TEMPLATES_LEFT, - AccountResponseQuotas.JSON_PROPERTY_SMS_VERIFICATIONS_LEFT, - AccountResponseQuotas.JSON_PROPERTY_NUM_FAX_PAGES_LEFT + AccountResponseQuotas.JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT, + AccountResponseQuotas.JSON_PROPERTY_DOCUMENTS_LEFT, + AccountResponseQuotas.JSON_PROPERTY_TEMPLATES_TOTAL, + AccountResponseQuotas.JSON_PROPERTY_TEMPLATES_LEFT, + AccountResponseQuotas.JSON_PROPERTY_SMS_VERIFICATIONS_LEFT, + AccountResponseQuotas.JSON_PROPERTY_NUM_FAX_PAGES_LEFT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class AccountResponseQuotas { - public static final String JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT = - "api_signature_requests_left"; - @javax.annotation.Nullable private Integer apiSignatureRequestsLeft; - - public static final String JSON_PROPERTY_DOCUMENTS_LEFT = "documents_left"; - @javax.annotation.Nullable private Integer documentsLeft; - - public static final String JSON_PROPERTY_TEMPLATES_TOTAL = "templates_total"; - @javax.annotation.Nullable private Integer templatesTotal; - - public static final String JSON_PROPERTY_TEMPLATES_LEFT = "templates_left"; - @javax.annotation.Nullable private Integer templatesLeft; - - public static final String JSON_PROPERTY_SMS_VERIFICATIONS_LEFT = "sms_verifications_left"; - @javax.annotation.Nullable private Integer smsVerificationsLeft; - - public static final String JSON_PROPERTY_NUM_FAX_PAGES_LEFT = "num_fax_pages_left"; - @javax.annotation.Nullable private Integer numFaxPagesLeft; - - public AccountResponseQuotas() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static AccountResponseQuotas init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountResponseQuotas.class); + public static final String JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT = "api_signature_requests_left"; + @javax.annotation.Nullable + private Integer apiSignatureRequestsLeft; + + public static final String JSON_PROPERTY_DOCUMENTS_LEFT = "documents_left"; + @javax.annotation.Nullable + private Integer documentsLeft; + + public static final String JSON_PROPERTY_TEMPLATES_TOTAL = "templates_total"; + @javax.annotation.Nullable + private Integer templatesTotal; + + public static final String JSON_PROPERTY_TEMPLATES_LEFT = "templates_left"; + @javax.annotation.Nullable + private Integer templatesLeft; + + public static final String JSON_PROPERTY_SMS_VERIFICATIONS_LEFT = "sms_verifications_left"; + @javax.annotation.Nullable + private Integer smsVerificationsLeft; + + public static final String JSON_PROPERTY_NUM_FAX_PAGES_LEFT = "num_fax_pages_left"; + @javax.annotation.Nullable + private Integer numFaxPagesLeft; + + public AccountResponseQuotas() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public AccountResponseQuotas init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountResponseQuotas.class); + } + + static public AccountResponseQuotas init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + AccountResponseQuotas.class + ); + } + + public AccountResponseQuotas apiSignatureRequestsLeft(@javax.annotation.Nullable Integer apiSignatureRequestsLeft) { + this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; + return this; + } + + /** + * API signature requests remaining. + * @return apiSignatureRequestsLeft + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getApiSignatureRequestsLeft() { + return apiSignatureRequestsLeft; + } + + + @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiSignatureRequestsLeft(@javax.annotation.Nullable Integer apiSignatureRequestsLeft) { + this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; + } + + + public AccountResponseQuotas documentsLeft(@javax.annotation.Nullable Integer documentsLeft) { + this.documentsLeft = documentsLeft; + return this; + } + + /** + * Signature requests remaining. + * @return documentsLeft + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDocumentsLeft() { + return documentsLeft; + } + + + @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDocumentsLeft(@javax.annotation.Nullable Integer documentsLeft) { + this.documentsLeft = documentsLeft; + } + + + public AccountResponseQuotas templatesTotal(@javax.annotation.Nullable Integer templatesTotal) { + this.templatesTotal = templatesTotal; + return this; + } + + /** + * Total API templates allowed. + * @return templatesTotal + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATES_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getTemplatesTotal() { + return templatesTotal; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATES_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplatesTotal(@javax.annotation.Nullable Integer templatesTotal) { + this.templatesTotal = templatesTotal; + } + + + public AccountResponseQuotas templatesLeft(@javax.annotation.Nullable Integer templatesLeft) { + this.templatesLeft = templatesLeft; + return this; + } + + /** + * API templates remaining. + * @return templatesLeft + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getTemplatesLeft() { + return templatesLeft; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplatesLeft(@javax.annotation.Nullable Integer templatesLeft) { + this.templatesLeft = templatesLeft; + } + + + public AccountResponseQuotas smsVerificationsLeft(@javax.annotation.Nullable Integer smsVerificationsLeft) { + this.smsVerificationsLeft = smsVerificationsLeft; + return this; + } + + /** + * SMS verifications remaining. + * @return smsVerificationsLeft + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSmsVerificationsLeft() { + return smsVerificationsLeft; + } + + + @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsVerificationsLeft(@javax.annotation.Nullable Integer smsVerificationsLeft) { + this.smsVerificationsLeft = smsVerificationsLeft; + } + + + public AccountResponseQuotas numFaxPagesLeft(@javax.annotation.Nullable Integer numFaxPagesLeft) { + this.numFaxPagesLeft = numFaxPagesLeft; + return this; + } + + /** + * Number of fax pages left + * @return numFaxPagesLeft + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_FAX_PAGES_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getNumFaxPagesLeft() { + return numFaxPagesLeft; + } + + + @JsonProperty(JSON_PROPERTY_NUM_FAX_PAGES_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumFaxPagesLeft(@javax.annotation.Nullable Integer numFaxPagesLeft) { + this.numFaxPagesLeft = numFaxPagesLeft; + } + + + /** + * Return true if this AccountResponseQuotas object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public static AccountResponseQuotas init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), AccountResponseQuotas.class); - } - - public AccountResponseQuotas apiSignatureRequestsLeft( - @javax.annotation.Nullable Integer apiSignatureRequestsLeft) { - this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; - return this; - } - - /** - * API signature requests remaining. - * - * @return apiSignatureRequestsLeft - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getApiSignatureRequestsLeft() { - return apiSignatureRequestsLeft; - } - - @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiSignatureRequestsLeft( - @javax.annotation.Nullable Integer apiSignatureRequestsLeft) { - this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; - } - - public AccountResponseQuotas documentsLeft(@javax.annotation.Nullable Integer documentsLeft) { - this.documentsLeft = documentsLeft; - return this; - } - - /** - * Signature requests remaining. - * - * @return documentsLeft - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getDocumentsLeft() { - return documentsLeft; - } - - @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDocumentsLeft(@javax.annotation.Nullable Integer documentsLeft) { - this.documentsLeft = documentsLeft; - } - - public AccountResponseQuotas templatesTotal(@javax.annotation.Nullable Integer templatesTotal) { - this.templatesTotal = templatesTotal; - return this; - } - - /** - * Total API templates allowed. - * - * @return templatesTotal - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATES_TOTAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getTemplatesTotal() { - return templatesTotal; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATES_TOTAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplatesTotal(@javax.annotation.Nullable Integer templatesTotal) { - this.templatesTotal = templatesTotal; - } - - public AccountResponseQuotas templatesLeft(@javax.annotation.Nullable Integer templatesLeft) { - this.templatesLeft = templatesLeft; - return this; - } - - /** - * API templates remaining. - * - * @return templatesLeft - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getTemplatesLeft() { - return templatesLeft; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplatesLeft(@javax.annotation.Nullable Integer templatesLeft) { - this.templatesLeft = templatesLeft; - } - - public AccountResponseQuotas smsVerificationsLeft( - @javax.annotation.Nullable Integer smsVerificationsLeft) { - this.smsVerificationsLeft = smsVerificationsLeft; - return this; - } - - /** - * SMS verifications remaining. - * - * @return smsVerificationsLeft - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getSmsVerificationsLeft() { - return smsVerificationsLeft; + if (o == null || getClass() != o.getClass()) { + return false; } + AccountResponseQuotas accountResponseQuotas = (AccountResponseQuotas) o; + return Objects.equals(this.apiSignatureRequestsLeft, accountResponseQuotas.apiSignatureRequestsLeft) && + Objects.equals(this.documentsLeft, accountResponseQuotas.documentsLeft) && + Objects.equals(this.templatesTotal, accountResponseQuotas.templatesTotal) && + Objects.equals(this.templatesLeft, accountResponseQuotas.templatesLeft) && + Objects.equals(this.smsVerificationsLeft, accountResponseQuotas.smsVerificationsLeft) && + Objects.equals(this.numFaxPagesLeft, accountResponseQuotas.numFaxPagesLeft); + } + + @Override + public int hashCode() { + return Objects.hash(apiSignatureRequestsLeft, documentsLeft, templatesTotal, templatesLeft, smsVerificationsLeft, numFaxPagesLeft); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountResponseQuotas {\n"); + sb.append(" apiSignatureRequestsLeft: ").append(toIndentedString(apiSignatureRequestsLeft)).append("\n"); + sb.append(" documentsLeft: ").append(toIndentedString(documentsLeft)).append("\n"); + sb.append(" templatesTotal: ").append(toIndentedString(templatesTotal)).append("\n"); + sb.append(" templatesLeft: ").append(toIndentedString(templatesLeft)).append("\n"); + sb.append(" smsVerificationsLeft: ").append(toIndentedString(smsVerificationsLeft)).append("\n"); + sb.append(" numFaxPagesLeft: ").append(toIndentedString(numFaxPagesLeft)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (apiSignatureRequestsLeft != null) { + if (isFileTypeOrListOfFiles(apiSignatureRequestsLeft)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsVerificationsLeft(@javax.annotation.Nullable Integer smsVerificationsLeft) { - this.smsVerificationsLeft = smsVerificationsLeft; + if (apiSignatureRequestsLeft.getClass().equals(java.io.File.class) || + apiSignatureRequestsLeft.getClass().equals(Integer.class) || + apiSignatureRequestsLeft.getClass().equals(String.class) || + apiSignatureRequestsLeft.getClass().isEnum()) { + map.put("api_signature_requests_left", apiSignatureRequestsLeft); + } else if (isListOfFile(apiSignatureRequestsLeft)) { + for(int i = 0; i< getListSize(apiSignatureRequestsLeft); i++) { + map.put("api_signature_requests_left[" + i + "]", getFromList(apiSignatureRequestsLeft, i)); + } + } + else { + map.put("api_signature_requests_left", JSON.getDefault().getMapper().writeValueAsString(apiSignatureRequestsLeft)); + } } + if (documentsLeft != null) { + if (isFileTypeOrListOfFiles(documentsLeft)) { + fileTypeFound = true; + } - public AccountResponseQuotas numFaxPagesLeft( - @javax.annotation.Nullable Integer numFaxPagesLeft) { - this.numFaxPagesLeft = numFaxPagesLeft; - return this; + if (documentsLeft.getClass().equals(java.io.File.class) || + documentsLeft.getClass().equals(Integer.class) || + documentsLeft.getClass().equals(String.class) || + documentsLeft.getClass().isEnum()) { + map.put("documents_left", documentsLeft); + } else if (isListOfFile(documentsLeft)) { + for(int i = 0; i< getListSize(documentsLeft); i++) { + map.put("documents_left[" + i + "]", getFromList(documentsLeft, i)); + } + } + else { + map.put("documents_left", JSON.getDefault().getMapper().writeValueAsString(documentsLeft)); + } } + if (templatesTotal != null) { + if (isFileTypeOrListOfFiles(templatesTotal)) { + fileTypeFound = true; + } - /** - * Number of fax pages left - * - * @return numFaxPagesLeft - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_FAX_PAGES_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getNumFaxPagesLeft() { - return numFaxPagesLeft; + if (templatesTotal.getClass().equals(java.io.File.class) || + templatesTotal.getClass().equals(Integer.class) || + templatesTotal.getClass().equals(String.class) || + templatesTotal.getClass().isEnum()) { + map.put("templates_total", templatesTotal); + } else if (isListOfFile(templatesTotal)) { + for(int i = 0; i< getListSize(templatesTotal); i++) { + map.put("templates_total[" + i + "]", getFromList(templatesTotal, i)); + } + } + else { + map.put("templates_total", JSON.getDefault().getMapper().writeValueAsString(templatesTotal)); + } } + if (templatesLeft != null) { + if (isFileTypeOrListOfFiles(templatesLeft)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_NUM_FAX_PAGES_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumFaxPagesLeft(@javax.annotation.Nullable Integer numFaxPagesLeft) { - this.numFaxPagesLeft = numFaxPagesLeft; + if (templatesLeft.getClass().equals(java.io.File.class) || + templatesLeft.getClass().equals(Integer.class) || + templatesLeft.getClass().equals(String.class) || + templatesLeft.getClass().isEnum()) { + map.put("templates_left", templatesLeft); + } else if (isListOfFile(templatesLeft)) { + for(int i = 0; i< getListSize(templatesLeft); i++) { + map.put("templates_left[" + i + "]", getFromList(templatesLeft, i)); + } + } + else { + map.put("templates_left", JSON.getDefault().getMapper().writeValueAsString(templatesLeft)); + } } + if (smsVerificationsLeft != null) { + if (isFileTypeOrListOfFiles(smsVerificationsLeft)) { + fileTypeFound = true; + } - /** Return true if this AccountResponseQuotas object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (smsVerificationsLeft.getClass().equals(java.io.File.class) || + smsVerificationsLeft.getClass().equals(Integer.class) || + smsVerificationsLeft.getClass().equals(String.class) || + smsVerificationsLeft.getClass().isEnum()) { + map.put("sms_verifications_left", smsVerificationsLeft); + } else if (isListOfFile(smsVerificationsLeft)) { + for(int i = 0; i< getListSize(smsVerificationsLeft); i++) { + map.put("sms_verifications_left[" + i + "]", getFromList(smsVerificationsLeft, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("sms_verifications_left", JSON.getDefault().getMapper().writeValueAsString(smsVerificationsLeft)); } - AccountResponseQuotas accountResponseQuotas = (AccountResponseQuotas) o; - return Objects.equals( - this.apiSignatureRequestsLeft, - accountResponseQuotas.apiSignatureRequestsLeft) - && Objects.equals(this.documentsLeft, accountResponseQuotas.documentsLeft) - && Objects.equals(this.templatesTotal, accountResponseQuotas.templatesTotal) - && Objects.equals(this.templatesLeft, accountResponseQuotas.templatesLeft) - && Objects.equals( - this.smsVerificationsLeft, accountResponseQuotas.smsVerificationsLeft) - && Objects.equals(this.numFaxPagesLeft, accountResponseQuotas.numFaxPagesLeft); } + if (numFaxPagesLeft != null) { + if (isFileTypeOrListOfFiles(numFaxPagesLeft)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - apiSignatureRequestsLeft, - documentsLeft, - templatesTotal, - templatesLeft, - smsVerificationsLeft, - numFaxPagesLeft); + if (numFaxPagesLeft.getClass().equals(java.io.File.class) || + numFaxPagesLeft.getClass().equals(Integer.class) || + numFaxPagesLeft.getClass().equals(String.class) || + numFaxPagesLeft.getClass().isEnum()) { + map.put("num_fax_pages_left", numFaxPagesLeft); + } else if (isListOfFile(numFaxPagesLeft)) { + for(int i = 0; i< getListSize(numFaxPagesLeft); i++) { + map.put("num_fax_pages_left[" + i + "]", getFromList(numFaxPagesLeft, i)); + } + } + else { + map.put("num_fax_pages_left", JSON.getDefault().getMapper().writeValueAsString(numFaxPagesLeft)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountResponseQuotas {\n"); - sb.append(" apiSignatureRequestsLeft: ") - .append(toIndentedString(apiSignatureRequestsLeft)) - .append("\n"); - sb.append(" documentsLeft: ").append(toIndentedString(documentsLeft)).append("\n"); - sb.append(" templatesTotal: ").append(toIndentedString(templatesTotal)).append("\n"); - sb.append(" templatesLeft: ").append(toIndentedString(templatesLeft)).append("\n"); - sb.append(" smsVerificationsLeft: ") - .append(toIndentedString(smsVerificationsLeft)) - .append("\n"); - sb.append(" numFaxPagesLeft: ").append(toIndentedString(numFaxPagesLeft)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (apiSignatureRequestsLeft != null) { - if (isFileTypeOrListOfFiles(apiSignatureRequestsLeft)) { - fileTypeFound = true; - } - - if (apiSignatureRequestsLeft.getClass().equals(java.io.File.class) - || apiSignatureRequestsLeft.getClass().equals(Integer.class) - || apiSignatureRequestsLeft.getClass().equals(String.class) - || apiSignatureRequestsLeft.getClass().isEnum()) { - map.put("api_signature_requests_left", apiSignatureRequestsLeft); - } else if (isListOfFile(apiSignatureRequestsLeft)) { - for (int i = 0; i < getListSize(apiSignatureRequestsLeft); i++) { - map.put( - "api_signature_requests_left[" + i + "]", - getFromList(apiSignatureRequestsLeft, i)); - } - } else { - map.put( - "api_signature_requests_left", - JSON.getDefault() - .getMapper() - .writeValueAsString(apiSignatureRequestsLeft)); - } - } - if (documentsLeft != null) { - if (isFileTypeOrListOfFiles(documentsLeft)) { - fileTypeFound = true; - } - - if (documentsLeft.getClass().equals(java.io.File.class) - || documentsLeft.getClass().equals(Integer.class) - || documentsLeft.getClass().equals(String.class) - || documentsLeft.getClass().isEnum()) { - map.put("documents_left", documentsLeft); - } else if (isListOfFile(documentsLeft)) { - for (int i = 0; i < getListSize(documentsLeft); i++) { - map.put("documents_left[" + i + "]", getFromList(documentsLeft, i)); - } - } else { - map.put( - "documents_left", - JSON.getDefault().getMapper().writeValueAsString(documentsLeft)); - } - } - if (templatesTotal != null) { - if (isFileTypeOrListOfFiles(templatesTotal)) { - fileTypeFound = true; - } - - if (templatesTotal.getClass().equals(java.io.File.class) - || templatesTotal.getClass().equals(Integer.class) - || templatesTotal.getClass().equals(String.class) - || templatesTotal.getClass().isEnum()) { - map.put("templates_total", templatesTotal); - } else if (isListOfFile(templatesTotal)) { - for (int i = 0; i < getListSize(templatesTotal); i++) { - map.put("templates_total[" + i + "]", getFromList(templatesTotal, i)); - } - } else { - map.put( - "templates_total", - JSON.getDefault().getMapper().writeValueAsString(templatesTotal)); - } - } - if (templatesLeft != null) { - if (isFileTypeOrListOfFiles(templatesLeft)) { - fileTypeFound = true; - } - - if (templatesLeft.getClass().equals(java.io.File.class) - || templatesLeft.getClass().equals(Integer.class) - || templatesLeft.getClass().equals(String.class) - || templatesLeft.getClass().isEnum()) { - map.put("templates_left", templatesLeft); - } else if (isListOfFile(templatesLeft)) { - for (int i = 0; i < getListSize(templatesLeft); i++) { - map.put("templates_left[" + i + "]", getFromList(templatesLeft, i)); - } - } else { - map.put( - "templates_left", - JSON.getDefault().getMapper().writeValueAsString(templatesLeft)); - } - } - if (smsVerificationsLeft != null) { - if (isFileTypeOrListOfFiles(smsVerificationsLeft)) { - fileTypeFound = true; - } - - if (smsVerificationsLeft.getClass().equals(java.io.File.class) - || smsVerificationsLeft.getClass().equals(Integer.class) - || smsVerificationsLeft.getClass().equals(String.class) - || smsVerificationsLeft.getClass().isEnum()) { - map.put("sms_verifications_left", smsVerificationsLeft); - } else if (isListOfFile(smsVerificationsLeft)) { - for (int i = 0; i < getListSize(smsVerificationsLeft); i++) { - map.put( - "sms_verifications_left[" + i + "]", - getFromList(smsVerificationsLeft, i)); - } - } else { - map.put( - "sms_verifications_left", - JSON.getDefault().getMapper().writeValueAsString(smsVerificationsLeft)); - } - } - if (numFaxPagesLeft != null) { - if (isFileTypeOrListOfFiles(numFaxPagesLeft)) { - fileTypeFound = true; - } - - if (numFaxPagesLeft.getClass().equals(java.io.File.class) - || numFaxPagesLeft.getClass().equals(Integer.class) - || numFaxPagesLeft.getClass().equals(String.class) - || numFaxPagesLeft.getClass().isEnum()) { - map.put("num_fax_pages_left", numFaxPagesLeft); - } else if (isListOfFile(numFaxPagesLeft)) { - for (int i = 0; i < getListSize(numFaxPagesLeft); i++) { - map.put("num_fax_pages_left[" + i + "]", getFromList(numFaxPagesLeft, i)); - } - } else { - map.put( - "num_fax_pages_left", - JSON.getDefault().getMapper().writeValueAsString(numFaxPagesLeft)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java index 7906498fe..a3e6f53c3 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java @@ -10,158 +10,170 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** Details concerning monthly usage */ -@JsonPropertyOrder({AccountResponseUsage.JSON_PROPERTY_FAX_PAGES_SENT}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class AccountResponseUsage { - public static final String JSON_PROPERTY_FAX_PAGES_SENT = "fax_pages_sent"; - @javax.annotation.Nullable private Integer faxPagesSent; - - public AccountResponseUsage() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static AccountResponseUsage init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountResponseUsage.class); - } - public static AccountResponseUsage init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), AccountResponseUsage.class); - } - - public AccountResponseUsage faxPagesSent(@javax.annotation.Nullable Integer faxPagesSent) { - this.faxPagesSent = faxPagesSent; - return this; - } - - /** - * Number of fax pages sent - * - * @return faxPagesSent - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FAX_PAGES_SENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getFaxPagesSent() { - return faxPagesSent; +import com.dropbox.sign.ApiException; +/** + * Details concerning monthly usage + */ +@JsonPropertyOrder({ + AccountResponseUsage.JSON_PROPERTY_FAX_PAGES_SENT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class AccountResponseUsage { + public static final String JSON_PROPERTY_FAX_PAGES_SENT = "fax_pages_sent"; + @javax.annotation.Nullable + private Integer faxPagesSent; + + public AccountResponseUsage() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public AccountResponseUsage init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountResponseUsage.class); + } + + static public AccountResponseUsage init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + AccountResponseUsage.class + ); + } + + public AccountResponseUsage faxPagesSent(@javax.annotation.Nullable Integer faxPagesSent) { + this.faxPagesSent = faxPagesSent; + return this; + } + + /** + * Number of fax pages sent + * @return faxPagesSent + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAX_PAGES_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getFaxPagesSent() { + return faxPagesSent; + } + + + @JsonProperty(JSON_PROPERTY_FAX_PAGES_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFaxPagesSent(@javax.annotation.Nullable Integer faxPagesSent) { + this.faxPagesSent = faxPagesSent; + } + + + /** + * Return true if this AccountResponseUsage object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_FAX_PAGES_SENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFaxPagesSent(@javax.annotation.Nullable Integer faxPagesSent) { - this.faxPagesSent = faxPagesSent; + if (o == null || getClass() != o.getClass()) { + return false; } + AccountResponseUsage accountResponseUsage = (AccountResponseUsage) o; + return Objects.equals(this.faxPagesSent, accountResponseUsage.faxPagesSent); + } + + @Override + public int hashCode() { + return Objects.hash(faxPagesSent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountResponseUsage {\n"); + sb.append(" faxPagesSent: ").append(toIndentedString(faxPagesSent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (faxPagesSent != null) { + if (isFileTypeOrListOfFiles(faxPagesSent)) { + fileTypeFound = true; + } - /** Return true if this AccountResponseUsage object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (faxPagesSent.getClass().equals(java.io.File.class) || + faxPagesSent.getClass().equals(Integer.class) || + faxPagesSent.getClass().equals(String.class) || + faxPagesSent.getClass().isEnum()) { + map.put("fax_pages_sent", faxPagesSent); + } else if (isListOfFile(faxPagesSent)) { + for(int i = 0; i< getListSize(faxPagesSent); i++) { + map.put("fax_pages_sent[" + i + "]", getFromList(faxPagesSent, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("fax_pages_sent", JSON.getDefault().getMapper().writeValueAsString(faxPagesSent)); } - AccountResponseUsage accountResponseUsage = (AccountResponseUsage) o; - return Objects.equals(this.faxPagesSent, accountResponseUsage.faxPagesSent); } - - @Override - public int hashCode() { - return Objects.hash(faxPagesSent); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountResponseUsage {\n"); - sb.append(" faxPagesSent: ").append(toIndentedString(faxPagesSent)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (faxPagesSent != null) { - if (isFileTypeOrListOfFiles(faxPagesSent)) { - fileTypeFound = true; - } - - if (faxPagesSent.getClass().equals(java.io.File.class) - || faxPagesSent.getClass().equals(Integer.class) - || faxPagesSent.getClass().equals(String.class) - || faxPagesSent.getClass().isEnum()) { - map.put("fax_pages_sent", faxPagesSent); - } else if (isListOfFile(faxPagesSent)) { - for (int i = 0; i < getListSize(faxPagesSent); i++) { - map.put("fax_pages_sent[" + i + "]", getFromList(faxPagesSent, i)); - } - } else { - map.put( - "fax_pages_sent", - JSON.getDefault().getMapper().writeValueAsString(faxPagesSent)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java index 547051d2a..ba07d67a4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java @@ -10,256 +10,272 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** AccountUpdateRequest */ + +import com.dropbox.sign.ApiException; +/** + * AccountUpdateRequest + */ @JsonPropertyOrder({ - AccountUpdateRequest.JSON_PROPERTY_ACCOUNT_ID, - AccountUpdateRequest.JSON_PROPERTY_CALLBACK_URL, - AccountUpdateRequest.JSON_PROPERTY_LOCALE + AccountUpdateRequest.JSON_PROPERTY_ACCOUNT_ID, + AccountUpdateRequest.JSON_PROPERTY_CALLBACK_URL, + AccountUpdateRequest.JSON_PROPERTY_LOCALE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class AccountUpdateRequest { - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - @javax.annotation.Nullable private String accountId; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + @javax.annotation.Nullable + private String accountId; - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - @javax.annotation.Nullable private String callbackUrl; + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + @javax.annotation.Nullable + private String callbackUrl; - public static final String JSON_PROPERTY_LOCALE = "locale"; - @javax.annotation.Nullable private String locale; + public static final String JSON_PROPERTY_LOCALE = "locale"; + @javax.annotation.Nullable + private String locale; - public AccountUpdateRequest() {} + public AccountUpdateRequest() { + } - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static AccountUpdateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountUpdateRequest.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public AccountUpdateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountUpdateRequest.class); + } - public static AccountUpdateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), AccountUpdateRequest.class); - } + static public AccountUpdateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + AccountUpdateRequest.class + ); + } - public AccountUpdateRequest accountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; - } + public AccountUpdateRequest accountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + return this; + } - /** - * The ID of the Account - * - * @return accountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccountId() { - return accountId; - } + /** + * The ID of the Account + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - } + public String getAccountId() { + return accountId; + } - public AccountUpdateRequest callbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } - /** - * The URL that Dropbox Sign should POST events to. - * - * @return callbackUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCallbackUrl() { - return callbackUrl; - } + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + } - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - } - public AccountUpdateRequest locale(@javax.annotation.Nullable String locale) { - this.locale = locale; - return this; - } + public AccountUpdateRequest callbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; + } - /** - * The locale used in this Account. Check out the list of [supported - * locales](/api/reference/constants/#supported-locales) to learn more about the possible - * values. - * - * @return locale - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LOCALE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLocale() { - return locale; - } + /** + * The URL that Dropbox Sign should POST events to. + * @return callbackUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCallbackUrl() { + return callbackUrl; + } + + + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + } + + + public AccountUpdateRequest locale(@javax.annotation.Nullable String locale) { + this.locale = locale; + return this; + } + + /** + * The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. + * @return locale + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_LOCALE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLocale(@javax.annotation.Nullable String locale) { - this.locale = locale; + public String getLocale() { + return locale; + } + + + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocale(@javax.annotation.Nullable String locale) { + this.locale = locale; + } + + + /** + * Return true if this AccountUpdateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdateRequest accountUpdateRequest = (AccountUpdateRequest) o; + return Objects.equals(this.accountId, accountUpdateRequest.accountId) && + Objects.equals(this.callbackUrl, accountUpdateRequest.callbackUrl) && + Objects.equals(this.locale, accountUpdateRequest.locale); + } - /** Return true if this AccountUpdateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; + @Override + public int hashCode() { + return Objects.hash(accountId, callbackUrl, locale); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdateRequest {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; } - AccountUpdateRequest accountUpdateRequest = (AccountUpdateRequest) o; - return Objects.equals(this.accountId, accountUpdateRequest.accountId) - && Objects.equals(this.callbackUrl, accountUpdateRequest.callbackUrl) - && Objects.equals(this.locale, accountUpdateRequest.locale); - } - @Override - public int hashCode() { - return Objects.hash(accountId, callbackUrl, locale); + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } } + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountUpdateRequest {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); - sb.append("}"); - return sb.toString(); + if (callbackUrl.getClass().equals(java.io.File.class) || + callbackUrl.getClass().equals(Integer.class) || + callbackUrl.getClass().equals(String.class) || + callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for(int i = 0; i< getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } + else { + map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } } + if (locale != null) { + if (isFileTypeOrListOfFiles(locale)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } - - if (accountId.getClass().equals(java.io.File.class) - || accountId.getClass().equals(Integer.class) - || accountId.getClass().equals(String.class) - || accountId.getClass().isEnum()) { - map.put("account_id", accountId); - } else if (isListOfFile(accountId)) { - for (int i = 0; i < getListSize(accountId); i++) { - map.put("account_id[" + i + "]", getFromList(accountId, i)); - } - } else { - map.put( - "account_id", - JSON.getDefault().getMapper().writeValueAsString(accountId)); - } - } - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } - - if (callbackUrl.getClass().equals(java.io.File.class) - || callbackUrl.getClass().equals(Integer.class) - || callbackUrl.getClass().equals(String.class) - || callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for (int i = 0; i < getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } else { - map.put( - "callback_url", - JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); - } + if (locale.getClass().equals(java.io.File.class) || + locale.getClass().equals(Integer.class) || + locale.getClass().equals(String.class) || + locale.getClass().isEnum()) { + map.put("locale", locale); + } else if (isListOfFile(locale)) { + for(int i = 0; i< getListSize(locale); i++) { + map.put("locale[" + i + "]", getFromList(locale, i)); } - if (locale != null) { - if (isFileTypeOrListOfFiles(locale)) { - fileTypeFound = true; - } - - if (locale.getClass().equals(java.io.File.class) - || locale.getClass().equals(Integer.class) - || locale.getClass().equals(String.class) - || locale.getClass().isEnum()) { - map.put("locale", locale); - } else if (isListOfFile(locale)) { - for (int i = 0; i < getListSize(locale); i++) { - map.put("locale[" + i + "]", getFromList(locale, i)); - } - } else { - map.put("locale", JSON.getDefault().getMapper().writeValueAsString(locale)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("locale", JSON.getDefault().getMapper().writeValueAsString(locale)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java index d484b5052..447a29d69 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java @@ -10,159 +10,170 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** AccountVerifyRequest */ -@JsonPropertyOrder({AccountVerifyRequest.JSON_PROPERTY_EMAIL_ADDRESS}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class AccountVerifyRequest { - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nonnull private String emailAddress; - - public AccountVerifyRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static AccountVerifyRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountVerifyRequest.class); - } - public static AccountVerifyRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), AccountVerifyRequest.class); - } - - public AccountVerifyRequest emailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * Email address to run the verification for. - * - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getEmailAddress() { - return emailAddress; +import com.dropbox.sign.ApiException; +/** + * AccountVerifyRequest + */ +@JsonPropertyOrder({ + AccountVerifyRequest.JSON_PROPERTY_EMAIL_ADDRESS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class AccountVerifyRequest { + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nonnull + private String emailAddress; + + public AccountVerifyRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public AccountVerifyRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountVerifyRequest.class); + } + + static public AccountVerifyRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + AccountVerifyRequest.class + ); + } + + public AccountVerifyRequest emailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Email address to run the verification for. + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this AccountVerifyRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; + if (o == null || getClass() != o.getClass()) { + return false; } + AccountVerifyRequest accountVerifyRequest = (AccountVerifyRequest) o; + return Objects.equals(this.emailAddress, accountVerifyRequest.emailAddress); + } + + @Override + public int hashCode() { + return Objects.hash(emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountVerifyRequest {\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - /** Return true if this AccountVerifyRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); } - AccountVerifyRequest accountVerifyRequest = (AccountVerifyRequest) o; - return Objects.equals(this.emailAddress, accountVerifyRequest.emailAddress); } - - @Override - public int hashCode() { - return Objects.hash(emailAddress); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountVerifyRequest {\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java index d5b7c64bb..f18dc7e7b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java @@ -10,217 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.AccountVerifyResponseAccount; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** AccountVerifyResponse */ + +import com.dropbox.sign.ApiException; +/** + * AccountVerifyResponse + */ @JsonPropertyOrder({ - AccountVerifyResponse.JSON_PROPERTY_ACCOUNT, - AccountVerifyResponse.JSON_PROPERTY_WARNINGS + AccountVerifyResponse.JSON_PROPERTY_ACCOUNT, + AccountVerifyResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class AccountVerifyResponse { - public static final String JSON_PROPERTY_ACCOUNT = "account"; - @javax.annotation.Nullable private AccountVerifyResponseAccount account; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public AccountVerifyResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static AccountVerifyResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountVerifyResponse.class); - } - - public static AccountVerifyResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), AccountVerifyResponse.class); - } - - public AccountVerifyResponse account( - @javax.annotation.Nullable AccountVerifyResponseAccount account) { - this.account = account; - return this; - } - - /** - * Get account - * - * @return account - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AccountVerifyResponseAccount getAccount() { - return account; - } - - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccount(@javax.annotation.Nullable AccountVerifyResponseAccount account) { - this.account = account; - } - - public AccountVerifyResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public AccountVerifyResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_ACCOUNT = "account"; + @javax.annotation.Nullable + private AccountVerifyResponseAccount account; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public AccountVerifyResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public AccountVerifyResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountVerifyResponse.class); + } + + static public AccountVerifyResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + AccountVerifyResponse.class + ); + } + + public AccountVerifyResponse account(@javax.annotation.Nullable AccountVerifyResponseAccount account) { + this.account = account; + return this; + } + + /** + * Get account + * @return account + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AccountVerifyResponseAccount getAccount() { + return account; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccount(@javax.annotation.Nullable AccountVerifyResponseAccount account) { + this.account = account; + } + + + public AccountVerifyResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public AccountVerifyResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this AccountVerifyResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountVerifyResponse accountVerifyResponse = (AccountVerifyResponse) o; + return Objects.equals(this.account, accountVerifyResponse.account) && + Objects.equals(this.warnings, accountVerifyResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(account, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountVerifyResponse {\n"); + sb.append(" account: ").append(toIndentedString(account)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (account != null) { + if (isFileTypeOrListOfFiles(account)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this AccountVerifyResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (account.getClass().equals(java.io.File.class) || + account.getClass().equals(Integer.class) || + account.getClass().equals(String.class) || + account.getClass().isEnum()) { + map.put("account", account); + } else if (isListOfFile(account)) { + for(int i = 0; i< getListSize(account); i++) { + map.put("account[" + i + "]", getFromList(account, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); } - AccountVerifyResponse accountVerifyResponse = (AccountVerifyResponse) o; - return Objects.equals(this.account, accountVerifyResponse.account) - && Objects.equals(this.warnings, accountVerifyResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(account, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountVerifyResponse {\n"); - sb.append(" account: ").append(toIndentedString(account)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (account != null) { - if (isFileTypeOrListOfFiles(account)) { - fileTypeFound = true; - } - - if (account.getClass().equals(java.io.File.class) - || account.getClass().equals(Integer.class) - || account.getClass().equals(String.class) - || account.getClass().isEnum()) { - map.put("account", account); - } else if (isListOfFile(account)) { - for (int i = 0; i < getListSize(account); i++) { - map.put("account[" + i + "]", getFromList(account, i)); - } - } else { - map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java index e8002ca39..86cc2cf28 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java @@ -10,162 +10,170 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** AccountVerifyResponseAccount */ -@JsonPropertyOrder({AccountVerifyResponseAccount.JSON_PROPERTY_EMAIL_ADDRESS}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class AccountVerifyResponseAccount { - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; - - public AccountVerifyResponseAccount() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static AccountVerifyResponseAccount init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountVerifyResponseAccount.class); - } - public static AccountVerifyResponseAccount init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - AccountVerifyResponseAccount.class); - } - - public AccountVerifyResponseAccount emailAddress( - @javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address associated with the Account. - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; +import com.dropbox.sign.ApiException; +/** + * AccountVerifyResponseAccount + */ +@JsonPropertyOrder({ + AccountVerifyResponseAccount.JSON_PROPERTY_EMAIL_ADDRESS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class AccountVerifyResponseAccount { + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; + + public AccountVerifyResponseAccount() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public AccountVerifyResponseAccount init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountVerifyResponseAccount.class); + } + + static public AccountVerifyResponseAccount init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + AccountVerifyResponseAccount.class + ); + } + + public AccountVerifyResponseAccount emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The email address associated with the Account. + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this AccountVerifyResponseAccount object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; + if (o == null || getClass() != o.getClass()) { + return false; } + AccountVerifyResponseAccount accountVerifyResponseAccount = (AccountVerifyResponseAccount) o; + return Objects.equals(this.emailAddress, accountVerifyResponseAccount.emailAddress); + } + + @Override + public int hashCode() { + return Objects.hash(emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountVerifyResponseAccount {\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - /** Return true if this AccountVerifyResponseAccount object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); } - AccountVerifyResponseAccount accountVerifyResponseAccount = - (AccountVerifyResponseAccount) o; - return Objects.equals(this.emailAddress, accountVerifyResponseAccount.emailAddress); } - - @Override - public int hashCode() { - return Objects.hash(emailAddress); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountVerifyResponseAccount {\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java index 40e1c9482..d7e25bab1 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java @@ -10,461 +10,490 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubOAuth; +import com.dropbox.sign.model.SubOptions; +import com.dropbox.sign.model.SubWhiteLabelingOptions; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** ApiAppCreateRequest */ + +import com.dropbox.sign.ApiException; +/** + * ApiAppCreateRequest + */ @JsonPropertyOrder({ - ApiAppCreateRequest.JSON_PROPERTY_DOMAINS, - ApiAppCreateRequest.JSON_PROPERTY_NAME, - ApiAppCreateRequest.JSON_PROPERTY_CALLBACK_URL, - ApiAppCreateRequest.JSON_PROPERTY_CUSTOM_LOGO_FILE, - ApiAppCreateRequest.JSON_PROPERTY_OAUTH, - ApiAppCreateRequest.JSON_PROPERTY_OPTIONS, - ApiAppCreateRequest.JSON_PROPERTY_WHITE_LABELING_OPTIONS + ApiAppCreateRequest.JSON_PROPERTY_DOMAINS, + ApiAppCreateRequest.JSON_PROPERTY_NAME, + ApiAppCreateRequest.JSON_PROPERTY_CALLBACK_URL, + ApiAppCreateRequest.JSON_PROPERTY_CUSTOM_LOGO_FILE, + ApiAppCreateRequest.JSON_PROPERTY_OAUTH, + ApiAppCreateRequest.JSON_PROPERTY_OPTIONS, + ApiAppCreateRequest.JSON_PROPERTY_WHITE_LABELING_OPTIONS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ApiAppCreateRequest { - public static final String JSON_PROPERTY_DOMAINS = "domains"; - @javax.annotation.Nonnull private List domains = new ArrayList<>(); - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull private String name; - - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - @javax.annotation.Nullable private String callbackUrl; - - public static final String JSON_PROPERTY_CUSTOM_LOGO_FILE = "custom_logo_file"; - @javax.annotation.Nullable private File customLogoFile; - - public static final String JSON_PROPERTY_OAUTH = "oauth"; - @javax.annotation.Nullable private SubOAuth oauth; - - public static final String JSON_PROPERTY_OPTIONS = "options"; - @javax.annotation.Nullable private SubOptions options; - - public static final String JSON_PROPERTY_WHITE_LABELING_OPTIONS = "white_labeling_options"; - @javax.annotation.Nullable private SubWhiteLabelingOptions whiteLabelingOptions; - - public ApiAppCreateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ApiAppCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppCreateRequest.class); - } - - public static ApiAppCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), ApiAppCreateRequest.class); - } - - public ApiAppCreateRequest domains(@javax.annotation.Nonnull List domains) { - this.domains = domains; - return this; - } - - public ApiAppCreateRequest addDomainsItem(String domainsItem) { - if (this.domains == null) { - this.domains = new ArrayList<>(); + public static final String JSON_PROPERTY_DOMAINS = "domains"; + @javax.annotation.Nonnull + private List domains = new ArrayList<>(); + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + @javax.annotation.Nullable + private String callbackUrl; + + public static final String JSON_PROPERTY_CUSTOM_LOGO_FILE = "custom_logo_file"; + @javax.annotation.Nullable + private File customLogoFile; + + public static final String JSON_PROPERTY_OAUTH = "oauth"; + @javax.annotation.Nullable + private SubOAuth oauth; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + @javax.annotation.Nullable + private SubOptions options; + + public static final String JSON_PROPERTY_WHITE_LABELING_OPTIONS = "white_labeling_options"; + @javax.annotation.Nullable + private SubWhiteLabelingOptions whiteLabelingOptions; + + public ApiAppCreateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ApiAppCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppCreateRequest.class); + } + + static public ApiAppCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ApiAppCreateRequest.class + ); + } + + public ApiAppCreateRequest domains(@javax.annotation.Nonnull List domains) { + this.domains = domains; + return this; + } + + public ApiAppCreateRequest addDomainsItem(String domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); + } + this.domains.add(domainsItem); + return this; + } + + /** + * The domain names the ApiApp will be associated with. + * @return domains + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getDomains() { + return domains; + } + + + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDomains(@javax.annotation.Nonnull List domains) { + this.domains = domains; + } + + + public ApiAppCreateRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name you want to assign to the ApiApp. + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public ApiAppCreateRequest callbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; + } + + /** + * The URL at which the ApiApp should receive event callbacks. + * @return callbackUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCallbackUrl() { + return callbackUrl; + } + + + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + } + + + public ApiAppCreateRequest customLogoFile(@javax.annotation.Nullable File customLogoFile) { + this.customLogoFile = customLogoFile; + return this; + } + + /** + * An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) + * @return customLogoFile + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public File getCustomLogoFile() { + return customLogoFile; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomLogoFile(@javax.annotation.Nullable File customLogoFile) { + this.customLogoFile = customLogoFile; + } + + + public ApiAppCreateRequest oauth(@javax.annotation.Nullable SubOAuth oauth) { + this.oauth = oauth; + return this; + } + + /** + * Get oauth + * @return oauth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OAUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubOAuth getOauth() { + return oauth; + } + + + @JsonProperty(JSON_PROPERTY_OAUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOauth(@javax.annotation.Nullable SubOAuth oauth) { + this.oauth = oauth; + } + + + public ApiAppCreateRequest options(@javax.annotation.Nullable SubOptions options) { + this.options = options; + return this; + } + + /** + * Get options + * @return options + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubOptions getOptions() { + return options; + } + + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOptions(@javax.annotation.Nullable SubOptions options) { + this.options = options; + } + + + public ApiAppCreateRequest whiteLabelingOptions(@javax.annotation.Nullable SubWhiteLabelingOptions whiteLabelingOptions) { + this.whiteLabelingOptions = whiteLabelingOptions; + return this; + } + + /** + * Get whiteLabelingOptions + * @return whiteLabelingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubWhiteLabelingOptions getWhiteLabelingOptions() { + return whiteLabelingOptions; + } + + + @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhiteLabelingOptions(@javax.annotation.Nullable SubWhiteLabelingOptions whiteLabelingOptions) { + this.whiteLabelingOptions = whiteLabelingOptions; + } + + + /** + * Return true if this ApiAppCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiAppCreateRequest apiAppCreateRequest = (ApiAppCreateRequest) o; + return Objects.equals(this.domains, apiAppCreateRequest.domains) && + Objects.equals(this.name, apiAppCreateRequest.name) && + Objects.equals(this.callbackUrl, apiAppCreateRequest.callbackUrl) && + Objects.equals(this.customLogoFile, apiAppCreateRequest.customLogoFile) && + Objects.equals(this.oauth, apiAppCreateRequest.oauth) && + Objects.equals(this.options, apiAppCreateRequest.options) && + Objects.equals(this.whiteLabelingOptions, apiAppCreateRequest.whiteLabelingOptions); + } + + @Override + public int hashCode() { + return Objects.hash(domains, name, callbackUrl, customLogoFile, oauth, options, whiteLabelingOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppCreateRequest {\n"); + sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" customLogoFile: ").append(toIndentedString(customLogoFile)).append("\n"); + sb.append(" oauth: ").append(toIndentedString(oauth)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" whiteLabelingOptions: ").append(toIndentedString(whiteLabelingOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (domains != null) { + if (isFileTypeOrListOfFiles(domains)) { + fileTypeFound = true; } - this.domains.add(domainsItem); - return this; - } - - /** - * The domain names the ApiApp will be associated with. - * - * @return domains - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_DOMAINS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getDomains() { - return domains; - } - - @JsonProperty(JSON_PROPERTY_DOMAINS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDomains(@javax.annotation.Nonnull List domains) { - this.domains = domains; - } - - public ApiAppCreateRequest name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name you want to assign to the ApiApp. - * - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public ApiAppCreateRequest callbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } - - /** - * The URL at which the ApiApp should receive event callbacks. - * - * @return callbackUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCallbackUrl() { - return callbackUrl; - } - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - public ApiAppCreateRequest customLogoFile(@javax.annotation.Nullable File customLogoFile) { - this.customLogoFile = customLogoFile; - return this; - } - - /** - * An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) - * - * @return customLogoFile - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public File getCustomLogoFile() { - return customLogoFile; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomLogoFile(@javax.annotation.Nullable File customLogoFile) { - this.customLogoFile = customLogoFile; - } - - public ApiAppCreateRequest oauth(@javax.annotation.Nullable SubOAuth oauth) { - this.oauth = oauth; - return this; - } - - /** - * Get oauth - * - * @return oauth - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OAUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubOAuth getOauth() { - return oauth; - } - @JsonProperty(JSON_PROPERTY_OAUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOauth(@javax.annotation.Nullable SubOAuth oauth) { - this.oauth = oauth; - } - - public ApiAppCreateRequest options(@javax.annotation.Nullable SubOptions options) { - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubOptions getOptions() { - return options; + if (domains.getClass().equals(java.io.File.class) || + domains.getClass().equals(Integer.class) || + domains.getClass().equals(String.class) || + domains.getClass().isEnum()) { + map.put("domains", domains); + } else if (isListOfFile(domains)) { + for(int i = 0; i< getListSize(domains); i++) { + map.put("domains[" + i + "]", getFromList(domains, i)); + } + } + else { + map.put("domains", JSON.getDefault().getMapper().writeValueAsString(domains)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOptions(@javax.annotation.Nullable SubOptions options) { - this.options = options; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; + } - public ApiAppCreateRequest whiteLabelingOptions( - @javax.annotation.Nullable SubWhiteLabelingOptions whiteLabelingOptions) { - this.whiteLabelingOptions = whiteLabelingOptions; - return this; + if (callbackUrl.getClass().equals(java.io.File.class) || + callbackUrl.getClass().equals(Integer.class) || + callbackUrl.getClass().equals(String.class) || + callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for(int i = 0; i< getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } + else { + map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } } + if (customLogoFile != null) { + if (isFileTypeOrListOfFiles(customLogoFile)) { + fileTypeFound = true; + } - /** - * Get whiteLabelingOptions - * - * @return whiteLabelingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubWhiteLabelingOptions getWhiteLabelingOptions() { - return whiteLabelingOptions; + if (customLogoFile.getClass().equals(java.io.File.class) || + customLogoFile.getClass().equals(Integer.class) || + customLogoFile.getClass().equals(String.class) || + customLogoFile.getClass().isEnum()) { + map.put("custom_logo_file", customLogoFile); + } else if (isListOfFile(customLogoFile)) { + for(int i = 0; i< getListSize(customLogoFile); i++) { + map.put("custom_logo_file[" + i + "]", getFromList(customLogoFile, i)); + } + } + else { + map.put("custom_logo_file", JSON.getDefault().getMapper().writeValueAsString(customLogoFile)); + } } + if (oauth != null) { + if (isFileTypeOrListOfFiles(oauth)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWhiteLabelingOptions( - @javax.annotation.Nullable SubWhiteLabelingOptions whiteLabelingOptions) { - this.whiteLabelingOptions = whiteLabelingOptions; + if (oauth.getClass().equals(java.io.File.class) || + oauth.getClass().equals(Integer.class) || + oauth.getClass().equals(String.class) || + oauth.getClass().isEnum()) { + map.put("oauth", oauth); + } else if (isListOfFile(oauth)) { + for(int i = 0; i< getListSize(oauth); i++) { + map.put("oauth[" + i + "]", getFromList(oauth, i)); + } + } + else { + map.put("oauth", JSON.getDefault().getMapper().writeValueAsString(oauth)); + } } + if (options != null) { + if (isFileTypeOrListOfFiles(options)) { + fileTypeFound = true; + } - /** Return true if this ApiAppCreateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (options.getClass().equals(java.io.File.class) || + options.getClass().equals(Integer.class) || + options.getClass().equals(String.class) || + options.getClass().isEnum()) { + map.put("options", options); + } else if (isListOfFile(options)) { + for(int i = 0; i< getListSize(options); i++) { + map.put("options[" + i + "]", getFromList(options, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); } - ApiAppCreateRequest apiAppCreateRequest = (ApiAppCreateRequest) o; - return Objects.equals(this.domains, apiAppCreateRequest.domains) - && Objects.equals(this.name, apiAppCreateRequest.name) - && Objects.equals(this.callbackUrl, apiAppCreateRequest.callbackUrl) - && Objects.equals(this.customLogoFile, apiAppCreateRequest.customLogoFile) - && Objects.equals(this.oauth, apiAppCreateRequest.oauth) - && Objects.equals(this.options, apiAppCreateRequest.options) - && Objects.equals( - this.whiteLabelingOptions, apiAppCreateRequest.whiteLabelingOptions); } + if (whiteLabelingOptions != null) { + if (isFileTypeOrListOfFiles(whiteLabelingOptions)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - domains, name, callbackUrl, customLogoFile, oauth, options, whiteLabelingOptions); + if (whiteLabelingOptions.getClass().equals(java.io.File.class) || + whiteLabelingOptions.getClass().equals(Integer.class) || + whiteLabelingOptions.getClass().equals(String.class) || + whiteLabelingOptions.getClass().isEnum()) { + map.put("white_labeling_options", whiteLabelingOptions); + } else if (isListOfFile(whiteLabelingOptions)) { + for(int i = 0; i< getListSize(whiteLabelingOptions); i++) { + map.put("white_labeling_options[" + i + "]", getFromList(whiteLabelingOptions, i)); + } + } + else { + map.put("white_labeling_options", JSON.getDefault().getMapper().writeValueAsString(whiteLabelingOptions)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppCreateRequest {\n"); - sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" customLogoFile: ").append(toIndentedString(customLogoFile)).append("\n"); - sb.append(" oauth: ").append(toIndentedString(oauth)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" whiteLabelingOptions: ") - .append(toIndentedString(whiteLabelingOptions)) - .append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (domains != null) { - if (isFileTypeOrListOfFiles(domains)) { - fileTypeFound = true; - } - - if (domains.getClass().equals(java.io.File.class) - || domains.getClass().equals(Integer.class) - || domains.getClass().equals(String.class) - || domains.getClass().isEnum()) { - map.put("domains", domains); - } else if (isListOfFile(domains)) { - for (int i = 0; i < getListSize(domains); i++) { - map.put("domains[" + i + "]", getFromList(domains, i)); - } - } else { - map.put("domains", JSON.getDefault().getMapper().writeValueAsString(domains)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } - - if (callbackUrl.getClass().equals(java.io.File.class) - || callbackUrl.getClass().equals(Integer.class) - || callbackUrl.getClass().equals(String.class) - || callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for (int i = 0; i < getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } else { - map.put( - "callback_url", - JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); - } - } - if (customLogoFile != null) { - if (isFileTypeOrListOfFiles(customLogoFile)) { - fileTypeFound = true; - } - - if (customLogoFile.getClass().equals(java.io.File.class) - || customLogoFile.getClass().equals(Integer.class) - || customLogoFile.getClass().equals(String.class) - || customLogoFile.getClass().isEnum()) { - map.put("custom_logo_file", customLogoFile); - } else if (isListOfFile(customLogoFile)) { - for (int i = 0; i < getListSize(customLogoFile); i++) { - map.put("custom_logo_file[" + i + "]", getFromList(customLogoFile, i)); - } - } else { - map.put( - "custom_logo_file", - JSON.getDefault().getMapper().writeValueAsString(customLogoFile)); - } - } - if (oauth != null) { - if (isFileTypeOrListOfFiles(oauth)) { - fileTypeFound = true; - } - - if (oauth.getClass().equals(java.io.File.class) - || oauth.getClass().equals(Integer.class) - || oauth.getClass().equals(String.class) - || oauth.getClass().isEnum()) { - map.put("oauth", oauth); - } else if (isListOfFile(oauth)) { - for (int i = 0; i < getListSize(oauth); i++) { - map.put("oauth[" + i + "]", getFromList(oauth, i)); - } - } else { - map.put("oauth", JSON.getDefault().getMapper().writeValueAsString(oauth)); - } - } - if (options != null) { - if (isFileTypeOrListOfFiles(options)) { - fileTypeFound = true; - } - - if (options.getClass().equals(java.io.File.class) - || options.getClass().equals(Integer.class) - || options.getClass().equals(String.class) - || options.getClass().isEnum()) { - map.put("options", options); - } else if (isListOfFile(options)) { - for (int i = 0; i < getListSize(options); i++) { - map.put("options[" + i + "]", getFromList(options, i)); - } - } else { - map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); - } - } - if (whiteLabelingOptions != null) { - if (isFileTypeOrListOfFiles(whiteLabelingOptions)) { - fileTypeFound = true; - } - - if (whiteLabelingOptions.getClass().equals(java.io.File.class) - || whiteLabelingOptions.getClass().equals(Integer.class) - || whiteLabelingOptions.getClass().equals(String.class) - || whiteLabelingOptions.getClass().isEnum()) { - map.put("white_labeling_options", whiteLabelingOptions); - } else if (isListOfFile(whiteLabelingOptions)) { - for (int i = 0; i < getListSize(whiteLabelingOptions); i++) { - map.put( - "white_labeling_options[" + i + "]", - getFromList(whiteLabelingOptions, i)); - } - } else { - map.put( - "white_labeling_options", - JSON.getDefault().getMapper().writeValueAsString(whiteLabelingOptions)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java index 54ce2c4bb..20be844ef 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java @@ -10,215 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.ApiAppResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** ApiAppGetResponse */ + +import com.dropbox.sign.ApiException; +/** + * ApiAppGetResponse + */ @JsonPropertyOrder({ - ApiAppGetResponse.JSON_PROPERTY_API_APP, - ApiAppGetResponse.JSON_PROPERTY_WARNINGS + ApiAppGetResponse.JSON_PROPERTY_API_APP, + ApiAppGetResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ApiAppGetResponse { - public static final String JSON_PROPERTY_API_APP = "api_app"; - @javax.annotation.Nonnull private ApiAppResponse apiApp; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public ApiAppGetResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ApiAppGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppGetResponse.class); - } - - public static ApiAppGetResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), ApiAppGetResponse.class); - } - - public ApiAppGetResponse apiApp(@javax.annotation.Nonnull ApiAppResponse apiApp) { - this.apiApp = apiApp; - return this; - } - - /** - * Get apiApp - * - * @return apiApp - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_API_APP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ApiAppResponse getApiApp() { - return apiApp; - } - - @JsonProperty(JSON_PROPERTY_API_APP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setApiApp(@javax.annotation.Nonnull ApiAppResponse apiApp) { - this.apiApp = apiApp; - } - - public ApiAppGetResponse warnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public ApiAppGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_API_APP = "api_app"; + @javax.annotation.Nonnull + private ApiAppResponse apiApp; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public ApiAppGetResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ApiAppGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppGetResponse.class); + } + + static public ApiAppGetResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ApiAppGetResponse.class + ); + } + + public ApiAppGetResponse apiApp(@javax.annotation.Nonnull ApiAppResponse apiApp) { + this.apiApp = apiApp; + return this; + } + + /** + * Get apiApp + * @return apiApp + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_API_APP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ApiAppResponse getApiApp() { + return apiApp; + } + + + @JsonProperty(JSON_PROPERTY_API_APP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setApiApp(@javax.annotation.Nonnull ApiAppResponse apiApp) { + this.apiApp = apiApp; + } + + + public ApiAppGetResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public ApiAppGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this ApiAppGetResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiAppGetResponse apiAppGetResponse = (ApiAppGetResponse) o; + return Objects.equals(this.apiApp, apiAppGetResponse.apiApp) && + Objects.equals(this.warnings, apiAppGetResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(apiApp, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppGetResponse {\n"); + sb.append(" apiApp: ").append(toIndentedString(apiApp)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (apiApp != null) { + if (isFileTypeOrListOfFiles(apiApp)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this ApiAppGetResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (apiApp.getClass().equals(java.io.File.class) || + apiApp.getClass().equals(Integer.class) || + apiApp.getClass().equals(String.class) || + apiApp.getClass().isEnum()) { + map.put("api_app", apiApp); + } else if (isListOfFile(apiApp)) { + for(int i = 0; i< getListSize(apiApp); i++) { + map.put("api_app[" + i + "]", getFromList(apiApp, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("api_app", JSON.getDefault().getMapper().writeValueAsString(apiApp)); } - ApiAppGetResponse apiAppGetResponse = (ApiAppGetResponse) o; - return Objects.equals(this.apiApp, apiAppGetResponse.apiApp) - && Objects.equals(this.warnings, apiAppGetResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(apiApp, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppGetResponse {\n"); - sb.append(" apiApp: ").append(toIndentedString(apiApp)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (apiApp != null) { - if (isFileTypeOrListOfFiles(apiApp)) { - fileTypeFound = true; - } - - if (apiApp.getClass().equals(java.io.File.class) - || apiApp.getClass().equals(Integer.class) - || apiApp.getClass().equals(String.class) - || apiApp.getClass().isEnum()) { - map.put("api_app", apiApp); - } else if (isListOfFile(apiApp)) { - for (int i = 0; i < getListSize(apiApp); i++) { - map.put("api_app[" + i + "]", getFromList(apiApp, i)); - } - } else { - map.put("api_app", JSON.getDefault().getMapper().writeValueAsString(apiApp)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java index 8a50aef37..41c9bd57c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java @@ -10,272 +10,293 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.ApiAppResponse; +import com.dropbox.sign.model.ListInfoResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** ApiAppListResponse */ +import com.dropbox.sign.ApiException; +/** + * ApiAppListResponse + */ @JsonPropertyOrder({ - ApiAppListResponse.JSON_PROPERTY_API_APPS, - ApiAppListResponse.JSON_PROPERTY_LIST_INFO, - ApiAppListResponse.JSON_PROPERTY_WARNINGS + ApiAppListResponse.JSON_PROPERTY_API_APPS, + ApiAppListResponse.JSON_PROPERTY_LIST_INFO, + ApiAppListResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ApiAppListResponse { - public static final String JSON_PROPERTY_API_APPS = "api_apps"; - @javax.annotation.Nonnull private List apiApps = new ArrayList<>(); - - public static final String JSON_PROPERTY_LIST_INFO = "list_info"; - @javax.annotation.Nonnull private ListInfoResponse listInfo; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public ApiAppListResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ApiAppListResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppListResponse.class); - } - - public static ApiAppListResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), ApiAppListResponse.class); + public static final String JSON_PROPERTY_API_APPS = "api_apps"; + @javax.annotation.Nonnull + private List apiApps = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + @javax.annotation.Nonnull + private ListInfoResponse listInfo; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public ApiAppListResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ApiAppListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppListResponse.class); + } + + static public ApiAppListResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ApiAppListResponse.class + ); + } + + public ApiAppListResponse apiApps(@javax.annotation.Nonnull List apiApps) { + this.apiApps = apiApps; + return this; + } + + public ApiAppListResponse addApiAppsItem(ApiAppResponse apiAppsItem) { + if (this.apiApps == null) { + this.apiApps = new ArrayList<>(); } - - public ApiAppListResponse apiApps(@javax.annotation.Nonnull List apiApps) { - this.apiApps = apiApps; - return this; - } - - public ApiAppListResponse addApiAppsItem(ApiAppResponse apiAppsItem) { - if (this.apiApps == null) { - this.apiApps = new ArrayList<>(); - } - this.apiApps.add(apiAppsItem); - return this; + this.apiApps.add(apiAppsItem); + return this; + } + + /** + * Contains information about API Apps. + * @return apiApps + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_API_APPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getApiApps() { + return apiApps; + } + + + @JsonProperty(JSON_PROPERTY_API_APPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setApiApps(@javax.annotation.Nonnull List apiApps) { + this.apiApps = apiApps; + } + + + public ApiAppListResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; + } + + /** + * Get listInfo + * @return listInfo + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ListInfoResponse getListInfo() { + return listInfo; + } + + + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + } + + + public ApiAppListResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public ApiAppListResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } - - /** - * Contains information about API Apps. - * - * @return apiApps - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_API_APPS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getApiApps() { - return apiApps; - } - - @JsonProperty(JSON_PROPERTY_API_APPS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setApiApps(@javax.annotation.Nonnull List apiApps) { - this.apiApps = apiApps; + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this ApiAppListResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public ApiAppListResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - /** - * Get listInfo - * - * @return listInfo - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ListInfoResponse getListInfo() { - return listInfo; - } - - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - } - - public ApiAppListResponse warnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public ApiAppListResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + ApiAppListResponse apiAppListResponse = (ApiAppListResponse) o; + return Objects.equals(this.apiApps, apiAppListResponse.apiApps) && + Objects.equals(this.listInfo, apiAppListResponse.listInfo) && + Objects.equals(this.warnings, apiAppListResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(apiApps, listInfo, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppListResponse {\n"); + sb.append(" apiApps: ").append(toIndentedString(apiApps)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (apiApps != null) { + if (isFileTypeOrListOfFiles(apiApps)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; + if (apiApps.getClass().equals(java.io.File.class) || + apiApps.getClass().equals(Integer.class) || + apiApps.getClass().equals(String.class) || + apiApps.getClass().isEnum()) { + map.put("api_apps", apiApps); + } else if (isListOfFile(apiApps)) { + for(int i = 0; i< getListSize(apiApps); i++) { + map.put("api_apps[" + i + "]", getFromList(apiApps, i)); + } + } + else { + map.put("api_apps", JSON.getDefault().getMapper().writeValueAsString(apiApps)); + } } + if (listInfo != null) { + if (isFileTypeOrListOfFiles(listInfo)) { + fileTypeFound = true; + } - /** Return true if this ApiAppListResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (listInfo.getClass().equals(java.io.File.class) || + listInfo.getClass().equals(Integer.class) || + listInfo.getClass().equals(String.class) || + listInfo.getClass().isEnum()) { + map.put("list_info", listInfo); + } else if (isListOfFile(listInfo)) { + for(int i = 0; i< getListSize(listInfo); i++) { + map.put("list_info[" + i + "]", getFromList(listInfo, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("list_info", JSON.getDefault().getMapper().writeValueAsString(listInfo)); } - ApiAppListResponse apiAppListResponse = (ApiAppListResponse) o; - return Objects.equals(this.apiApps, apiAppListResponse.apiApps) - && Objects.equals(this.listInfo, apiAppListResponse.listInfo) - && Objects.equals(this.warnings, apiAppListResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(apiApps, listInfo, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppListResponse {\n"); - sb.append(" apiApps: ").append(toIndentedString(apiApps)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (apiApps != null) { - if (isFileTypeOrListOfFiles(apiApps)) { - fileTypeFound = true; - } - - if (apiApps.getClass().equals(java.io.File.class) - || apiApps.getClass().equals(Integer.class) - || apiApps.getClass().equals(String.class) - || apiApps.getClass().isEnum()) { - map.put("api_apps", apiApps); - } else if (isListOfFile(apiApps)) { - for (int i = 0; i < getListSize(apiApps); i++) { - map.put("api_apps[" + i + "]", getFromList(apiApps, i)); - } - } else { - map.put("api_apps", JSON.getDefault().getMapper().writeValueAsString(apiApps)); - } - } - if (listInfo != null) { - if (isFileTypeOrListOfFiles(listInfo)) { - fileTypeFound = true; - } - - if (listInfo.getClass().equals(java.io.File.class) - || listInfo.getClass().equals(Integer.class) - || listInfo.getClass().equals(String.class) - || listInfo.getClass().isEnum()) { - map.put("list_info", listInfo); - } else if (isListOfFile(listInfo)) { - for (int i = 0; i < getListSize(listInfo); i++) { - map.put("list_info[" + i + "]", getFromList(listInfo, i)); - } - } else { - map.put( - "list_info", - JSON.getDefault().getMapper().writeValueAsString(listInfo)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponse.java index 913a1e2c3..a21e85cb1 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponse.java @@ -10,612 +10,643 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.ApiAppResponseOAuth; +import com.dropbox.sign.model.ApiAppResponseOptions; +import com.dropbox.sign.model.ApiAppResponseOwnerAccount; +import com.dropbox.sign.model.ApiAppResponseWhiteLabelingOptions; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** Contains information about an API App. */ +import com.dropbox.sign.ApiException; +/** + * Contains information about an API App. + */ @JsonPropertyOrder({ - ApiAppResponse.JSON_PROPERTY_CALLBACK_URL, - ApiAppResponse.JSON_PROPERTY_CLIENT_ID, - ApiAppResponse.JSON_PROPERTY_CREATED_AT, - ApiAppResponse.JSON_PROPERTY_DOMAINS, - ApiAppResponse.JSON_PROPERTY_NAME, - ApiAppResponse.JSON_PROPERTY_IS_APPROVED, - ApiAppResponse.JSON_PROPERTY_OAUTH, - ApiAppResponse.JSON_PROPERTY_OPTIONS, - ApiAppResponse.JSON_PROPERTY_OWNER_ACCOUNT, - ApiAppResponse.JSON_PROPERTY_WHITE_LABELING_OPTIONS + ApiAppResponse.JSON_PROPERTY_CALLBACK_URL, + ApiAppResponse.JSON_PROPERTY_CLIENT_ID, + ApiAppResponse.JSON_PROPERTY_CREATED_AT, + ApiAppResponse.JSON_PROPERTY_DOMAINS, + ApiAppResponse.JSON_PROPERTY_NAME, + ApiAppResponse.JSON_PROPERTY_IS_APPROVED, + ApiAppResponse.JSON_PROPERTY_OAUTH, + ApiAppResponse.JSON_PROPERTY_OPTIONS, + ApiAppResponse.JSON_PROPERTY_OWNER_ACCOUNT, + ApiAppResponse.JSON_PROPERTY_WHITE_LABELING_OPTIONS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ApiAppResponse { - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - @javax.annotation.Nullable private String callbackUrl; - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nullable private String clientId; - - public static final String JSON_PROPERTY_CREATED_AT = "created_at"; - @javax.annotation.Nullable private Integer createdAt; - - public static final String JSON_PROPERTY_DOMAINS = "domains"; - @javax.annotation.Nullable private List domains = null; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_IS_APPROVED = "is_approved"; - @javax.annotation.Nullable private Boolean isApproved; - - public static final String JSON_PROPERTY_OAUTH = "oauth"; - @javax.annotation.Nullable private ApiAppResponseOAuth oauth; - - public static final String JSON_PROPERTY_OPTIONS = "options"; - @javax.annotation.Nullable private ApiAppResponseOptions options; + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + @javax.annotation.Nullable + private String callbackUrl; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @javax.annotation.Nullable + private Integer createdAt; + + public static final String JSON_PROPERTY_DOMAINS = "domains"; + @javax.annotation.Nullable + private List domains = null; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_IS_APPROVED = "is_approved"; + @javax.annotation.Nullable + private Boolean isApproved; + + public static final String JSON_PROPERTY_OAUTH = "oauth"; + @javax.annotation.Nullable + private ApiAppResponseOAuth oauth; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + @javax.annotation.Nullable + private ApiAppResponseOptions options; + + public static final String JSON_PROPERTY_OWNER_ACCOUNT = "owner_account"; + @javax.annotation.Nullable + private ApiAppResponseOwnerAccount ownerAccount; + + public static final String JSON_PROPERTY_WHITE_LABELING_OPTIONS = "white_labeling_options"; + @javax.annotation.Nullable + private ApiAppResponseWhiteLabelingOptions whiteLabelingOptions; + + public ApiAppResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ApiAppResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppResponse.class); + } + + static public ApiAppResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ApiAppResponse.class + ); + } + + public ApiAppResponse callbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; + } + + /** + * The app's callback URL (for events) + * @return callbackUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCallbackUrl() { + return callbackUrl; + } + + + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + } + + + public ApiAppResponse clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The app's client id + * @return clientId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public ApiAppResponse createdAt(@javax.annotation.Nullable Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The time that the app was created + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@javax.annotation.Nullable Integer createdAt) { + this.createdAt = createdAt; + } + + + public ApiAppResponse domains(@javax.annotation.Nullable List domains) { + this.domains = domains; + return this; + } + + public ApiAppResponse addDomainsItem(String domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); + } + this.domains.add(domainsItem); + return this; + } + + /** + * The domain name(s) associated with the app + * @return domains + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDomains() { + return domains; + } + + + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDomains(@javax.annotation.Nullable List domains) { + this.domains = domains; + } + + + public ApiAppResponse name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } - public static final String JSON_PROPERTY_OWNER_ACCOUNT = "owner_account"; - @javax.annotation.Nullable private ApiAppResponseOwnerAccount ownerAccount; - - public static final String JSON_PROPERTY_WHITE_LABELING_OPTIONS = "white_labeling_options"; - @javax.annotation.Nullable private ApiAppResponseWhiteLabelingOptions whiteLabelingOptions; - - public ApiAppResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ApiAppResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppResponse.class); - } - - public static ApiAppResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), ApiAppResponse.class); - } - - public ApiAppResponse callbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } + /** + * The name of the app + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ApiAppResponse isApproved(@javax.annotation.Nullable Boolean isApproved) { + this.isApproved = isApproved; + return this; + } - /** - * The app's callback URL (for events) - * - * @return callbackUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCallbackUrl() { - return callbackUrl; - } - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - public ApiAppResponse clientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - return this; - } - - /** - * The app's client id - * - * @return clientId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - } - - public ApiAppResponse createdAt(@javax.annotation.Nullable Integer createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * The time that the app was created - * - * @return createdAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getCreatedAt() { - return createdAt; - } - - @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCreatedAt(@javax.annotation.Nullable Integer createdAt) { - this.createdAt = createdAt; - } - - public ApiAppResponse domains(@javax.annotation.Nullable List domains) { - this.domains = domains; - return this; - } - - public ApiAppResponse addDomainsItem(String domainsItem) { - if (this.domains == null) { - this.domains = new ArrayList<>(); + /** + * Boolean to indicate if the app has been approved + * @return isApproved + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_APPROVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsApproved() { + return isApproved; + } + + + @JsonProperty(JSON_PROPERTY_IS_APPROVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsApproved(@javax.annotation.Nullable Boolean isApproved) { + this.isApproved = isApproved; + } + + + public ApiAppResponse oauth(@javax.annotation.Nullable ApiAppResponseOAuth oauth) { + this.oauth = oauth; + return this; + } + + /** + * Get oauth + * @return oauth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OAUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ApiAppResponseOAuth getOauth() { + return oauth; + } + + + @JsonProperty(JSON_PROPERTY_OAUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOauth(@javax.annotation.Nullable ApiAppResponseOAuth oauth) { + this.oauth = oauth; + } + + + public ApiAppResponse options(@javax.annotation.Nullable ApiAppResponseOptions options) { + this.options = options; + return this; + } + + /** + * Get options + * @return options + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ApiAppResponseOptions getOptions() { + return options; + } + + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOptions(@javax.annotation.Nullable ApiAppResponseOptions options) { + this.options = options; + } + + + public ApiAppResponse ownerAccount(@javax.annotation.Nullable ApiAppResponseOwnerAccount ownerAccount) { + this.ownerAccount = ownerAccount; + return this; + } + + /** + * Get ownerAccount + * @return ownerAccount + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OWNER_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ApiAppResponseOwnerAccount getOwnerAccount() { + return ownerAccount; + } + + + @JsonProperty(JSON_PROPERTY_OWNER_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerAccount(@javax.annotation.Nullable ApiAppResponseOwnerAccount ownerAccount) { + this.ownerAccount = ownerAccount; + } + + + public ApiAppResponse whiteLabelingOptions(@javax.annotation.Nullable ApiAppResponseWhiteLabelingOptions whiteLabelingOptions) { + this.whiteLabelingOptions = whiteLabelingOptions; + return this; + } + + /** + * Get whiteLabelingOptions + * @return whiteLabelingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ApiAppResponseWhiteLabelingOptions getWhiteLabelingOptions() { + return whiteLabelingOptions; + } + + + @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhiteLabelingOptions(@javax.annotation.Nullable ApiAppResponseWhiteLabelingOptions whiteLabelingOptions) { + this.whiteLabelingOptions = whiteLabelingOptions; + } + + + /** + * Return true if this ApiAppResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiAppResponse apiAppResponse = (ApiAppResponse) o; + return Objects.equals(this.callbackUrl, apiAppResponse.callbackUrl) && + Objects.equals(this.clientId, apiAppResponse.clientId) && + Objects.equals(this.createdAt, apiAppResponse.createdAt) && + Objects.equals(this.domains, apiAppResponse.domains) && + Objects.equals(this.name, apiAppResponse.name) && + Objects.equals(this.isApproved, apiAppResponse.isApproved) && + Objects.equals(this.oauth, apiAppResponse.oauth) && + Objects.equals(this.options, apiAppResponse.options) && + Objects.equals(this.ownerAccount, apiAppResponse.ownerAccount) && + Objects.equals(this.whiteLabelingOptions, apiAppResponse.whiteLabelingOptions); + } + + @Override + public int hashCode() { + return Objects.hash(callbackUrl, clientId, createdAt, domains, name, isApproved, oauth, options, ownerAccount, whiteLabelingOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppResponse {\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" isApproved: ").append(toIndentedString(isApproved)).append("\n"); + sb.append(" oauth: ").append(toIndentedString(oauth)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" ownerAccount: ").append(toIndentedString(ownerAccount)).append("\n"); + sb.append(" whiteLabelingOptions: ").append(toIndentedString(whiteLabelingOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; } - this.domains.add(domainsItem); - return this; - } - - /** - * The domain name(s) associated with the app - * - * @return domains - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOMAINS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getDomains() { - return domains; - } - - @JsonProperty(JSON_PROPERTY_DOMAINS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDomains(@javax.annotation.Nullable List domains) { - this.domains = domains; - } - - public ApiAppResponse name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of the app - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public ApiAppResponse isApproved(@javax.annotation.Nullable Boolean isApproved) { - this.isApproved = isApproved; - return this; - } - - /** - * Boolean to indicate if the app has been approved - * - * @return isApproved - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_APPROVED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsApproved() { - return isApproved; - } - @JsonProperty(JSON_PROPERTY_IS_APPROVED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsApproved(@javax.annotation.Nullable Boolean isApproved) { - this.isApproved = isApproved; - } - - public ApiAppResponse oauth(@javax.annotation.Nullable ApiAppResponseOAuth oauth) { - this.oauth = oauth; - return this; - } - - /** - * Get oauth - * - * @return oauth - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OAUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ApiAppResponseOAuth getOauth() { - return oauth; - } - - @JsonProperty(JSON_PROPERTY_OAUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOauth(@javax.annotation.Nullable ApiAppResponseOAuth oauth) { - this.oauth = oauth; - } - - public ApiAppResponse options(@javax.annotation.Nullable ApiAppResponseOptions options) { - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ApiAppResponseOptions getOptions() { - return options; + if (callbackUrl.getClass().equals(java.io.File.class) || + callbackUrl.getClass().equals(Integer.class) || + callbackUrl.getClass().equals(String.class) || + callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for(int i = 0; i< getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } + else { + map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOptions(@javax.annotation.Nullable ApiAppResponseOptions options) { - this.options = options; + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } } + if (createdAt != null) { + if (isFileTypeOrListOfFiles(createdAt)) { + fileTypeFound = true; + } - public ApiAppResponse ownerAccount( - @javax.annotation.Nullable ApiAppResponseOwnerAccount ownerAccount) { - this.ownerAccount = ownerAccount; - return this; + if (createdAt.getClass().equals(java.io.File.class) || + createdAt.getClass().equals(Integer.class) || + createdAt.getClass().equals(String.class) || + createdAt.getClass().isEnum()) { + map.put("created_at", createdAt); + } else if (isListOfFile(createdAt)) { + for(int i = 0; i< getListSize(createdAt); i++) { + map.put("created_at[" + i + "]", getFromList(createdAt, i)); + } + } + else { + map.put("created_at", JSON.getDefault().getMapper().writeValueAsString(createdAt)); + } } + if (domains != null) { + if (isFileTypeOrListOfFiles(domains)) { + fileTypeFound = true; + } - /** - * Get ownerAccount - * - * @return ownerAccount - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OWNER_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ApiAppResponseOwnerAccount getOwnerAccount() { - return ownerAccount; + if (domains.getClass().equals(java.io.File.class) || + domains.getClass().equals(Integer.class) || + domains.getClass().equals(String.class) || + domains.getClass().isEnum()) { + map.put("domains", domains); + } else if (isListOfFile(domains)) { + for(int i = 0; i< getListSize(domains); i++) { + map.put("domains[" + i + "]", getFromList(domains, i)); + } + } + else { + map.put("domains", JSON.getDefault().getMapper().writeValueAsString(domains)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_OWNER_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOwnerAccount( - @javax.annotation.Nullable ApiAppResponseOwnerAccount ownerAccount) { - this.ownerAccount = ownerAccount; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (isApproved != null) { + if (isFileTypeOrListOfFiles(isApproved)) { + fileTypeFound = true; + } - public ApiAppResponse whiteLabelingOptions( - @javax.annotation.Nullable ApiAppResponseWhiteLabelingOptions whiteLabelingOptions) { - this.whiteLabelingOptions = whiteLabelingOptions; - return this; + if (isApproved.getClass().equals(java.io.File.class) || + isApproved.getClass().equals(Integer.class) || + isApproved.getClass().equals(String.class) || + isApproved.getClass().isEnum()) { + map.put("is_approved", isApproved); + } else if (isListOfFile(isApproved)) { + for(int i = 0; i< getListSize(isApproved); i++) { + map.put("is_approved[" + i + "]", getFromList(isApproved, i)); + } + } + else { + map.put("is_approved", JSON.getDefault().getMapper().writeValueAsString(isApproved)); + } } + if (oauth != null) { + if (isFileTypeOrListOfFiles(oauth)) { + fileTypeFound = true; + } - /** - * Get whiteLabelingOptions - * - * @return whiteLabelingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ApiAppResponseWhiteLabelingOptions getWhiteLabelingOptions() { - return whiteLabelingOptions; + if (oauth.getClass().equals(java.io.File.class) || + oauth.getClass().equals(Integer.class) || + oauth.getClass().equals(String.class) || + oauth.getClass().isEnum()) { + map.put("oauth", oauth); + } else if (isListOfFile(oauth)) { + for(int i = 0; i< getListSize(oauth); i++) { + map.put("oauth[" + i + "]", getFromList(oauth, i)); + } + } + else { + map.put("oauth", JSON.getDefault().getMapper().writeValueAsString(oauth)); + } } + if (options != null) { + if (isFileTypeOrListOfFiles(options)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWhiteLabelingOptions( - @javax.annotation.Nullable ApiAppResponseWhiteLabelingOptions whiteLabelingOptions) { - this.whiteLabelingOptions = whiteLabelingOptions; + if (options.getClass().equals(java.io.File.class) || + options.getClass().equals(Integer.class) || + options.getClass().equals(String.class) || + options.getClass().isEnum()) { + map.put("options", options); + } else if (isListOfFile(options)) { + for(int i = 0; i< getListSize(options); i++) { + map.put("options[" + i + "]", getFromList(options, i)); + } + } + else { + map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); + } } + if (ownerAccount != null) { + if (isFileTypeOrListOfFiles(ownerAccount)) { + fileTypeFound = true; + } - /** Return true if this ApiAppResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (ownerAccount.getClass().equals(java.io.File.class) || + ownerAccount.getClass().equals(Integer.class) || + ownerAccount.getClass().equals(String.class) || + ownerAccount.getClass().isEnum()) { + map.put("owner_account", ownerAccount); + } else if (isListOfFile(ownerAccount)) { + for(int i = 0; i< getListSize(ownerAccount); i++) { + map.put("owner_account[" + i + "]", getFromList(ownerAccount, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("owner_account", JSON.getDefault().getMapper().writeValueAsString(ownerAccount)); } - ApiAppResponse apiAppResponse = (ApiAppResponse) o; - return Objects.equals(this.callbackUrl, apiAppResponse.callbackUrl) - && Objects.equals(this.clientId, apiAppResponse.clientId) - && Objects.equals(this.createdAt, apiAppResponse.createdAt) - && Objects.equals(this.domains, apiAppResponse.domains) - && Objects.equals(this.name, apiAppResponse.name) - && Objects.equals(this.isApproved, apiAppResponse.isApproved) - && Objects.equals(this.oauth, apiAppResponse.oauth) - && Objects.equals(this.options, apiAppResponse.options) - && Objects.equals(this.ownerAccount, apiAppResponse.ownerAccount) - && Objects.equals(this.whiteLabelingOptions, apiAppResponse.whiteLabelingOptions); } + if (whiteLabelingOptions != null) { + if (isFileTypeOrListOfFiles(whiteLabelingOptions)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - callbackUrl, - clientId, - createdAt, - domains, - name, - isApproved, - oauth, - options, - ownerAccount, - whiteLabelingOptions); + if (whiteLabelingOptions.getClass().equals(java.io.File.class) || + whiteLabelingOptions.getClass().equals(Integer.class) || + whiteLabelingOptions.getClass().equals(String.class) || + whiteLabelingOptions.getClass().isEnum()) { + map.put("white_labeling_options", whiteLabelingOptions); + } else if (isListOfFile(whiteLabelingOptions)) { + for(int i = 0; i< getListSize(whiteLabelingOptions); i++) { + map.put("white_labeling_options[" + i + "]", getFromList(whiteLabelingOptions, i)); + } + } + else { + map.put("white_labeling_options", JSON.getDefault().getMapper().writeValueAsString(whiteLabelingOptions)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppResponse {\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" isApproved: ").append(toIndentedString(isApproved)).append("\n"); - sb.append(" oauth: ").append(toIndentedString(oauth)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" ownerAccount: ").append(toIndentedString(ownerAccount)).append("\n"); - sb.append(" whiteLabelingOptions: ") - .append(toIndentedString(whiteLabelingOptions)) - .append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } - - if (callbackUrl.getClass().equals(java.io.File.class) - || callbackUrl.getClass().equals(Integer.class) - || callbackUrl.getClass().equals(String.class) - || callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for (int i = 0; i < getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } else { - map.put( - "callback_url", - JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (createdAt != null) { - if (isFileTypeOrListOfFiles(createdAt)) { - fileTypeFound = true; - } - - if (createdAt.getClass().equals(java.io.File.class) - || createdAt.getClass().equals(Integer.class) - || createdAt.getClass().equals(String.class) - || createdAt.getClass().isEnum()) { - map.put("created_at", createdAt); - } else if (isListOfFile(createdAt)) { - for (int i = 0; i < getListSize(createdAt); i++) { - map.put("created_at[" + i + "]", getFromList(createdAt, i)); - } - } else { - map.put( - "created_at", - JSON.getDefault().getMapper().writeValueAsString(createdAt)); - } - } - if (domains != null) { - if (isFileTypeOrListOfFiles(domains)) { - fileTypeFound = true; - } - - if (domains.getClass().equals(java.io.File.class) - || domains.getClass().equals(Integer.class) - || domains.getClass().equals(String.class) - || domains.getClass().isEnum()) { - map.put("domains", domains); - } else if (isListOfFile(domains)) { - for (int i = 0; i < getListSize(domains); i++) { - map.put("domains[" + i + "]", getFromList(domains, i)); - } - } else { - map.put("domains", JSON.getDefault().getMapper().writeValueAsString(domains)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (isApproved != null) { - if (isFileTypeOrListOfFiles(isApproved)) { - fileTypeFound = true; - } - - if (isApproved.getClass().equals(java.io.File.class) - || isApproved.getClass().equals(Integer.class) - || isApproved.getClass().equals(String.class) - || isApproved.getClass().isEnum()) { - map.put("is_approved", isApproved); - } else if (isListOfFile(isApproved)) { - for (int i = 0; i < getListSize(isApproved); i++) { - map.put("is_approved[" + i + "]", getFromList(isApproved, i)); - } - } else { - map.put( - "is_approved", - JSON.getDefault().getMapper().writeValueAsString(isApproved)); - } - } - if (oauth != null) { - if (isFileTypeOrListOfFiles(oauth)) { - fileTypeFound = true; - } - - if (oauth.getClass().equals(java.io.File.class) - || oauth.getClass().equals(Integer.class) - || oauth.getClass().equals(String.class) - || oauth.getClass().isEnum()) { - map.put("oauth", oauth); - } else if (isListOfFile(oauth)) { - for (int i = 0; i < getListSize(oauth); i++) { - map.put("oauth[" + i + "]", getFromList(oauth, i)); - } - } else { - map.put("oauth", JSON.getDefault().getMapper().writeValueAsString(oauth)); - } - } - if (options != null) { - if (isFileTypeOrListOfFiles(options)) { - fileTypeFound = true; - } - - if (options.getClass().equals(java.io.File.class) - || options.getClass().equals(Integer.class) - || options.getClass().equals(String.class) - || options.getClass().isEnum()) { - map.put("options", options); - } else if (isListOfFile(options)) { - for (int i = 0; i < getListSize(options); i++) { - map.put("options[" + i + "]", getFromList(options, i)); - } - } else { - map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); - } - } - if (ownerAccount != null) { - if (isFileTypeOrListOfFiles(ownerAccount)) { - fileTypeFound = true; - } - - if (ownerAccount.getClass().equals(java.io.File.class) - || ownerAccount.getClass().equals(Integer.class) - || ownerAccount.getClass().equals(String.class) - || ownerAccount.getClass().isEnum()) { - map.put("owner_account", ownerAccount); - } else if (isListOfFile(ownerAccount)) { - for (int i = 0; i < getListSize(ownerAccount); i++) { - map.put("owner_account[" + i + "]", getFromList(ownerAccount, i)); - } - } else { - map.put( - "owner_account", - JSON.getDefault().getMapper().writeValueAsString(ownerAccount)); - } - } - if (whiteLabelingOptions != null) { - if (isFileTypeOrListOfFiles(whiteLabelingOptions)) { - fileTypeFound = true; - } - - if (whiteLabelingOptions.getClass().equals(java.io.File.class) - || whiteLabelingOptions.getClass().equals(Integer.class) - || whiteLabelingOptions.getClass().equals(String.class) - || whiteLabelingOptions.getClass().isEnum()) { - map.put("white_labeling_options", whiteLabelingOptions); - } else if (isListOfFile(whiteLabelingOptions)) { - for (int i = 0; i < getListSize(whiteLabelingOptions); i++) { - map.put( - "white_labeling_options[" + i + "]", - getFromList(whiteLabelingOptions, i)); - } - } else { - map.put( - "white_labeling_options", - JSON.getDefault().getMapper().writeValueAsString(whiteLabelingOptions)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java index daf3f0826..51e8ef28f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java @@ -10,314 +10,333 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + +import com.dropbox.sign.ApiException; /** - * An object describing the app's OAuth properties, or null if OAuth is not configured for the - * app. + * An object describing the app's OAuth properties, or null if OAuth is not configured for the app. */ @JsonPropertyOrder({ - ApiAppResponseOAuth.JSON_PROPERTY_CALLBACK_URL, - ApiAppResponseOAuth.JSON_PROPERTY_SECRET, - ApiAppResponseOAuth.JSON_PROPERTY_SCOPES, - ApiAppResponseOAuth.JSON_PROPERTY_CHARGES_USERS + ApiAppResponseOAuth.JSON_PROPERTY_CALLBACK_URL, + ApiAppResponseOAuth.JSON_PROPERTY_SECRET, + ApiAppResponseOAuth.JSON_PROPERTY_SCOPES, + ApiAppResponseOAuth.JSON_PROPERTY_CHARGES_USERS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ApiAppResponseOAuth { - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - @javax.annotation.Nullable private String callbackUrl; - - public static final String JSON_PROPERTY_SECRET = "secret"; - @javax.annotation.Nullable private String secret; - - public static final String JSON_PROPERTY_SCOPES = "scopes"; - @javax.annotation.Nullable private List scopes = null; - - public static final String JSON_PROPERTY_CHARGES_USERS = "charges_users"; - @javax.annotation.Nullable private Boolean chargesUsers; - - public ApiAppResponseOAuth() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ApiAppResponseOAuth init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppResponseOAuth.class); - } - - public static ApiAppResponseOAuth init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), ApiAppResponseOAuth.class); - } - - public ApiAppResponseOAuth callbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + @javax.annotation.Nullable + private String callbackUrl; + + public static final String JSON_PROPERTY_SECRET = "secret"; + @javax.annotation.Nullable + private String secret; + + public static final String JSON_PROPERTY_SCOPES = "scopes"; + @javax.annotation.Nullable + private List scopes = null; + + public static final String JSON_PROPERTY_CHARGES_USERS = "charges_users"; + @javax.annotation.Nullable + private Boolean chargesUsers; + + public ApiAppResponseOAuth() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ApiAppResponseOAuth init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppResponseOAuth.class); + } + + static public ApiAppResponseOAuth init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ApiAppResponseOAuth.class + ); + } + + public ApiAppResponseOAuth callbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; + } + + /** + * The app's OAuth callback URL. + * @return callbackUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCallbackUrl() { + return callbackUrl; + } + + + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + } + + + public ApiAppResponseOAuth secret(@javax.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * The app's OAuth secret, or null if the app does not belong to user. + * @return secret + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSecret() { + return secret; + } + + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(@javax.annotation.Nullable String secret) { + this.secret = secret; + } + + + public ApiAppResponseOAuth scopes(@javax.annotation.Nullable List scopes) { + this.scopes = scopes; + return this; + } + + public ApiAppResponseOAuth addScopesItem(String scopesItem) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(); } - - /** - * The app's OAuth callback URL. - * - * @return callbackUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCallbackUrl() { - return callbackUrl; - } - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - public ApiAppResponseOAuth secret(@javax.annotation.Nullable String secret) { - this.secret = secret; - return this; - } - - /** - * The app's OAuth secret, or null if the app does not belong to user. - * - * @return secret - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECRET) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSecret() { - return secret; - } - - @JsonProperty(JSON_PROPERTY_SECRET) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecret(@javax.annotation.Nullable String secret) { - this.secret = secret; + this.scopes.add(scopesItem); + return this; + } + + /** + * Array of OAuth scopes used by the app. + * @return scopes + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getScopes() { + return scopes; + } + + + @JsonProperty(JSON_PROPERTY_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScopes(@javax.annotation.Nullable List scopes) { + this.scopes = scopes; + } + + + public ApiAppResponseOAuth chargesUsers(@javax.annotation.Nullable Boolean chargesUsers) { + this.chargesUsers = chargesUsers; + return this; + } + + /** + * Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. + * @return chargesUsers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHARGES_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getChargesUsers() { + return chargesUsers; + } + + + @JsonProperty(JSON_PROPERTY_CHARGES_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChargesUsers(@javax.annotation.Nullable Boolean chargesUsers) { + this.chargesUsers = chargesUsers; + } + + + /** + * Return true if this ApiAppResponseOAuth object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public ApiAppResponseOAuth scopes(@javax.annotation.Nullable List scopes) { - this.scopes = scopes; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - public ApiAppResponseOAuth addScopesItem(String scopesItem) { - if (this.scopes == null) { - this.scopes = new ArrayList<>(); + ApiAppResponseOAuth apiAppResponseOAuth = (ApiAppResponseOAuth) o; + return Objects.equals(this.callbackUrl, apiAppResponseOAuth.callbackUrl) && + Objects.equals(this.secret, apiAppResponseOAuth.secret) && + Objects.equals(this.scopes, apiAppResponseOAuth.scopes) && + Objects.equals(this.chargesUsers, apiAppResponseOAuth.chargesUsers); + } + + @Override + public int hashCode() { + return Objects.hash(callbackUrl, secret, scopes, chargesUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppResponseOAuth {\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); + sb.append(" chargesUsers: ").append(toIndentedString(chargesUsers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; } - this.scopes.add(scopesItem); - return this; - } - - /** - * Array of OAuth scopes used by the app. - * - * @return scopes - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SCOPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getScopes() { - return scopes; - } - - @JsonProperty(JSON_PROPERTY_SCOPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setScopes(@javax.annotation.Nullable List scopes) { - this.scopes = scopes; - } - - public ApiAppResponseOAuth chargesUsers(@javax.annotation.Nullable Boolean chargesUsers) { - this.chargesUsers = chargesUsers; - return this; - } - /** - * Boolean indicating whether the app owner or the account granting permission is billed for - * OAuth requests. - * - * @return chargesUsers - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CHARGES_USERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getChargesUsers() { - return chargesUsers; + if (callbackUrl.getClass().equals(java.io.File.class) || + callbackUrl.getClass().equals(Integer.class) || + callbackUrl.getClass().equals(String.class) || + callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for(int i = 0; i< getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } + else { + map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } } + if (secret != null) { + if (isFileTypeOrListOfFiles(secret)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_CHARGES_USERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setChargesUsers(@javax.annotation.Nullable Boolean chargesUsers) { - this.chargesUsers = chargesUsers; + if (secret.getClass().equals(java.io.File.class) || + secret.getClass().equals(Integer.class) || + secret.getClass().equals(String.class) || + secret.getClass().isEnum()) { + map.put("secret", secret); + } else if (isListOfFile(secret)) { + for(int i = 0; i< getListSize(secret); i++) { + map.put("secret[" + i + "]", getFromList(secret, i)); + } + } + else { + map.put("secret", JSON.getDefault().getMapper().writeValueAsString(secret)); + } } + if (scopes != null) { + if (isFileTypeOrListOfFiles(scopes)) { + fileTypeFound = true; + } - /** Return true if this ApiAppResponseOAuth object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (scopes.getClass().equals(java.io.File.class) || + scopes.getClass().equals(Integer.class) || + scopes.getClass().equals(String.class) || + scopes.getClass().isEnum()) { + map.put("scopes", scopes); + } else if (isListOfFile(scopes)) { + for(int i = 0; i< getListSize(scopes); i++) { + map.put("scopes[" + i + "]", getFromList(scopes, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("scopes", JSON.getDefault().getMapper().writeValueAsString(scopes)); } - ApiAppResponseOAuth apiAppResponseOAuth = (ApiAppResponseOAuth) o; - return Objects.equals(this.callbackUrl, apiAppResponseOAuth.callbackUrl) - && Objects.equals(this.secret, apiAppResponseOAuth.secret) - && Objects.equals(this.scopes, apiAppResponseOAuth.scopes) - && Objects.equals(this.chargesUsers, apiAppResponseOAuth.chargesUsers); } + if (chargesUsers != null) { + if (isFileTypeOrListOfFiles(chargesUsers)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(callbackUrl, secret, scopes, chargesUsers); + if (chargesUsers.getClass().equals(java.io.File.class) || + chargesUsers.getClass().equals(Integer.class) || + chargesUsers.getClass().equals(String.class) || + chargesUsers.getClass().isEnum()) { + map.put("charges_users", chargesUsers); + } else if (isListOfFile(chargesUsers)) { + for(int i = 0; i< getListSize(chargesUsers); i++) { + map.put("charges_users[" + i + "]", getFromList(chargesUsers, i)); + } + } + else { + map.put("charges_users", JSON.getDefault().getMapper().writeValueAsString(chargesUsers)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppResponseOAuth {\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); - sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); - sb.append(" chargesUsers: ").append(toIndentedString(chargesUsers)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } - - if (callbackUrl.getClass().equals(java.io.File.class) - || callbackUrl.getClass().equals(Integer.class) - || callbackUrl.getClass().equals(String.class) - || callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for (int i = 0; i < getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } else { - map.put( - "callback_url", - JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); - } - } - if (secret != null) { - if (isFileTypeOrListOfFiles(secret)) { - fileTypeFound = true; - } - - if (secret.getClass().equals(java.io.File.class) - || secret.getClass().equals(Integer.class) - || secret.getClass().equals(String.class) - || secret.getClass().isEnum()) { - map.put("secret", secret); - } else if (isListOfFile(secret)) { - for (int i = 0; i < getListSize(secret); i++) { - map.put("secret[" + i + "]", getFromList(secret, i)); - } - } else { - map.put("secret", JSON.getDefault().getMapper().writeValueAsString(secret)); - } - } - if (scopes != null) { - if (isFileTypeOrListOfFiles(scopes)) { - fileTypeFound = true; - } - - if (scopes.getClass().equals(java.io.File.class) - || scopes.getClass().equals(Integer.class) - || scopes.getClass().equals(String.class) - || scopes.getClass().isEnum()) { - map.put("scopes", scopes); - } else if (isListOfFile(scopes)) { - for (int i = 0; i < getListSize(scopes); i++) { - map.put("scopes[" + i + "]", getFromList(scopes, i)); - } - } else { - map.put("scopes", JSON.getDefault().getMapper().writeValueAsString(scopes)); - } - } - if (chargesUsers != null) { - if (isFileTypeOrListOfFiles(chargesUsers)) { - fileTypeFound = true; - } - - if (chargesUsers.getClass().equals(java.io.File.class) - || chargesUsers.getClass().equals(Integer.class) - || chargesUsers.getClass().equals(String.class) - || chargesUsers.getClass().isEnum()) { - map.put("charges_users", chargesUsers); - } else if (isListOfFile(chargesUsers)) { - for (int i = 0; i < getListSize(chargesUsers); i++) { - map.put("charges_users[" + i + "]", getFromList(chargesUsers, i)); - } - } else { - map.put( - "charges_users", - JSON.getDefault().getMapper().writeValueAsString(chargesUsers)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java index ace145fa9..debc94dd6 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java @@ -10,165 +10,170 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** An object with options that override account settings. */ -@JsonPropertyOrder({ApiAppResponseOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class ApiAppResponseOptions { - public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; - @javax.annotation.Nullable private Boolean canInsertEverywhere; - - public ApiAppResponseOptions() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ApiAppResponseOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppResponseOptions.class); - } - public static ApiAppResponseOptions init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), ApiAppResponseOptions.class); - } - - public ApiAppResponseOptions canInsertEverywhere( - @javax.annotation.Nullable Boolean canInsertEverywhere) { - this.canInsertEverywhere = canInsertEverywhere; - return this; - } - - /** - * Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a - * document - * - * @return canInsertEverywhere - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getCanInsertEverywhere() { - return canInsertEverywhere; +import com.dropbox.sign.ApiException; +/** + * An object with options that override account settings. + */ +@JsonPropertyOrder({ + ApiAppResponseOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class ApiAppResponseOptions { + public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; + @javax.annotation.Nullable + private Boolean canInsertEverywhere; + + public ApiAppResponseOptions() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ApiAppResponseOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppResponseOptions.class); + } + + static public ApiAppResponseOptions init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ApiAppResponseOptions.class + ); + } + + public ApiAppResponseOptions canInsertEverywhere(@javax.annotation.Nullable Boolean canInsertEverywhere) { + this.canInsertEverywhere = canInsertEverywhere; + return this; + } + + /** + * Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document + * @return canInsertEverywhere + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getCanInsertEverywhere() { + return canInsertEverywhere; + } + + + @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanInsertEverywhere(@javax.annotation.Nullable Boolean canInsertEverywhere) { + this.canInsertEverywhere = canInsertEverywhere; + } + + + /** + * Return true if this ApiAppResponseOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCanInsertEverywhere(@javax.annotation.Nullable Boolean canInsertEverywhere) { - this.canInsertEverywhere = canInsertEverywhere; + if (o == null || getClass() != o.getClass()) { + return false; } + ApiAppResponseOptions apiAppResponseOptions = (ApiAppResponseOptions) o; + return Objects.equals(this.canInsertEverywhere, apiAppResponseOptions.canInsertEverywhere); + } + + @Override + public int hashCode() { + return Objects.hash(canInsertEverywhere); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppResponseOptions {\n"); + sb.append(" canInsertEverywhere: ").append(toIndentedString(canInsertEverywhere)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (canInsertEverywhere != null) { + if (isFileTypeOrListOfFiles(canInsertEverywhere)) { + fileTypeFound = true; + } - /** Return true if this ApiAppResponseOptions object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (canInsertEverywhere.getClass().equals(java.io.File.class) || + canInsertEverywhere.getClass().equals(Integer.class) || + canInsertEverywhere.getClass().equals(String.class) || + canInsertEverywhere.getClass().isEnum()) { + map.put("can_insert_everywhere", canInsertEverywhere); + } else if (isListOfFile(canInsertEverywhere)) { + for(int i = 0; i< getListSize(canInsertEverywhere); i++) { + map.put("can_insert_everywhere[" + i + "]", getFromList(canInsertEverywhere, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("can_insert_everywhere", JSON.getDefault().getMapper().writeValueAsString(canInsertEverywhere)); } - ApiAppResponseOptions apiAppResponseOptions = (ApiAppResponseOptions) o; - return Objects.equals(this.canInsertEverywhere, apiAppResponseOptions.canInsertEverywhere); } - - @Override - public int hashCode() { - return Objects.hash(canInsertEverywhere); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppResponseOptions {\n"); - sb.append(" canInsertEverywhere: ") - .append(toIndentedString(canInsertEverywhere)) - .append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (canInsertEverywhere != null) { - if (isFileTypeOrListOfFiles(canInsertEverywhere)) { - fileTypeFound = true; - } - - if (canInsertEverywhere.getClass().equals(java.io.File.class) - || canInsertEverywhere.getClass().equals(Integer.class) - || canInsertEverywhere.getClass().equals(String.class) - || canInsertEverywhere.getClass().isEnum()) { - map.put("can_insert_everywhere", canInsertEverywhere); - } else if (isListOfFile(canInsertEverywhere)) { - for (int i = 0; i < getListSize(canInsertEverywhere); i++) { - map.put( - "can_insert_everywhere[" + i + "]", - getFromList(canInsertEverywhere, i)); - } - } else { - map.put( - "can_insert_everywhere", - JSON.getDefault().getMapper().writeValueAsString(canInsertEverywhere)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java index de840b202..e2b8e6796 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java @@ -10,210 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** An object describing the app's owner */ + +import com.dropbox.sign.ApiException; +/** + * An object describing the app's owner + */ @JsonPropertyOrder({ - ApiAppResponseOwnerAccount.JSON_PROPERTY_ACCOUNT_ID, - ApiAppResponseOwnerAccount.JSON_PROPERTY_EMAIL_ADDRESS + ApiAppResponseOwnerAccount.JSON_PROPERTY_ACCOUNT_ID, + ApiAppResponseOwnerAccount.JSON_PROPERTY_EMAIL_ADDRESS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ApiAppResponseOwnerAccount { - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - @javax.annotation.Nullable private String accountId; - - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; - - public ApiAppResponseOwnerAccount() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ApiAppResponseOwnerAccount init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppResponseOwnerAccount.class); - } - - public static ApiAppResponseOwnerAccount init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - ApiAppResponseOwnerAccount.class); - } - - public ApiAppResponseOwnerAccount accountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; - } - - /** - * The owner account's ID - * - * @return accountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccountId() { - return accountId; - } - - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - } - - public ApiAppResponseOwnerAccount emailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The owner account's email address - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; - } + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + @javax.annotation.Nullable + private String accountId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; + + public ApiAppResponseOwnerAccount() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ApiAppResponseOwnerAccount init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppResponseOwnerAccount.class); + } + + static public ApiAppResponseOwnerAccount init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ApiAppResponseOwnerAccount.class + ); + } + + public ApiAppResponseOwnerAccount accountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The owner account's ID + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + } + + + public ApiAppResponseOwnerAccount emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The owner account's email address + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this ApiAppResponseOwnerAccount object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiAppResponseOwnerAccount apiAppResponseOwnerAccount = (ApiAppResponseOwnerAccount) o; + return Objects.equals(this.accountId, apiAppResponseOwnerAccount.accountId) && + Objects.equals(this.emailAddress, apiAppResponseOwnerAccount.emailAddress); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppResponseOwnerAccount {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - /** Return true if this ApiAppResponseOwnerAccount object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); } - ApiAppResponseOwnerAccount apiAppResponseOwnerAccount = (ApiAppResponseOwnerAccount) o; - return Objects.equals(this.accountId, apiAppResponseOwnerAccount.accountId) - && Objects.equals(this.emailAddress, apiAppResponseOwnerAccount.emailAddress); } - - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppResponseOwnerAccount {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } - - if (accountId.getClass().equals(java.io.File.class) - || accountId.getClass().equals(Integer.class) - || accountId.getClass().equals(String.class) - || accountId.getClass().isEnum()) { - map.put("account_id", accountId); - } else if (isListOfFile(accountId)) { - for (int i = 0; i < getListSize(accountId); i++) { - map.put("account_id[" + i + "]", getFromList(accountId, i)); - } - } else { - map.put( - "account_id", - JSON.getDefault().getMapper().writeValueAsString(accountId)); - } - } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java index ae9441e24..c18610570 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java @@ -10,902 +10,833 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** An object with options to customize the app's signer page */ + +import com.dropbox.sign.ApiException; +/** + * An object with options to customize the app's signer page + */ @JsonPropertyOrder({ - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_HEADER_BACKGROUND_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_LEGAL_VERSION, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_LINK_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PAGE_BACKGROUND_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR1, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR2 + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_HEADER_BACKGROUND_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_LEGAL_VERSION, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_LINK_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PAGE_BACKGROUND_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR1, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR2 }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ApiAppResponseWhiteLabelingOptions { - public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; - @javax.annotation.Nullable private String headerBackgroundColor; - - public static final String JSON_PROPERTY_LEGAL_VERSION = "legal_version"; - @javax.annotation.Nullable private String legalVersion; - - public static final String JSON_PROPERTY_LINK_COLOR = "link_color"; - @javax.annotation.Nullable private String linkColor; - - public static final String JSON_PROPERTY_PAGE_BACKGROUND_COLOR = "page_background_color"; - @javax.annotation.Nullable private String pageBackgroundColor; - - public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR = "primary_button_color"; - @javax.annotation.Nullable private String primaryButtonColor; - - public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER = - "primary_button_color_hover"; - @javax.annotation.Nullable private String primaryButtonColorHover; - - public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR = - "primary_button_text_color"; - @javax.annotation.Nullable private String primaryButtonTextColor; - - public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER = - "primary_button_text_color_hover"; - @javax.annotation.Nullable private String primaryButtonTextColorHover; - - public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR = "secondary_button_color"; - @javax.annotation.Nullable private String secondaryButtonColor; - - public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER = - "secondary_button_color_hover"; - @javax.annotation.Nullable private String secondaryButtonColorHover; - - public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR = - "secondary_button_text_color"; - @javax.annotation.Nullable private String secondaryButtonTextColor; - - public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER = - "secondary_button_text_color_hover"; - @javax.annotation.Nullable private String secondaryButtonTextColorHover; - - public static final String JSON_PROPERTY_TEXT_COLOR1 = "text_color1"; - @javax.annotation.Nullable private String textColor1; - - public static final String JSON_PROPERTY_TEXT_COLOR2 = "text_color2"; - @javax.annotation.Nullable private String textColor2; - - public ApiAppResponseWhiteLabelingOptions() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ApiAppResponseWhiteLabelingOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppResponseWhiteLabelingOptions.class); - } - - public static ApiAppResponseWhiteLabelingOptions init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - ApiAppResponseWhiteLabelingOptions.class); - } - - public ApiAppResponseWhiteLabelingOptions headerBackgroundColor( - @javax.annotation.Nullable String headerBackgroundColor) { - this.headerBackgroundColor = headerBackgroundColor; - return this; - } - - /** - * Get headerBackgroundColor - * - * @return headerBackgroundColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getHeaderBackgroundColor() { - return headerBackgroundColor; - } - - @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaderBackgroundColor(@javax.annotation.Nullable String headerBackgroundColor) { - this.headerBackgroundColor = headerBackgroundColor; - } - - public ApiAppResponseWhiteLabelingOptions legalVersion( - @javax.annotation.Nullable String legalVersion) { - this.legalVersion = legalVersion; - return this; - } - - /** - * Get legalVersion - * - * @return legalVersion - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLegalVersion() { - return legalVersion; - } - - @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLegalVersion(@javax.annotation.Nullable String legalVersion) { - this.legalVersion = legalVersion; - } - - public ApiAppResponseWhiteLabelingOptions linkColor( - @javax.annotation.Nullable String linkColor) { - this.linkColor = linkColor; - return this; - } - - /** - * Get linkColor - * - * @return linkColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LINK_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLinkColor() { - return linkColor; - } - - @JsonProperty(JSON_PROPERTY_LINK_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLinkColor(@javax.annotation.Nullable String linkColor) { - this.linkColor = linkColor; - } - - public ApiAppResponseWhiteLabelingOptions pageBackgroundColor( - @javax.annotation.Nullable String pageBackgroundColor) { - this.pageBackgroundColor = pageBackgroundColor; - return this; - } - - /** - * Get pageBackgroundColor - * - * @return pageBackgroundColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPageBackgroundColor() { - return pageBackgroundColor; - } - - @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPageBackgroundColor(@javax.annotation.Nullable String pageBackgroundColor) { - this.pageBackgroundColor = pageBackgroundColor; - } - - public ApiAppResponseWhiteLabelingOptions primaryButtonColor( - @javax.annotation.Nullable String primaryButtonColor) { - this.primaryButtonColor = primaryButtonColor; - return this; - } - - /** - * Get primaryButtonColor - * - * @return primaryButtonColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPrimaryButtonColor() { - return primaryButtonColor; - } - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonColor(@javax.annotation.Nullable String primaryButtonColor) { - this.primaryButtonColor = primaryButtonColor; - } - - public ApiAppResponseWhiteLabelingOptions primaryButtonColorHover( - @javax.annotation.Nullable String primaryButtonColorHover) { - this.primaryButtonColorHover = primaryButtonColorHover; - return this; - } - - /** - * Get primaryButtonColorHover - * - * @return primaryButtonColorHover - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPrimaryButtonColorHover() { - return primaryButtonColorHover; - } - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonColorHover( - @javax.annotation.Nullable String primaryButtonColorHover) { - this.primaryButtonColorHover = primaryButtonColorHover; - } - - public ApiAppResponseWhiteLabelingOptions primaryButtonTextColor( - @javax.annotation.Nullable String primaryButtonTextColor) { - this.primaryButtonTextColor = primaryButtonTextColor; - return this; - } - - /** - * Get primaryButtonTextColor - * - * @return primaryButtonTextColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPrimaryButtonTextColor() { - return primaryButtonTextColor; - } - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonTextColor( - @javax.annotation.Nullable String primaryButtonTextColor) { - this.primaryButtonTextColor = primaryButtonTextColor; - } - - public ApiAppResponseWhiteLabelingOptions primaryButtonTextColorHover( - @javax.annotation.Nullable String primaryButtonTextColorHover) { - this.primaryButtonTextColorHover = primaryButtonTextColorHover; - return this; - } - - /** - * Get primaryButtonTextColorHover - * - * @return primaryButtonTextColorHover - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPrimaryButtonTextColorHover() { - return primaryButtonTextColorHover; - } - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonTextColorHover( - @javax.annotation.Nullable String primaryButtonTextColorHover) { - this.primaryButtonTextColorHover = primaryButtonTextColorHover; - } - - public ApiAppResponseWhiteLabelingOptions secondaryButtonColor( - @javax.annotation.Nullable String secondaryButtonColor) { - this.secondaryButtonColor = secondaryButtonColor; - return this; - } - - /** - * Get secondaryButtonColor - * - * @return secondaryButtonColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSecondaryButtonColor() { - return secondaryButtonColor; - } - - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonColor(@javax.annotation.Nullable String secondaryButtonColor) { - this.secondaryButtonColor = secondaryButtonColor; - } - - public ApiAppResponseWhiteLabelingOptions secondaryButtonColorHover( - @javax.annotation.Nullable String secondaryButtonColorHover) { - this.secondaryButtonColorHover = secondaryButtonColorHover; - return this; - } - - /** - * Get secondaryButtonColorHover - * - * @return secondaryButtonColorHover - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSecondaryButtonColorHover() { - return secondaryButtonColorHover; - } - - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonColorHover( - @javax.annotation.Nullable String secondaryButtonColorHover) { - this.secondaryButtonColorHover = secondaryButtonColorHover; - } + public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; + @javax.annotation.Nullable + private String headerBackgroundColor; + + public static final String JSON_PROPERTY_LEGAL_VERSION = "legal_version"; + @javax.annotation.Nullable + private String legalVersion; + + public static final String JSON_PROPERTY_LINK_COLOR = "link_color"; + @javax.annotation.Nullable + private String linkColor; + + public static final String JSON_PROPERTY_PAGE_BACKGROUND_COLOR = "page_background_color"; + @javax.annotation.Nullable + private String pageBackgroundColor; + + public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR = "primary_button_color"; + @javax.annotation.Nullable + private String primaryButtonColor; + + public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER = "primary_button_color_hover"; + @javax.annotation.Nullable + private String primaryButtonColorHover; + + public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR = "primary_button_text_color"; + @javax.annotation.Nullable + private String primaryButtonTextColor; + + public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER = "primary_button_text_color_hover"; + @javax.annotation.Nullable + private String primaryButtonTextColorHover; + + public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR = "secondary_button_color"; + @javax.annotation.Nullable + private String secondaryButtonColor; + + public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER = "secondary_button_color_hover"; + @javax.annotation.Nullable + private String secondaryButtonColorHover; + + public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR = "secondary_button_text_color"; + @javax.annotation.Nullable + private String secondaryButtonTextColor; + + public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER = "secondary_button_text_color_hover"; + @javax.annotation.Nullable + private String secondaryButtonTextColorHover; + + public static final String JSON_PROPERTY_TEXT_COLOR1 = "text_color1"; + @javax.annotation.Nullable + private String textColor1; + + public static final String JSON_PROPERTY_TEXT_COLOR2 = "text_color2"; + @javax.annotation.Nullable + private String textColor2; + + public ApiAppResponseWhiteLabelingOptions() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ApiAppResponseWhiteLabelingOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppResponseWhiteLabelingOptions.class); + } + + static public ApiAppResponseWhiteLabelingOptions init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ApiAppResponseWhiteLabelingOptions.class + ); + } + + public ApiAppResponseWhiteLabelingOptions headerBackgroundColor(@javax.annotation.Nullable String headerBackgroundColor) { + this.headerBackgroundColor = headerBackgroundColor; + return this; + } + + /** + * Get headerBackgroundColor + * @return headerBackgroundColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHeaderBackgroundColor() { + return headerBackgroundColor; + } + + + @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderBackgroundColor(@javax.annotation.Nullable String headerBackgroundColor) { + this.headerBackgroundColor = headerBackgroundColor; + } + + + public ApiAppResponseWhiteLabelingOptions legalVersion(@javax.annotation.Nullable String legalVersion) { + this.legalVersion = legalVersion; + return this; + } + + /** + * Get legalVersion + * @return legalVersion + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLegalVersion() { + return legalVersion; + } + + + @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLegalVersion(@javax.annotation.Nullable String legalVersion) { + this.legalVersion = legalVersion; + } + + + public ApiAppResponseWhiteLabelingOptions linkColor(@javax.annotation.Nullable String linkColor) { + this.linkColor = linkColor; + return this; + } + + /** + * Get linkColor + * @return linkColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINK_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLinkColor() { + return linkColor; + } + + + @JsonProperty(JSON_PROPERTY_LINK_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkColor(@javax.annotation.Nullable String linkColor) { + this.linkColor = linkColor; + } + + + public ApiAppResponseWhiteLabelingOptions pageBackgroundColor(@javax.annotation.Nullable String pageBackgroundColor) { + this.pageBackgroundColor = pageBackgroundColor; + return this; + } + + /** + * Get pageBackgroundColor + * @return pageBackgroundColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPageBackgroundColor() { + return pageBackgroundColor; + } + + + @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageBackgroundColor(@javax.annotation.Nullable String pageBackgroundColor) { + this.pageBackgroundColor = pageBackgroundColor; + } + + + public ApiAppResponseWhiteLabelingOptions primaryButtonColor(@javax.annotation.Nullable String primaryButtonColor) { + this.primaryButtonColor = primaryButtonColor; + return this; + } + + /** + * Get primaryButtonColor + * @return primaryButtonColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrimaryButtonColor() { + return primaryButtonColor; + } + + + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonColor(@javax.annotation.Nullable String primaryButtonColor) { + this.primaryButtonColor = primaryButtonColor; + } + + + public ApiAppResponseWhiteLabelingOptions primaryButtonColorHover(@javax.annotation.Nullable String primaryButtonColorHover) { + this.primaryButtonColorHover = primaryButtonColorHover; + return this; + } + + /** + * Get primaryButtonColorHover + * @return primaryButtonColorHover + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrimaryButtonColorHover() { + return primaryButtonColorHover; + } + + + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonColorHover(@javax.annotation.Nullable String primaryButtonColorHover) { + this.primaryButtonColorHover = primaryButtonColorHover; + } + + + public ApiAppResponseWhiteLabelingOptions primaryButtonTextColor(@javax.annotation.Nullable String primaryButtonTextColor) { + this.primaryButtonTextColor = primaryButtonTextColor; + return this; + } + + /** + * Get primaryButtonTextColor + * @return primaryButtonTextColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrimaryButtonTextColor() { + return primaryButtonTextColor; + } + + + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonTextColor(@javax.annotation.Nullable String primaryButtonTextColor) { + this.primaryButtonTextColor = primaryButtonTextColor; + } + + + public ApiAppResponseWhiteLabelingOptions primaryButtonTextColorHover(@javax.annotation.Nullable String primaryButtonTextColorHover) { + this.primaryButtonTextColorHover = primaryButtonTextColorHover; + return this; + } + + /** + * Get primaryButtonTextColorHover + * @return primaryButtonTextColorHover + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrimaryButtonTextColorHover() { + return primaryButtonTextColorHover; + } + + + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonTextColorHover(@javax.annotation.Nullable String primaryButtonTextColorHover) { + this.primaryButtonTextColorHover = primaryButtonTextColorHover; + } + + + public ApiAppResponseWhiteLabelingOptions secondaryButtonColor(@javax.annotation.Nullable String secondaryButtonColor) { + this.secondaryButtonColor = secondaryButtonColor; + return this; + } + + /** + * Get secondaryButtonColor + * @return secondaryButtonColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSecondaryButtonColor() { + return secondaryButtonColor; + } + + + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonColor(@javax.annotation.Nullable String secondaryButtonColor) { + this.secondaryButtonColor = secondaryButtonColor; + } + + + public ApiAppResponseWhiteLabelingOptions secondaryButtonColorHover(@javax.annotation.Nullable String secondaryButtonColorHover) { + this.secondaryButtonColorHover = secondaryButtonColorHover; + return this; + } + + /** + * Get secondaryButtonColorHover + * @return secondaryButtonColorHover + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSecondaryButtonColorHover() { + return secondaryButtonColorHover; + } + + + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonColorHover(@javax.annotation.Nullable String secondaryButtonColorHover) { + this.secondaryButtonColorHover = secondaryButtonColorHover; + } + + + public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColor(@javax.annotation.Nullable String secondaryButtonTextColor) { + this.secondaryButtonTextColor = secondaryButtonTextColor; + return this; + } + + /** + * Get secondaryButtonTextColor + * @return secondaryButtonTextColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSecondaryButtonTextColor() { + return secondaryButtonTextColor; + } + + + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonTextColor(@javax.annotation.Nullable String secondaryButtonTextColor) { + this.secondaryButtonTextColor = secondaryButtonTextColor; + } + + + public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColorHover(@javax.annotation.Nullable String secondaryButtonTextColorHover) { + this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; + return this; + } + + /** + * Get secondaryButtonTextColorHover + * @return secondaryButtonTextColorHover + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSecondaryButtonTextColorHover() { + return secondaryButtonTextColorHover; + } + + + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonTextColorHover(@javax.annotation.Nullable String secondaryButtonTextColorHover) { + this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; + } + + + public ApiAppResponseWhiteLabelingOptions textColor1(@javax.annotation.Nullable String textColor1) { + this.textColor1 = textColor1; + return this; + } + + /** + * Get textColor1 + * @return textColor1 + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTextColor1() { + return textColor1; + } + + + @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTextColor1(@javax.annotation.Nullable String textColor1) { + this.textColor1 = textColor1; + } + + + public ApiAppResponseWhiteLabelingOptions textColor2(@javax.annotation.Nullable String textColor2) { + this.textColor2 = textColor2; + return this; + } + + /** + * Get textColor2 + * @return textColor2 + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTextColor2() { + return textColor2; + } + + + @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTextColor2(@javax.annotation.Nullable String textColor2) { + this.textColor2 = textColor2; + } + + + /** + * Return true if this ApiAppResponseWhiteLabelingOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiAppResponseWhiteLabelingOptions apiAppResponseWhiteLabelingOptions = (ApiAppResponseWhiteLabelingOptions) o; + return Objects.equals(this.headerBackgroundColor, apiAppResponseWhiteLabelingOptions.headerBackgroundColor) && + Objects.equals(this.legalVersion, apiAppResponseWhiteLabelingOptions.legalVersion) && + Objects.equals(this.linkColor, apiAppResponseWhiteLabelingOptions.linkColor) && + Objects.equals(this.pageBackgroundColor, apiAppResponseWhiteLabelingOptions.pageBackgroundColor) && + Objects.equals(this.primaryButtonColor, apiAppResponseWhiteLabelingOptions.primaryButtonColor) && + Objects.equals(this.primaryButtonColorHover, apiAppResponseWhiteLabelingOptions.primaryButtonColorHover) && + Objects.equals(this.primaryButtonTextColor, apiAppResponseWhiteLabelingOptions.primaryButtonTextColor) && + Objects.equals(this.primaryButtonTextColorHover, apiAppResponseWhiteLabelingOptions.primaryButtonTextColorHover) && + Objects.equals(this.secondaryButtonColor, apiAppResponseWhiteLabelingOptions.secondaryButtonColor) && + Objects.equals(this.secondaryButtonColorHover, apiAppResponseWhiteLabelingOptions.secondaryButtonColorHover) && + Objects.equals(this.secondaryButtonTextColor, apiAppResponseWhiteLabelingOptions.secondaryButtonTextColor) && + Objects.equals(this.secondaryButtonTextColorHover, apiAppResponseWhiteLabelingOptions.secondaryButtonTextColorHover) && + Objects.equals(this.textColor1, apiAppResponseWhiteLabelingOptions.textColor1) && + Objects.equals(this.textColor2, apiAppResponseWhiteLabelingOptions.textColor2); + } + + @Override + public int hashCode() { + return Objects.hash(headerBackgroundColor, legalVersion, linkColor, pageBackgroundColor, primaryButtonColor, primaryButtonColorHover, primaryButtonTextColor, primaryButtonTextColorHover, secondaryButtonColor, secondaryButtonColorHover, secondaryButtonTextColor, secondaryButtonTextColorHover, textColor1, textColor2); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppResponseWhiteLabelingOptions {\n"); + sb.append(" headerBackgroundColor: ").append(toIndentedString(headerBackgroundColor)).append("\n"); + sb.append(" legalVersion: ").append(toIndentedString(legalVersion)).append("\n"); + sb.append(" linkColor: ").append(toIndentedString(linkColor)).append("\n"); + sb.append(" pageBackgroundColor: ").append(toIndentedString(pageBackgroundColor)).append("\n"); + sb.append(" primaryButtonColor: ").append(toIndentedString(primaryButtonColor)).append("\n"); + sb.append(" primaryButtonColorHover: ").append(toIndentedString(primaryButtonColorHover)).append("\n"); + sb.append(" primaryButtonTextColor: ").append(toIndentedString(primaryButtonTextColor)).append("\n"); + sb.append(" primaryButtonTextColorHover: ").append(toIndentedString(primaryButtonTextColorHover)).append("\n"); + sb.append(" secondaryButtonColor: ").append(toIndentedString(secondaryButtonColor)).append("\n"); + sb.append(" secondaryButtonColorHover: ").append(toIndentedString(secondaryButtonColorHover)).append("\n"); + sb.append(" secondaryButtonTextColor: ").append(toIndentedString(secondaryButtonTextColor)).append("\n"); + sb.append(" secondaryButtonTextColorHover: ").append(toIndentedString(secondaryButtonTextColorHover)).append("\n"); + sb.append(" textColor1: ").append(toIndentedString(textColor1)).append("\n"); + sb.append(" textColor2: ").append(toIndentedString(textColor2)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (headerBackgroundColor != null) { + if (isFileTypeOrListOfFiles(headerBackgroundColor)) { + fileTypeFound = true; + } - public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColor( - @javax.annotation.Nullable String secondaryButtonTextColor) { - this.secondaryButtonTextColor = secondaryButtonTextColor; - return this; + if (headerBackgroundColor.getClass().equals(java.io.File.class) || + headerBackgroundColor.getClass().equals(Integer.class) || + headerBackgroundColor.getClass().equals(String.class) || + headerBackgroundColor.getClass().isEnum()) { + map.put("header_background_color", headerBackgroundColor); + } else if (isListOfFile(headerBackgroundColor)) { + for(int i = 0; i< getListSize(headerBackgroundColor); i++) { + map.put("header_background_color[" + i + "]", getFromList(headerBackgroundColor, i)); + } + } + else { + map.put("header_background_color", JSON.getDefault().getMapper().writeValueAsString(headerBackgroundColor)); + } } + if (legalVersion != null) { + if (isFileTypeOrListOfFiles(legalVersion)) { + fileTypeFound = true; + } - /** - * Get secondaryButtonTextColor - * - * @return secondaryButtonTextColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSecondaryButtonTextColor() { - return secondaryButtonTextColor; + if (legalVersion.getClass().equals(java.io.File.class) || + legalVersion.getClass().equals(Integer.class) || + legalVersion.getClass().equals(String.class) || + legalVersion.getClass().isEnum()) { + map.put("legal_version", legalVersion); + } else if (isListOfFile(legalVersion)) { + for(int i = 0; i< getListSize(legalVersion); i++) { + map.put("legal_version[" + i + "]", getFromList(legalVersion, i)); + } + } + else { + map.put("legal_version", JSON.getDefault().getMapper().writeValueAsString(legalVersion)); + } } + if (linkColor != null) { + if (isFileTypeOrListOfFiles(linkColor)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonTextColor( - @javax.annotation.Nullable String secondaryButtonTextColor) { - this.secondaryButtonTextColor = secondaryButtonTextColor; + if (linkColor.getClass().equals(java.io.File.class) || + linkColor.getClass().equals(Integer.class) || + linkColor.getClass().equals(String.class) || + linkColor.getClass().isEnum()) { + map.put("link_color", linkColor); + } else if (isListOfFile(linkColor)) { + for(int i = 0; i< getListSize(linkColor); i++) { + map.put("link_color[" + i + "]", getFromList(linkColor, i)); + } + } + else { + map.put("link_color", JSON.getDefault().getMapper().writeValueAsString(linkColor)); + } } + if (pageBackgroundColor != null) { + if (isFileTypeOrListOfFiles(pageBackgroundColor)) { + fileTypeFound = true; + } - public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColorHover( - @javax.annotation.Nullable String secondaryButtonTextColorHover) { - this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; - return this; + if (pageBackgroundColor.getClass().equals(java.io.File.class) || + pageBackgroundColor.getClass().equals(Integer.class) || + pageBackgroundColor.getClass().equals(String.class) || + pageBackgroundColor.getClass().isEnum()) { + map.put("page_background_color", pageBackgroundColor); + } else if (isListOfFile(pageBackgroundColor)) { + for(int i = 0; i< getListSize(pageBackgroundColor); i++) { + map.put("page_background_color[" + i + "]", getFromList(pageBackgroundColor, i)); + } + } + else { + map.put("page_background_color", JSON.getDefault().getMapper().writeValueAsString(pageBackgroundColor)); + } } + if (primaryButtonColor != null) { + if (isFileTypeOrListOfFiles(primaryButtonColor)) { + fileTypeFound = true; + } - /** - * Get secondaryButtonTextColorHover - * - * @return secondaryButtonTextColorHover - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSecondaryButtonTextColorHover() { - return secondaryButtonTextColorHover; + if (primaryButtonColor.getClass().equals(java.io.File.class) || + primaryButtonColor.getClass().equals(Integer.class) || + primaryButtonColor.getClass().equals(String.class) || + primaryButtonColor.getClass().isEnum()) { + map.put("primary_button_color", primaryButtonColor); + } else if (isListOfFile(primaryButtonColor)) { + for(int i = 0; i< getListSize(primaryButtonColor); i++) { + map.put("primary_button_color[" + i + "]", getFromList(primaryButtonColor, i)); + } + } + else { + map.put("primary_button_color", JSON.getDefault().getMapper().writeValueAsString(primaryButtonColor)); + } } + if (primaryButtonColorHover != null) { + if (isFileTypeOrListOfFiles(primaryButtonColorHover)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonTextColorHover( - @javax.annotation.Nullable String secondaryButtonTextColorHover) { - this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; + if (primaryButtonColorHover.getClass().equals(java.io.File.class) || + primaryButtonColorHover.getClass().equals(Integer.class) || + primaryButtonColorHover.getClass().equals(String.class) || + primaryButtonColorHover.getClass().isEnum()) { + map.put("primary_button_color_hover", primaryButtonColorHover); + } else if (isListOfFile(primaryButtonColorHover)) { + for(int i = 0; i< getListSize(primaryButtonColorHover); i++) { + map.put("primary_button_color_hover[" + i + "]", getFromList(primaryButtonColorHover, i)); + } + } + else { + map.put("primary_button_color_hover", JSON.getDefault().getMapper().writeValueAsString(primaryButtonColorHover)); + } } + if (primaryButtonTextColor != null) { + if (isFileTypeOrListOfFiles(primaryButtonTextColor)) { + fileTypeFound = true; + } - public ApiAppResponseWhiteLabelingOptions textColor1( - @javax.annotation.Nullable String textColor1) { - this.textColor1 = textColor1; - return this; + if (primaryButtonTextColor.getClass().equals(java.io.File.class) || + primaryButtonTextColor.getClass().equals(Integer.class) || + primaryButtonTextColor.getClass().equals(String.class) || + primaryButtonTextColor.getClass().isEnum()) { + map.put("primary_button_text_color", primaryButtonTextColor); + } else if (isListOfFile(primaryButtonTextColor)) { + for(int i = 0; i< getListSize(primaryButtonTextColor); i++) { + map.put("primary_button_text_color[" + i + "]", getFromList(primaryButtonTextColor, i)); + } + } + else { + map.put("primary_button_text_color", JSON.getDefault().getMapper().writeValueAsString(primaryButtonTextColor)); + } } + if (primaryButtonTextColorHover != null) { + if (isFileTypeOrListOfFiles(primaryButtonTextColorHover)) { + fileTypeFound = true; + } - /** - * Get textColor1 - * - * @return textColor1 - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTextColor1() { - return textColor1; + if (primaryButtonTextColorHover.getClass().equals(java.io.File.class) || + primaryButtonTextColorHover.getClass().equals(Integer.class) || + primaryButtonTextColorHover.getClass().equals(String.class) || + primaryButtonTextColorHover.getClass().isEnum()) { + map.put("primary_button_text_color_hover", primaryButtonTextColorHover); + } else if (isListOfFile(primaryButtonTextColorHover)) { + for(int i = 0; i< getListSize(primaryButtonTextColorHover); i++) { + map.put("primary_button_text_color_hover[" + i + "]", getFromList(primaryButtonTextColorHover, i)); + } + } + else { + map.put("primary_button_text_color_hover", JSON.getDefault().getMapper().writeValueAsString(primaryButtonTextColorHover)); + } } + if (secondaryButtonColor != null) { + if (isFileTypeOrListOfFiles(secondaryButtonColor)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTextColor1(@javax.annotation.Nullable String textColor1) { - this.textColor1 = textColor1; + if (secondaryButtonColor.getClass().equals(java.io.File.class) || + secondaryButtonColor.getClass().equals(Integer.class) || + secondaryButtonColor.getClass().equals(String.class) || + secondaryButtonColor.getClass().isEnum()) { + map.put("secondary_button_color", secondaryButtonColor); + } else if (isListOfFile(secondaryButtonColor)) { + for(int i = 0; i< getListSize(secondaryButtonColor); i++) { + map.put("secondary_button_color[" + i + "]", getFromList(secondaryButtonColor, i)); + } + } + else { + map.put("secondary_button_color", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonColor)); + } } + if (secondaryButtonColorHover != null) { + if (isFileTypeOrListOfFiles(secondaryButtonColorHover)) { + fileTypeFound = true; + } - public ApiAppResponseWhiteLabelingOptions textColor2( - @javax.annotation.Nullable String textColor2) { - this.textColor2 = textColor2; - return this; + if (secondaryButtonColorHover.getClass().equals(java.io.File.class) || + secondaryButtonColorHover.getClass().equals(Integer.class) || + secondaryButtonColorHover.getClass().equals(String.class) || + secondaryButtonColorHover.getClass().isEnum()) { + map.put("secondary_button_color_hover", secondaryButtonColorHover); + } else if (isListOfFile(secondaryButtonColorHover)) { + for(int i = 0; i< getListSize(secondaryButtonColorHover); i++) { + map.put("secondary_button_color_hover[" + i + "]", getFromList(secondaryButtonColorHover, i)); + } + } + else { + map.put("secondary_button_color_hover", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonColorHover)); + } } + if (secondaryButtonTextColor != null) { + if (isFileTypeOrListOfFiles(secondaryButtonTextColor)) { + fileTypeFound = true; + } - /** - * Get textColor2 - * - * @return textColor2 - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTextColor2() { - return textColor2; + if (secondaryButtonTextColor.getClass().equals(java.io.File.class) || + secondaryButtonTextColor.getClass().equals(Integer.class) || + secondaryButtonTextColor.getClass().equals(String.class) || + secondaryButtonTextColor.getClass().isEnum()) { + map.put("secondary_button_text_color", secondaryButtonTextColor); + } else if (isListOfFile(secondaryButtonTextColor)) { + for(int i = 0; i< getListSize(secondaryButtonTextColor); i++) { + map.put("secondary_button_text_color[" + i + "]", getFromList(secondaryButtonTextColor, i)); + } + } + else { + map.put("secondary_button_text_color", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonTextColor)); + } } + if (secondaryButtonTextColorHover != null) { + if (isFileTypeOrListOfFiles(secondaryButtonTextColorHover)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTextColor2(@javax.annotation.Nullable String textColor2) { - this.textColor2 = textColor2; + if (secondaryButtonTextColorHover.getClass().equals(java.io.File.class) || + secondaryButtonTextColorHover.getClass().equals(Integer.class) || + secondaryButtonTextColorHover.getClass().equals(String.class) || + secondaryButtonTextColorHover.getClass().isEnum()) { + map.put("secondary_button_text_color_hover", secondaryButtonTextColorHover); + } else if (isListOfFile(secondaryButtonTextColorHover)) { + for(int i = 0; i< getListSize(secondaryButtonTextColorHover); i++) { + map.put("secondary_button_text_color_hover[" + i + "]", getFromList(secondaryButtonTextColorHover, i)); + } + } + else { + map.put("secondary_button_text_color_hover", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonTextColorHover)); + } } + if (textColor1 != null) { + if (isFileTypeOrListOfFiles(textColor1)) { + fileTypeFound = true; + } - /** Return true if this ApiAppResponseWhiteLabelingOptions object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ApiAppResponseWhiteLabelingOptions apiAppResponseWhiteLabelingOptions = - (ApiAppResponseWhiteLabelingOptions) o; - return Objects.equals( - this.headerBackgroundColor, - apiAppResponseWhiteLabelingOptions.headerBackgroundColor) - && Objects.equals( - this.legalVersion, apiAppResponseWhiteLabelingOptions.legalVersion) - && Objects.equals(this.linkColor, apiAppResponseWhiteLabelingOptions.linkColor) - && Objects.equals( - this.pageBackgroundColor, - apiAppResponseWhiteLabelingOptions.pageBackgroundColor) - && Objects.equals( - this.primaryButtonColor, - apiAppResponseWhiteLabelingOptions.primaryButtonColor) - && Objects.equals( - this.primaryButtonColorHover, - apiAppResponseWhiteLabelingOptions.primaryButtonColorHover) - && Objects.equals( - this.primaryButtonTextColor, - apiAppResponseWhiteLabelingOptions.primaryButtonTextColor) - && Objects.equals( - this.primaryButtonTextColorHover, - apiAppResponseWhiteLabelingOptions.primaryButtonTextColorHover) - && Objects.equals( - this.secondaryButtonColor, - apiAppResponseWhiteLabelingOptions.secondaryButtonColor) - && Objects.equals( - this.secondaryButtonColorHover, - apiAppResponseWhiteLabelingOptions.secondaryButtonColorHover) - && Objects.equals( - this.secondaryButtonTextColor, - apiAppResponseWhiteLabelingOptions.secondaryButtonTextColor) - && Objects.equals( - this.secondaryButtonTextColorHover, - apiAppResponseWhiteLabelingOptions.secondaryButtonTextColorHover) - && Objects.equals(this.textColor1, apiAppResponseWhiteLabelingOptions.textColor1) - && Objects.equals(this.textColor2, apiAppResponseWhiteLabelingOptions.textColor2); + if (textColor1.getClass().equals(java.io.File.class) || + textColor1.getClass().equals(Integer.class) || + textColor1.getClass().equals(String.class) || + textColor1.getClass().isEnum()) { + map.put("text_color1", textColor1); + } else if (isListOfFile(textColor1)) { + for(int i = 0; i< getListSize(textColor1); i++) { + map.put("text_color1[" + i + "]", getFromList(textColor1, i)); + } + } + else { + map.put("text_color1", JSON.getDefault().getMapper().writeValueAsString(textColor1)); + } } + if (textColor2 != null) { + if (isFileTypeOrListOfFiles(textColor2)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - headerBackgroundColor, - legalVersion, - linkColor, - pageBackgroundColor, - primaryButtonColor, - primaryButtonColorHover, - primaryButtonTextColor, - primaryButtonTextColorHover, - secondaryButtonColor, - secondaryButtonColorHover, - secondaryButtonTextColor, - secondaryButtonTextColorHover, - textColor1, - textColor2); + if (textColor2.getClass().equals(java.io.File.class) || + textColor2.getClass().equals(Integer.class) || + textColor2.getClass().equals(String.class) || + textColor2.getClass().isEnum()) { + map.put("text_color2", textColor2); + } else if (isListOfFile(textColor2)) { + for(int i = 0; i< getListSize(textColor2); i++) { + map.put("text_color2[" + i + "]", getFromList(textColor2, i)); + } + } + else { + map.put("text_color2", JSON.getDefault().getMapper().writeValueAsString(textColor2)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppResponseWhiteLabelingOptions {\n"); - sb.append(" headerBackgroundColor: ") - .append(toIndentedString(headerBackgroundColor)) - .append("\n"); - sb.append(" legalVersion: ").append(toIndentedString(legalVersion)).append("\n"); - sb.append(" linkColor: ").append(toIndentedString(linkColor)).append("\n"); - sb.append(" pageBackgroundColor: ") - .append(toIndentedString(pageBackgroundColor)) - .append("\n"); - sb.append(" primaryButtonColor: ") - .append(toIndentedString(primaryButtonColor)) - .append("\n"); - sb.append(" primaryButtonColorHover: ") - .append(toIndentedString(primaryButtonColorHover)) - .append("\n"); - sb.append(" primaryButtonTextColor: ") - .append(toIndentedString(primaryButtonTextColor)) - .append("\n"); - sb.append(" primaryButtonTextColorHover: ") - .append(toIndentedString(primaryButtonTextColorHover)) - .append("\n"); - sb.append(" secondaryButtonColor: ") - .append(toIndentedString(secondaryButtonColor)) - .append("\n"); - sb.append(" secondaryButtonColorHover: ") - .append(toIndentedString(secondaryButtonColorHover)) - .append("\n"); - sb.append(" secondaryButtonTextColor: ") - .append(toIndentedString(secondaryButtonTextColor)) - .append("\n"); - sb.append(" secondaryButtonTextColorHover: ") - .append(toIndentedString(secondaryButtonTextColorHover)) - .append("\n"); - sb.append(" textColor1: ").append(toIndentedString(textColor1)).append("\n"); - sb.append(" textColor2: ").append(toIndentedString(textColor2)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (headerBackgroundColor != null) { - if (isFileTypeOrListOfFiles(headerBackgroundColor)) { - fileTypeFound = true; - } - - if (headerBackgroundColor.getClass().equals(java.io.File.class) - || headerBackgroundColor.getClass().equals(Integer.class) - || headerBackgroundColor.getClass().equals(String.class) - || headerBackgroundColor.getClass().isEnum()) { - map.put("header_background_color", headerBackgroundColor); - } else if (isListOfFile(headerBackgroundColor)) { - for (int i = 0; i < getListSize(headerBackgroundColor); i++) { - map.put( - "header_background_color[" + i + "]", - getFromList(headerBackgroundColor, i)); - } - } else { - map.put( - "header_background_color", - JSON.getDefault() - .getMapper() - .writeValueAsString(headerBackgroundColor)); - } - } - if (legalVersion != null) { - if (isFileTypeOrListOfFiles(legalVersion)) { - fileTypeFound = true; - } - - if (legalVersion.getClass().equals(java.io.File.class) - || legalVersion.getClass().equals(Integer.class) - || legalVersion.getClass().equals(String.class) - || legalVersion.getClass().isEnum()) { - map.put("legal_version", legalVersion); - } else if (isListOfFile(legalVersion)) { - for (int i = 0; i < getListSize(legalVersion); i++) { - map.put("legal_version[" + i + "]", getFromList(legalVersion, i)); - } - } else { - map.put( - "legal_version", - JSON.getDefault().getMapper().writeValueAsString(legalVersion)); - } - } - if (linkColor != null) { - if (isFileTypeOrListOfFiles(linkColor)) { - fileTypeFound = true; - } - - if (linkColor.getClass().equals(java.io.File.class) - || linkColor.getClass().equals(Integer.class) - || linkColor.getClass().equals(String.class) - || linkColor.getClass().isEnum()) { - map.put("link_color", linkColor); - } else if (isListOfFile(linkColor)) { - for (int i = 0; i < getListSize(linkColor); i++) { - map.put("link_color[" + i + "]", getFromList(linkColor, i)); - } - } else { - map.put( - "link_color", - JSON.getDefault().getMapper().writeValueAsString(linkColor)); - } - } - if (pageBackgroundColor != null) { - if (isFileTypeOrListOfFiles(pageBackgroundColor)) { - fileTypeFound = true; - } - - if (pageBackgroundColor.getClass().equals(java.io.File.class) - || pageBackgroundColor.getClass().equals(Integer.class) - || pageBackgroundColor.getClass().equals(String.class) - || pageBackgroundColor.getClass().isEnum()) { - map.put("page_background_color", pageBackgroundColor); - } else if (isListOfFile(pageBackgroundColor)) { - for (int i = 0; i < getListSize(pageBackgroundColor); i++) { - map.put( - "page_background_color[" + i + "]", - getFromList(pageBackgroundColor, i)); - } - } else { - map.put( - "page_background_color", - JSON.getDefault().getMapper().writeValueAsString(pageBackgroundColor)); - } - } - if (primaryButtonColor != null) { - if (isFileTypeOrListOfFiles(primaryButtonColor)) { - fileTypeFound = true; - } - - if (primaryButtonColor.getClass().equals(java.io.File.class) - || primaryButtonColor.getClass().equals(Integer.class) - || primaryButtonColor.getClass().equals(String.class) - || primaryButtonColor.getClass().isEnum()) { - map.put("primary_button_color", primaryButtonColor); - } else if (isListOfFile(primaryButtonColor)) { - for (int i = 0; i < getListSize(primaryButtonColor); i++) { - map.put( - "primary_button_color[" + i + "]", - getFromList(primaryButtonColor, i)); - } - } else { - map.put( - "primary_button_color", - JSON.getDefault().getMapper().writeValueAsString(primaryButtonColor)); - } - } - if (primaryButtonColorHover != null) { - if (isFileTypeOrListOfFiles(primaryButtonColorHover)) { - fileTypeFound = true; - } - - if (primaryButtonColorHover.getClass().equals(java.io.File.class) - || primaryButtonColorHover.getClass().equals(Integer.class) - || primaryButtonColorHover.getClass().equals(String.class) - || primaryButtonColorHover.getClass().isEnum()) { - map.put("primary_button_color_hover", primaryButtonColorHover); - } else if (isListOfFile(primaryButtonColorHover)) { - for (int i = 0; i < getListSize(primaryButtonColorHover); i++) { - map.put( - "primary_button_color_hover[" + i + "]", - getFromList(primaryButtonColorHover, i)); - } - } else { - map.put( - "primary_button_color_hover", - JSON.getDefault() - .getMapper() - .writeValueAsString(primaryButtonColorHover)); - } - } - if (primaryButtonTextColor != null) { - if (isFileTypeOrListOfFiles(primaryButtonTextColor)) { - fileTypeFound = true; - } - - if (primaryButtonTextColor.getClass().equals(java.io.File.class) - || primaryButtonTextColor.getClass().equals(Integer.class) - || primaryButtonTextColor.getClass().equals(String.class) - || primaryButtonTextColor.getClass().isEnum()) { - map.put("primary_button_text_color", primaryButtonTextColor); - } else if (isListOfFile(primaryButtonTextColor)) { - for (int i = 0; i < getListSize(primaryButtonTextColor); i++) { - map.put( - "primary_button_text_color[" + i + "]", - getFromList(primaryButtonTextColor, i)); - } - } else { - map.put( - "primary_button_text_color", - JSON.getDefault() - .getMapper() - .writeValueAsString(primaryButtonTextColor)); - } - } - if (primaryButtonTextColorHover != null) { - if (isFileTypeOrListOfFiles(primaryButtonTextColorHover)) { - fileTypeFound = true; - } - - if (primaryButtonTextColorHover.getClass().equals(java.io.File.class) - || primaryButtonTextColorHover.getClass().equals(Integer.class) - || primaryButtonTextColorHover.getClass().equals(String.class) - || primaryButtonTextColorHover.getClass().isEnum()) { - map.put("primary_button_text_color_hover", primaryButtonTextColorHover); - } else if (isListOfFile(primaryButtonTextColorHover)) { - for (int i = 0; i < getListSize(primaryButtonTextColorHover); i++) { - map.put( - "primary_button_text_color_hover[" + i + "]", - getFromList(primaryButtonTextColorHover, i)); - } - } else { - map.put( - "primary_button_text_color_hover", - JSON.getDefault() - .getMapper() - .writeValueAsString(primaryButtonTextColorHover)); - } - } - if (secondaryButtonColor != null) { - if (isFileTypeOrListOfFiles(secondaryButtonColor)) { - fileTypeFound = true; - } - - if (secondaryButtonColor.getClass().equals(java.io.File.class) - || secondaryButtonColor.getClass().equals(Integer.class) - || secondaryButtonColor.getClass().equals(String.class) - || secondaryButtonColor.getClass().isEnum()) { - map.put("secondary_button_color", secondaryButtonColor); - } else if (isListOfFile(secondaryButtonColor)) { - for (int i = 0; i < getListSize(secondaryButtonColor); i++) { - map.put( - "secondary_button_color[" + i + "]", - getFromList(secondaryButtonColor, i)); - } - } else { - map.put( - "secondary_button_color", - JSON.getDefault().getMapper().writeValueAsString(secondaryButtonColor)); - } - } - if (secondaryButtonColorHover != null) { - if (isFileTypeOrListOfFiles(secondaryButtonColorHover)) { - fileTypeFound = true; - } - - if (secondaryButtonColorHover.getClass().equals(java.io.File.class) - || secondaryButtonColorHover.getClass().equals(Integer.class) - || secondaryButtonColorHover.getClass().equals(String.class) - || secondaryButtonColorHover.getClass().isEnum()) { - map.put("secondary_button_color_hover", secondaryButtonColorHover); - } else if (isListOfFile(secondaryButtonColorHover)) { - for (int i = 0; i < getListSize(secondaryButtonColorHover); i++) { - map.put( - "secondary_button_color_hover[" + i + "]", - getFromList(secondaryButtonColorHover, i)); - } - } else { - map.put( - "secondary_button_color_hover", - JSON.getDefault() - .getMapper() - .writeValueAsString(secondaryButtonColorHover)); - } - } - if (secondaryButtonTextColor != null) { - if (isFileTypeOrListOfFiles(secondaryButtonTextColor)) { - fileTypeFound = true; - } - - if (secondaryButtonTextColor.getClass().equals(java.io.File.class) - || secondaryButtonTextColor.getClass().equals(Integer.class) - || secondaryButtonTextColor.getClass().equals(String.class) - || secondaryButtonTextColor.getClass().isEnum()) { - map.put("secondary_button_text_color", secondaryButtonTextColor); - } else if (isListOfFile(secondaryButtonTextColor)) { - for (int i = 0; i < getListSize(secondaryButtonTextColor); i++) { - map.put( - "secondary_button_text_color[" + i + "]", - getFromList(secondaryButtonTextColor, i)); - } - } else { - map.put( - "secondary_button_text_color", - JSON.getDefault() - .getMapper() - .writeValueAsString(secondaryButtonTextColor)); - } - } - if (secondaryButtonTextColorHover != null) { - if (isFileTypeOrListOfFiles(secondaryButtonTextColorHover)) { - fileTypeFound = true; - } - - if (secondaryButtonTextColorHover.getClass().equals(java.io.File.class) - || secondaryButtonTextColorHover.getClass().equals(Integer.class) - || secondaryButtonTextColorHover.getClass().equals(String.class) - || secondaryButtonTextColorHover.getClass().isEnum()) { - map.put("secondary_button_text_color_hover", secondaryButtonTextColorHover); - } else if (isListOfFile(secondaryButtonTextColorHover)) { - for (int i = 0; i < getListSize(secondaryButtonTextColorHover); i++) { - map.put( - "secondary_button_text_color_hover[" + i + "]", - getFromList(secondaryButtonTextColorHover, i)); - } - } else { - map.put( - "secondary_button_text_color_hover", - JSON.getDefault() - .getMapper() - .writeValueAsString(secondaryButtonTextColorHover)); - } - } - if (textColor1 != null) { - if (isFileTypeOrListOfFiles(textColor1)) { - fileTypeFound = true; - } - - if (textColor1.getClass().equals(java.io.File.class) - || textColor1.getClass().equals(Integer.class) - || textColor1.getClass().equals(String.class) - || textColor1.getClass().isEnum()) { - map.put("text_color1", textColor1); - } else if (isListOfFile(textColor1)) { - for (int i = 0; i < getListSize(textColor1); i++) { - map.put("text_color1[" + i + "]", getFromList(textColor1, i)); - } - } else { - map.put( - "text_color1", - JSON.getDefault().getMapper().writeValueAsString(textColor1)); - } - } - if (textColor2 != null) { - if (isFileTypeOrListOfFiles(textColor2)) { - fileTypeFound = true; - } - - if (textColor2.getClass().equals(java.io.File.class) - || textColor2.getClass().equals(Integer.class) - || textColor2.getClass().equals(String.class) - || textColor2.getClass().isEnum()) { - map.put("text_color2", textColor2); - } else if (isListOfFile(textColor2)) { - for (int i = 0; i < getListSize(textColor2); i++) { - map.put("text_color2[" + i + "]", getFromList(textColor2, i)); - } - } else { - map.put( - "text_color2", - JSON.getDefault().getMapper().writeValueAsString(textColor2)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java index a27dfcd8c..843e63680 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java @@ -10,459 +10,490 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubOAuth; +import com.dropbox.sign.model.SubOptions; +import com.dropbox.sign.model.SubWhiteLabelingOptions; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** ApiAppUpdateRequest */ + +import com.dropbox.sign.ApiException; +/** + * ApiAppUpdateRequest + */ @JsonPropertyOrder({ - ApiAppUpdateRequest.JSON_PROPERTY_CALLBACK_URL, - ApiAppUpdateRequest.JSON_PROPERTY_CUSTOM_LOGO_FILE, - ApiAppUpdateRequest.JSON_PROPERTY_DOMAINS, - ApiAppUpdateRequest.JSON_PROPERTY_NAME, - ApiAppUpdateRequest.JSON_PROPERTY_OAUTH, - ApiAppUpdateRequest.JSON_PROPERTY_OPTIONS, - ApiAppUpdateRequest.JSON_PROPERTY_WHITE_LABELING_OPTIONS + ApiAppUpdateRequest.JSON_PROPERTY_CALLBACK_URL, + ApiAppUpdateRequest.JSON_PROPERTY_CUSTOM_LOGO_FILE, + ApiAppUpdateRequest.JSON_PROPERTY_DOMAINS, + ApiAppUpdateRequest.JSON_PROPERTY_NAME, + ApiAppUpdateRequest.JSON_PROPERTY_OAUTH, + ApiAppUpdateRequest.JSON_PROPERTY_OPTIONS, + ApiAppUpdateRequest.JSON_PROPERTY_WHITE_LABELING_OPTIONS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ApiAppUpdateRequest { - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - @javax.annotation.Nullable private String callbackUrl; - - public static final String JSON_PROPERTY_CUSTOM_LOGO_FILE = "custom_logo_file"; - @javax.annotation.Nullable private File customLogoFile; - - public static final String JSON_PROPERTY_DOMAINS = "domains"; - @javax.annotation.Nullable private List domains = null; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_OAUTH = "oauth"; - @javax.annotation.Nullable private SubOAuth oauth; - - public static final String JSON_PROPERTY_OPTIONS = "options"; - @javax.annotation.Nullable private SubOptions options; - - public static final String JSON_PROPERTY_WHITE_LABELING_OPTIONS = "white_labeling_options"; - @javax.annotation.Nullable private SubWhiteLabelingOptions whiteLabelingOptions; - - public ApiAppUpdateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ApiAppUpdateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppUpdateRequest.class); - } - - public static ApiAppUpdateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), ApiAppUpdateRequest.class); - } - - public ApiAppUpdateRequest callbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } - - /** - * The URL at which the API App should receive event callbacks. - * - * @return callbackUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCallbackUrl() { - return callbackUrl; - } - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - public ApiAppUpdateRequest customLogoFile(@javax.annotation.Nullable File customLogoFile) { - this.customLogoFile = customLogoFile; - return this; - } - - /** - * An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) - * - * @return customLogoFile - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public File getCustomLogoFile() { - return customLogoFile; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomLogoFile(@javax.annotation.Nullable File customLogoFile) { - this.customLogoFile = customLogoFile; - } - - public ApiAppUpdateRequest domains(@javax.annotation.Nullable List domains) { - this.domains = domains; - return this; - } - - public ApiAppUpdateRequest addDomainsItem(String domainsItem) { - if (this.domains == null) { - this.domains = new ArrayList<>(); + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + @javax.annotation.Nullable + private String callbackUrl; + + public static final String JSON_PROPERTY_CUSTOM_LOGO_FILE = "custom_logo_file"; + @javax.annotation.Nullable + private File customLogoFile; + + public static final String JSON_PROPERTY_DOMAINS = "domains"; + @javax.annotation.Nullable + private List domains = null; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_OAUTH = "oauth"; + @javax.annotation.Nullable + private SubOAuth oauth; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + @javax.annotation.Nullable + private SubOptions options; + + public static final String JSON_PROPERTY_WHITE_LABELING_OPTIONS = "white_labeling_options"; + @javax.annotation.Nullable + private SubWhiteLabelingOptions whiteLabelingOptions; + + public ApiAppUpdateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ApiAppUpdateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppUpdateRequest.class); + } + + static public ApiAppUpdateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ApiAppUpdateRequest.class + ); + } + + public ApiAppUpdateRequest callbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; + } + + /** + * The URL at which the API App should receive event callbacks. + * @return callbackUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCallbackUrl() { + return callbackUrl; + } + + + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + } + + + public ApiAppUpdateRequest customLogoFile(@javax.annotation.Nullable File customLogoFile) { + this.customLogoFile = customLogoFile; + return this; + } + + /** + * An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) + * @return customLogoFile + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public File getCustomLogoFile() { + return customLogoFile; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomLogoFile(@javax.annotation.Nullable File customLogoFile) { + this.customLogoFile = customLogoFile; + } + + + public ApiAppUpdateRequest domains(@javax.annotation.Nullable List domains) { + this.domains = domains; + return this; + } + + public ApiAppUpdateRequest addDomainsItem(String domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); + } + this.domains.add(domainsItem); + return this; + } + + /** + * The domain names the ApiApp will be associated with. + * @return domains + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDomains() { + return domains; + } + + + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDomains(@javax.annotation.Nullable List domains) { + this.domains = domains; + } + + + public ApiAppUpdateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name you want to assign to the ApiApp. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ApiAppUpdateRequest oauth(@javax.annotation.Nullable SubOAuth oauth) { + this.oauth = oauth; + return this; + } + + /** + * Get oauth + * @return oauth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OAUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubOAuth getOauth() { + return oauth; + } + + + @JsonProperty(JSON_PROPERTY_OAUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOauth(@javax.annotation.Nullable SubOAuth oauth) { + this.oauth = oauth; + } + + + public ApiAppUpdateRequest options(@javax.annotation.Nullable SubOptions options) { + this.options = options; + return this; + } + + /** + * Get options + * @return options + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubOptions getOptions() { + return options; + } + + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOptions(@javax.annotation.Nullable SubOptions options) { + this.options = options; + } + + + public ApiAppUpdateRequest whiteLabelingOptions(@javax.annotation.Nullable SubWhiteLabelingOptions whiteLabelingOptions) { + this.whiteLabelingOptions = whiteLabelingOptions; + return this; + } + + /** + * Get whiteLabelingOptions + * @return whiteLabelingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubWhiteLabelingOptions getWhiteLabelingOptions() { + return whiteLabelingOptions; + } + + + @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhiteLabelingOptions(@javax.annotation.Nullable SubWhiteLabelingOptions whiteLabelingOptions) { + this.whiteLabelingOptions = whiteLabelingOptions; + } + + + /** + * Return true if this ApiAppUpdateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiAppUpdateRequest apiAppUpdateRequest = (ApiAppUpdateRequest) o; + return Objects.equals(this.callbackUrl, apiAppUpdateRequest.callbackUrl) && + Objects.equals(this.customLogoFile, apiAppUpdateRequest.customLogoFile) && + Objects.equals(this.domains, apiAppUpdateRequest.domains) && + Objects.equals(this.name, apiAppUpdateRequest.name) && + Objects.equals(this.oauth, apiAppUpdateRequest.oauth) && + Objects.equals(this.options, apiAppUpdateRequest.options) && + Objects.equals(this.whiteLabelingOptions, apiAppUpdateRequest.whiteLabelingOptions); + } + + @Override + public int hashCode() { + return Objects.hash(callbackUrl, customLogoFile, domains, name, oauth, options, whiteLabelingOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppUpdateRequest {\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" customLogoFile: ").append(toIndentedString(customLogoFile)).append("\n"); + sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" oauth: ").append(toIndentedString(oauth)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" whiteLabelingOptions: ").append(toIndentedString(whiteLabelingOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; } - this.domains.add(domainsItem); - return this; - } - - /** - * The domain names the ApiApp will be associated with. - * - * @return domains - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOMAINS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getDomains() { - return domains; - } - - @JsonProperty(JSON_PROPERTY_DOMAINS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDomains(@javax.annotation.Nullable List domains) { - this.domains = domains; - } - - public ApiAppUpdateRequest name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name you want to assign to the ApiApp. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public ApiAppUpdateRequest oauth(@javax.annotation.Nullable SubOAuth oauth) { - this.oauth = oauth; - return this; - } - - /** - * Get oauth - * - * @return oauth - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OAUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubOAuth getOauth() { - return oauth; - } - @JsonProperty(JSON_PROPERTY_OAUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOauth(@javax.annotation.Nullable SubOAuth oauth) { - this.oauth = oauth; - } - - public ApiAppUpdateRequest options(@javax.annotation.Nullable SubOptions options) { - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubOptions getOptions() { - return options; + if (callbackUrl.getClass().equals(java.io.File.class) || + callbackUrl.getClass().equals(Integer.class) || + callbackUrl.getClass().equals(String.class) || + callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for(int i = 0; i< getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } + else { + map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } } + if (customLogoFile != null) { + if (isFileTypeOrListOfFiles(customLogoFile)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOptions(@javax.annotation.Nullable SubOptions options) { - this.options = options; + if (customLogoFile.getClass().equals(java.io.File.class) || + customLogoFile.getClass().equals(Integer.class) || + customLogoFile.getClass().equals(String.class) || + customLogoFile.getClass().isEnum()) { + map.put("custom_logo_file", customLogoFile); + } else if (isListOfFile(customLogoFile)) { + for(int i = 0; i< getListSize(customLogoFile); i++) { + map.put("custom_logo_file[" + i + "]", getFromList(customLogoFile, i)); + } + } + else { + map.put("custom_logo_file", JSON.getDefault().getMapper().writeValueAsString(customLogoFile)); + } } + if (domains != null) { + if (isFileTypeOrListOfFiles(domains)) { + fileTypeFound = true; + } - public ApiAppUpdateRequest whiteLabelingOptions( - @javax.annotation.Nullable SubWhiteLabelingOptions whiteLabelingOptions) { - this.whiteLabelingOptions = whiteLabelingOptions; - return this; + if (domains.getClass().equals(java.io.File.class) || + domains.getClass().equals(Integer.class) || + domains.getClass().equals(String.class) || + domains.getClass().isEnum()) { + map.put("domains", domains); + } else if (isListOfFile(domains)) { + for(int i = 0; i< getListSize(domains); i++) { + map.put("domains[" + i + "]", getFromList(domains, i)); + } + } + else { + map.put("domains", JSON.getDefault().getMapper().writeValueAsString(domains)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** - * Get whiteLabelingOptions - * - * @return whiteLabelingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubWhiteLabelingOptions getWhiteLabelingOptions() { - return whiteLabelingOptions; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (oauth != null) { + if (isFileTypeOrListOfFiles(oauth)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWhiteLabelingOptions( - @javax.annotation.Nullable SubWhiteLabelingOptions whiteLabelingOptions) { - this.whiteLabelingOptions = whiteLabelingOptions; + if (oauth.getClass().equals(java.io.File.class) || + oauth.getClass().equals(Integer.class) || + oauth.getClass().equals(String.class) || + oauth.getClass().isEnum()) { + map.put("oauth", oauth); + } else if (isListOfFile(oauth)) { + for(int i = 0; i< getListSize(oauth); i++) { + map.put("oauth[" + i + "]", getFromList(oauth, i)); + } + } + else { + map.put("oauth", JSON.getDefault().getMapper().writeValueAsString(oauth)); + } } + if (options != null) { + if (isFileTypeOrListOfFiles(options)) { + fileTypeFound = true; + } - /** Return true if this ApiAppUpdateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (options.getClass().equals(java.io.File.class) || + options.getClass().equals(Integer.class) || + options.getClass().equals(String.class) || + options.getClass().isEnum()) { + map.put("options", options); + } else if (isListOfFile(options)) { + for(int i = 0; i< getListSize(options); i++) { + map.put("options[" + i + "]", getFromList(options, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); } - ApiAppUpdateRequest apiAppUpdateRequest = (ApiAppUpdateRequest) o; - return Objects.equals(this.callbackUrl, apiAppUpdateRequest.callbackUrl) - && Objects.equals(this.customLogoFile, apiAppUpdateRequest.customLogoFile) - && Objects.equals(this.domains, apiAppUpdateRequest.domains) - && Objects.equals(this.name, apiAppUpdateRequest.name) - && Objects.equals(this.oauth, apiAppUpdateRequest.oauth) - && Objects.equals(this.options, apiAppUpdateRequest.options) - && Objects.equals( - this.whiteLabelingOptions, apiAppUpdateRequest.whiteLabelingOptions); } + if (whiteLabelingOptions != null) { + if (isFileTypeOrListOfFiles(whiteLabelingOptions)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - callbackUrl, customLogoFile, domains, name, oauth, options, whiteLabelingOptions); + if (whiteLabelingOptions.getClass().equals(java.io.File.class) || + whiteLabelingOptions.getClass().equals(Integer.class) || + whiteLabelingOptions.getClass().equals(String.class) || + whiteLabelingOptions.getClass().isEnum()) { + map.put("white_labeling_options", whiteLabelingOptions); + } else if (isListOfFile(whiteLabelingOptions)) { + for(int i = 0; i< getListSize(whiteLabelingOptions); i++) { + map.put("white_labeling_options[" + i + "]", getFromList(whiteLabelingOptions, i)); + } + } + else { + map.put("white_labeling_options", JSON.getDefault().getMapper().writeValueAsString(whiteLabelingOptions)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppUpdateRequest {\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" customLogoFile: ").append(toIndentedString(customLogoFile)).append("\n"); - sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" oauth: ").append(toIndentedString(oauth)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" whiteLabelingOptions: ") - .append(toIndentedString(whiteLabelingOptions)) - .append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } - - if (callbackUrl.getClass().equals(java.io.File.class) - || callbackUrl.getClass().equals(Integer.class) - || callbackUrl.getClass().equals(String.class) - || callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for (int i = 0; i < getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } else { - map.put( - "callback_url", - JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); - } - } - if (customLogoFile != null) { - if (isFileTypeOrListOfFiles(customLogoFile)) { - fileTypeFound = true; - } - - if (customLogoFile.getClass().equals(java.io.File.class) - || customLogoFile.getClass().equals(Integer.class) - || customLogoFile.getClass().equals(String.class) - || customLogoFile.getClass().isEnum()) { - map.put("custom_logo_file", customLogoFile); - } else if (isListOfFile(customLogoFile)) { - for (int i = 0; i < getListSize(customLogoFile); i++) { - map.put("custom_logo_file[" + i + "]", getFromList(customLogoFile, i)); - } - } else { - map.put( - "custom_logo_file", - JSON.getDefault().getMapper().writeValueAsString(customLogoFile)); - } - } - if (domains != null) { - if (isFileTypeOrListOfFiles(domains)) { - fileTypeFound = true; - } - - if (domains.getClass().equals(java.io.File.class) - || domains.getClass().equals(Integer.class) - || domains.getClass().equals(String.class) - || domains.getClass().isEnum()) { - map.put("domains", domains); - } else if (isListOfFile(domains)) { - for (int i = 0; i < getListSize(domains); i++) { - map.put("domains[" + i + "]", getFromList(domains, i)); - } - } else { - map.put("domains", JSON.getDefault().getMapper().writeValueAsString(domains)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (oauth != null) { - if (isFileTypeOrListOfFiles(oauth)) { - fileTypeFound = true; - } - - if (oauth.getClass().equals(java.io.File.class) - || oauth.getClass().equals(Integer.class) - || oauth.getClass().equals(String.class) - || oauth.getClass().isEnum()) { - map.put("oauth", oauth); - } else if (isListOfFile(oauth)) { - for (int i = 0; i < getListSize(oauth); i++) { - map.put("oauth[" + i + "]", getFromList(oauth, i)); - } - } else { - map.put("oauth", JSON.getDefault().getMapper().writeValueAsString(oauth)); - } - } - if (options != null) { - if (isFileTypeOrListOfFiles(options)) { - fileTypeFound = true; - } - - if (options.getClass().equals(java.io.File.class) - || options.getClass().equals(Integer.class) - || options.getClass().equals(String.class) - || options.getClass().isEnum()) { - map.put("options", options); - } else if (isListOfFile(options)) { - for (int i = 0; i < getListSize(options); i++) { - map.put("options[" + i + "]", getFromList(options, i)); - } - } else { - map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); - } - } - if (whiteLabelingOptions != null) { - if (isFileTypeOrListOfFiles(whiteLabelingOptions)) { - fileTypeFound = true; - } - - if (whiteLabelingOptions.getClass().equals(java.io.File.class) - || whiteLabelingOptions.getClass().equals(Integer.class) - || whiteLabelingOptions.getClass().equals(String.class) - || whiteLabelingOptions.getClass().isEnum()) { - map.put("white_labeling_options", whiteLabelingOptions); - } else if (isListOfFile(whiteLabelingOptions)) { - for (int i = 0; i < getListSize(whiteLabelingOptions); i++) { - map.put( - "white_labeling_options[" + i + "]", - getFromList(whiteLabelingOptions, i)); - } - } else { - map.put( - "white_labeling_options", - JSON.getDefault().getMapper().writeValueAsString(whiteLabelingOptions)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java index 80ade2f0d..cd51594fe 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java @@ -10,335 +10,345 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.BulkSendJobGetResponseSignatureRequests; +import com.dropbox.sign.model.BulkSendJobResponse; +import com.dropbox.sign.model.ListInfoResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** BulkSendJobGetResponse */ +import com.dropbox.sign.ApiException; +/** + * BulkSendJobGetResponse + */ @JsonPropertyOrder({ - BulkSendJobGetResponse.JSON_PROPERTY_BULK_SEND_JOB, - BulkSendJobGetResponse.JSON_PROPERTY_LIST_INFO, - BulkSendJobGetResponse.JSON_PROPERTY_SIGNATURE_REQUESTS, - BulkSendJobGetResponse.JSON_PROPERTY_WARNINGS + BulkSendJobGetResponse.JSON_PROPERTY_BULK_SEND_JOB, + BulkSendJobGetResponse.JSON_PROPERTY_LIST_INFO, + BulkSendJobGetResponse.JSON_PROPERTY_SIGNATURE_REQUESTS, + BulkSendJobGetResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class BulkSendJobGetResponse { - public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; - @javax.annotation.Nonnull private BulkSendJobResponse bulkSendJob; - - public static final String JSON_PROPERTY_LIST_INFO = "list_info"; - @javax.annotation.Nonnull private ListInfoResponse listInfo; - - public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; - - @javax.annotation.Nonnull - private List signatureRequests = new ArrayList<>(); - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public BulkSendJobGetResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static BulkSendJobGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, BulkSendJobGetResponse.class); - } - - public static BulkSendJobGetResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), BulkSendJobGetResponse.class); - } - - public BulkSendJobGetResponse bulkSendJob( - @javax.annotation.Nonnull BulkSendJobResponse bulkSendJob) { - this.bulkSendJob = bulkSendJob; - return this; + public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; + @javax.annotation.Nonnull + private BulkSendJobResponse bulkSendJob; + + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + @javax.annotation.Nonnull + private ListInfoResponse listInfo; + + public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; + @javax.annotation.Nonnull + private List signatureRequests = new ArrayList<>(); + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public BulkSendJobGetResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public BulkSendJobGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, BulkSendJobGetResponse.class); + } + + static public BulkSendJobGetResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + BulkSendJobGetResponse.class + ); + } + + public BulkSendJobGetResponse bulkSendJob(@javax.annotation.Nonnull BulkSendJobResponse bulkSendJob) { + this.bulkSendJob = bulkSendJob; + return this; + } + + /** + * Get bulkSendJob + * @return bulkSendJob + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BulkSendJobResponse getBulkSendJob() { + return bulkSendJob; + } + + + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBulkSendJob(@javax.annotation.Nonnull BulkSendJobResponse bulkSendJob) { + this.bulkSendJob = bulkSendJob; + } + + + public BulkSendJobGetResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; + } + + /** + * Get listInfo + * @return listInfo + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ListInfoResponse getListInfo() { + return listInfo; + } + + + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + } + + + public BulkSendJobGetResponse signatureRequests(@javax.annotation.Nonnull List signatureRequests) { + this.signatureRequests = signatureRequests; + return this; + } + + public BulkSendJobGetResponse addSignatureRequestsItem(BulkSendJobGetResponseSignatureRequests signatureRequestsItem) { + if (this.signatureRequests == null) { + this.signatureRequests = new ArrayList<>(); } - - /** - * Get bulkSendJob - * - * @return bulkSendJob - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BulkSendJobResponse getBulkSendJob() { - return bulkSendJob; + this.signatureRequests.add(signatureRequestsItem); + return this; + } + + /** + * Contains information about the Signature Requests sent in bulk. + * @return signatureRequests + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSignatureRequests() { + return signatureRequests; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignatureRequests(@javax.annotation.Nonnull List signatureRequests) { + this.signatureRequests = signatureRequests; + } + + + public BulkSendJobGetResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public BulkSendJobGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } - - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setBulkSendJob(@javax.annotation.Nonnull BulkSendJobResponse bulkSendJob) { - this.bulkSendJob = bulkSendJob; - } - - public BulkSendJobGetResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - return this; - } - - /** - * Get listInfo - * - * @return listInfo - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ListInfoResponse getListInfo() { - return listInfo; - } - - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this BulkSendJobGetResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public BulkSendJobGetResponse signatureRequests( - @javax.annotation.Nonnull - List signatureRequests) { - this.signatureRequests = signatureRequests; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - public BulkSendJobGetResponse addSignatureRequestsItem( - BulkSendJobGetResponseSignatureRequests signatureRequestsItem) { - if (this.signatureRequests == null) { - this.signatureRequests = new ArrayList<>(); + BulkSendJobGetResponse bulkSendJobGetResponse = (BulkSendJobGetResponse) o; + return Objects.equals(this.bulkSendJob, bulkSendJobGetResponse.bulkSendJob) && + Objects.equals(this.listInfo, bulkSendJobGetResponse.listInfo) && + Objects.equals(this.signatureRequests, bulkSendJobGetResponse.signatureRequests) && + Objects.equals(this.warnings, bulkSendJobGetResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(bulkSendJob, listInfo, signatureRequests, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkSendJobGetResponse {\n"); + sb.append(" bulkSendJob: ").append(toIndentedString(bulkSendJob)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" signatureRequests: ").append(toIndentedString(signatureRequests)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (bulkSendJob != null) { + if (isFileTypeOrListOfFiles(bulkSendJob)) { + fileTypeFound = true; } - this.signatureRequests.add(signatureRequestsItem); - return this; - } - - /** - * Contains information about the Signature Requests sent in bulk. - * - * @return signatureRequests - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getSignatureRequests() { - return signatureRequests; - } - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSignatureRequests( - @javax.annotation.Nonnull - List signatureRequests) { - this.signatureRequests = signatureRequests; - } - - public BulkSendJobGetResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public BulkSendJobGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + if (bulkSendJob.getClass().equals(java.io.File.class) || + bulkSendJob.getClass().equals(Integer.class) || + bulkSendJob.getClass().equals(String.class) || + bulkSendJob.getClass().isEnum()) { + map.put("bulk_send_job", bulkSendJob); + } else if (isListOfFile(bulkSendJob)) { + for(int i = 0; i< getListSize(bulkSendJob); i++) { + map.put("bulk_send_job[" + i + "]", getFromList(bulkSendJob, i)); + } + } + else { + map.put("bulk_send_job", JSON.getDefault().getMapper().writeValueAsString(bulkSendJob)); } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; } + if (listInfo != null) { + if (isFileTypeOrListOfFiles(listInfo)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; + if (listInfo.getClass().equals(java.io.File.class) || + listInfo.getClass().equals(Integer.class) || + listInfo.getClass().equals(String.class) || + listInfo.getClass().isEnum()) { + map.put("list_info", listInfo); + } else if (isListOfFile(listInfo)) { + for(int i = 0; i< getListSize(listInfo); i++) { + map.put("list_info[" + i + "]", getFromList(listInfo, i)); + } + } + else { + map.put("list_info", JSON.getDefault().getMapper().writeValueAsString(listInfo)); + } } + if (signatureRequests != null) { + if (isFileTypeOrListOfFiles(signatureRequests)) { + fileTypeFound = true; + } - /** Return true if this BulkSendJobGetResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (signatureRequests.getClass().equals(java.io.File.class) || + signatureRequests.getClass().equals(Integer.class) || + signatureRequests.getClass().equals(String.class) || + signatureRequests.getClass().isEnum()) { + map.put("signature_requests", signatureRequests); + } else if (isListOfFile(signatureRequests)) { + for(int i = 0; i< getListSize(signatureRequests); i++) { + map.put("signature_requests[" + i + "]", getFromList(signatureRequests, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("signature_requests", JSON.getDefault().getMapper().writeValueAsString(signatureRequests)); } - BulkSendJobGetResponse bulkSendJobGetResponse = (BulkSendJobGetResponse) o; - return Objects.equals(this.bulkSendJob, bulkSendJobGetResponse.bulkSendJob) - && Objects.equals(this.listInfo, bulkSendJobGetResponse.listInfo) - && Objects.equals(this.signatureRequests, bulkSendJobGetResponse.signatureRequests) - && Objects.equals(this.warnings, bulkSendJobGetResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(bulkSendJob, listInfo, signatureRequests, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BulkSendJobGetResponse {\n"); - sb.append(" bulkSendJob: ").append(toIndentedString(bulkSendJob)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); - sb.append(" signatureRequests: ") - .append(toIndentedString(signatureRequests)) - .append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (bulkSendJob != null) { - if (isFileTypeOrListOfFiles(bulkSendJob)) { - fileTypeFound = true; - } - - if (bulkSendJob.getClass().equals(java.io.File.class) - || bulkSendJob.getClass().equals(Integer.class) - || bulkSendJob.getClass().equals(String.class) - || bulkSendJob.getClass().isEnum()) { - map.put("bulk_send_job", bulkSendJob); - } else if (isListOfFile(bulkSendJob)) { - for (int i = 0; i < getListSize(bulkSendJob); i++) { - map.put("bulk_send_job[" + i + "]", getFromList(bulkSendJob, i)); - } - } else { - map.put( - "bulk_send_job", - JSON.getDefault().getMapper().writeValueAsString(bulkSendJob)); - } - } - if (listInfo != null) { - if (isFileTypeOrListOfFiles(listInfo)) { - fileTypeFound = true; - } - - if (listInfo.getClass().equals(java.io.File.class) - || listInfo.getClass().equals(Integer.class) - || listInfo.getClass().equals(String.class) - || listInfo.getClass().isEnum()) { - map.put("list_info", listInfo); - } else if (isListOfFile(listInfo)) { - for (int i = 0; i < getListSize(listInfo); i++) { - map.put("list_info[" + i + "]", getFromList(listInfo, i)); - } - } else { - map.put( - "list_info", - JSON.getDefault().getMapper().writeValueAsString(listInfo)); - } - } - if (signatureRequests != null) { - if (isFileTypeOrListOfFiles(signatureRequests)) { - fileTypeFound = true; - } - - if (signatureRequests.getClass().equals(java.io.File.class) - || signatureRequests.getClass().equals(Integer.class) - || signatureRequests.getClass().equals(String.class) - || signatureRequests.getClass().isEnum()) { - map.put("signature_requests", signatureRequests); - } else if (isListOfFile(signatureRequests)) { - for (int i = 0; i < getListSize(signatureRequests); i++) { - map.put("signature_requests[" + i + "]", getFromList(signatureRequests, i)); - } - } else { - map.put( - "signature_requests", - JSON.getDefault().getMapper().writeValueAsString(signatureRequests)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java index dc04b97e4..ec20435b7 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java @@ -10,1471 +10,1458 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseAttachment; +import com.dropbox.sign.model.SignatureRequestResponseCustomFieldBase; +import com.dropbox.sign.model.SignatureRequestResponseDataBase; +import com.dropbox.sign.model.SignatureRequestResponseSignatures; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** BulkSendJobGetResponseSignatureRequests */ +import com.dropbox.sign.ApiException; +/** + * BulkSendJobGetResponseSignatureRequests + */ @JsonPropertyOrder({ - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_TEST_MODE, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNATURE_REQUEST_ID, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_TITLE, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_ORIGINAL_TITLE, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SUBJECT, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_MESSAGE, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_METADATA, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_CREATED_AT, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_EXPIRES_AT, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_IS_COMPLETE, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_IS_DECLINED, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_HAS_ERROR, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_FILES_URL, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNING_URL, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_DETAILS_URL, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNING_REDIRECT_URL, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_FINAL_COPY_URI, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_TEMPLATE_IDS, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_CUSTOM_FIELDS, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_ATTACHMENTS, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_RESPONSE_DATA, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNATURES, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_BULK_SEND_JOB_ID + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_TEST_MODE, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNATURE_REQUEST_ID, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_TITLE, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_ORIGINAL_TITLE, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SUBJECT, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_MESSAGE, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_METADATA, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_CREATED_AT, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_EXPIRES_AT, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_IS_COMPLETE, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_IS_DECLINED, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_HAS_ERROR, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_FILES_URL, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNING_URL, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_DETAILS_URL, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNING_REDIRECT_URL, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_FINAL_COPY_URI, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_TEMPLATE_IDS, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_CUSTOM_FIELDS, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_ATTACHMENTS, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_RESPONSE_DATA, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNATURES, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_BULK_SEND_JOB_ID }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class BulkSendJobGetResponseSignatureRequests { - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; - @javax.annotation.Nullable private String signatureRequestId; - - public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; - @javax.annotation.Nullable private String requesterEmailAddress; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public static final String JSON_PROPERTY_ORIGINAL_TITLE = "original_title"; - @javax.annotation.Nullable private String originalTitle; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_CREATED_AT = "created_at"; - @javax.annotation.Nullable private Integer createdAt; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public static final String JSON_PROPERTY_IS_COMPLETE = "is_complete"; - @javax.annotation.Nullable private Boolean isComplete; - - public static final String JSON_PROPERTY_IS_DECLINED = "is_declined"; - @javax.annotation.Nullable private Boolean isDeclined; - - public static final String JSON_PROPERTY_HAS_ERROR = "has_error"; - @javax.annotation.Nullable private Boolean hasError; - - public static final String JSON_PROPERTY_FILES_URL = "files_url"; - @javax.annotation.Nullable private String filesUrl; - - public static final String JSON_PROPERTY_SIGNING_URL = "signing_url"; - @javax.annotation.Nullable private String signingUrl; - - public static final String JSON_PROPERTY_DETAILS_URL = "details_url"; - @javax.annotation.Nullable private String detailsUrl; - - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - @javax.annotation.Nullable private List ccEmailAddresses = null; - - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; - public static final String JSON_PROPERTY_FINAL_COPY_URI = "final_copy_uri"; - @javax.annotation.Nullable private String finalCopyUri; + public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; + @javax.annotation.Nullable + private String signatureRequestId; + + public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; + @javax.annotation.Nullable + private String requesterEmailAddress; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "original_title"; + @javax.annotation.Nullable + private String originalTitle; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @javax.annotation.Nullable + private Integer createdAt; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public static final String JSON_PROPERTY_IS_COMPLETE = "is_complete"; + @javax.annotation.Nullable + private Boolean isComplete; + + public static final String JSON_PROPERTY_IS_DECLINED = "is_declined"; + @javax.annotation.Nullable + private Boolean isDeclined; + + public static final String JSON_PROPERTY_HAS_ERROR = "has_error"; + @javax.annotation.Nullable + private Boolean hasError; + + public static final String JSON_PROPERTY_FILES_URL = "files_url"; + @javax.annotation.Nullable + private String filesUrl; + + public static final String JSON_PROPERTY_SIGNING_URL = "signing_url"; + @javax.annotation.Nullable + private String signingUrl; + + public static final String JSON_PROPERTY_DETAILS_URL = "details_url"; + @javax.annotation.Nullable + private String detailsUrl; + + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + @javax.annotation.Nullable + private List ccEmailAddresses = null; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_FINAL_COPY_URI = "final_copy_uri"; + @javax.annotation.Nullable + private String finalCopyUri; + + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + @javax.annotation.Nullable + private List templateIds = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + @javax.annotation.Nullable + private List attachments = null; + + public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; + @javax.annotation.Nullable + private List responseData = null; + + public static final String JSON_PROPERTY_SIGNATURES = "signatures"; + @javax.annotation.Nullable + private List signatures = null; + + public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; + @javax.annotation.Nullable + private String bulkSendJobId; + + public BulkSendJobGetResponseSignatureRequests() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public BulkSendJobGetResponseSignatureRequests init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, BulkSendJobGetResponseSignatureRequests.class); + } + + static public BulkSendJobGetResponseSignatureRequests init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + BulkSendJobGetResponseSignatureRequests.class + ); + } + + public BulkSendJobGetResponseSignatureRequests testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public BulkSendJobGetResponseSignatureRequests signatureRequestId(@javax.annotation.Nullable String signatureRequestId) { + this.signatureRequestId = signatureRequestId; + return this; + } + + /** + * The id of the SignatureRequest. + * @return signatureRequestId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSignatureRequestId() { + return signatureRequestId; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatureRequestId(@javax.annotation.Nullable String signatureRequestId) { + this.signatureRequestId = signatureRequestId; + } + + + public BulkSendJobGetResponseSignatureRequests requesterEmailAddress(@javax.annotation.Nullable String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + return this; + } + + /** + * The email address of the initiator of the SignatureRequest. + * @return requesterEmailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRequesterEmailAddress() { + return requesterEmailAddress; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequesterEmailAddress(@javax.annotation.Nullable String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + } + + + public BulkSendJobGetResponseSignatureRequests title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title the specified Account uses for the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public BulkSendJobGetResponseSignatureRequests originalTitle(@javax.annotation.Nullable String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Default Label for account. + * @return originalTitle + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - @javax.annotation.Nullable private List templateIds = null; + public String getOriginalTitle() { + return originalTitle; + } + + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@javax.annotation.Nullable String originalTitle) { + this.originalTitle = originalTitle; + } + + + public BulkSendJobGetResponseSignatureRequests subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that was initially sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public BulkSendJobGetResponseSignatureRequests message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that was initially sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @javax.annotation.Nullable private List customFields = null; + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public BulkSendJobGetResponseSignatureRequests metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public BulkSendJobGetResponseSignatureRequests putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - @javax.annotation.Nullable private List attachments = null; + /** + * The metadata attached to the signature request. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public BulkSendJobGetResponseSignatureRequests createdAt(@javax.annotation.Nullable Integer createdAt) { + this.createdAt = createdAt; + return this; + } - public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; - @javax.annotation.Nullable private List responseData = null; + /** + * Time the signature request was created. + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@javax.annotation.Nullable Integer createdAt) { + this.createdAt = createdAt; + } + + + public BulkSendJobGetResponseSignatureRequests expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } - public static final String JSON_PROPERTY_SIGNATURES = "signatures"; - @javax.annotation.Nullable private List signatures = null; + /** + * The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + public BulkSendJobGetResponseSignatureRequests isComplete(@javax.annotation.Nullable Boolean isComplete) { + this.isComplete = isComplete; + return this; + } - public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; - @javax.annotation.Nullable private String bulkSendJobId; + /** + * Whether or not the SignatureRequest has been fully executed by all signers. + * @return isComplete + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsComplete() { + return isComplete; + } + + + @JsonProperty(JSON_PROPERTY_IS_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsComplete(@javax.annotation.Nullable Boolean isComplete) { + this.isComplete = isComplete; + } + + + public BulkSendJobGetResponseSignatureRequests isDeclined(@javax.annotation.Nullable Boolean isDeclined) { + this.isDeclined = isDeclined; + return this; + } + + /** + * Whether or not the SignatureRequest has been declined by a signer. + * @return isDeclined + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_DECLINED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsDeclined() { + return isDeclined; + } + + + @JsonProperty(JSON_PROPERTY_IS_DECLINED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDeclined(@javax.annotation.Nullable Boolean isDeclined) { + this.isDeclined = isDeclined; + } + + + public BulkSendJobGetResponseSignatureRequests hasError(@javax.annotation.Nullable Boolean hasError) { + this.hasError = hasError; + return this; + } + + /** + * Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). + * @return hasError + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BulkSendJobGetResponseSignatureRequests() {} + public Boolean getHasError() { + return hasError; + } + + + @JsonProperty(JSON_PROPERTY_HAS_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasError(@javax.annotation.Nullable Boolean hasError) { + this.hasError = hasError; + } + + + public BulkSendJobGetResponseSignatureRequests filesUrl(@javax.annotation.Nullable String filesUrl) { + this.filesUrl = filesUrl; + return this; + } + + /** + * The URL where a copy of the request's documents can be downloaded. + * @return filesUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static BulkSendJobGetResponseSignatureRequests init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, BulkSendJobGetResponseSignatureRequests.class); - } - - public static BulkSendJobGetResponseSignatureRequests init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - BulkSendJobGetResponseSignatureRequests.class); - } - - public BulkSendJobGetResponseSignatureRequests testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; - } - - /** - * Whether this is a test signature request. Test requests have no legal value. Defaults to - * `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; - } - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - } - - public BulkSendJobGetResponseSignatureRequests signatureRequestId( - @javax.annotation.Nullable String signatureRequestId) { - this.signatureRequestId = signatureRequestId; - return this; - } - - /** - * The id of the SignatureRequest. - * - * @return signatureRequestId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSignatureRequestId() { - return signatureRequestId; - } - - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatureRequestId(@javax.annotation.Nullable String signatureRequestId) { - this.signatureRequestId = signatureRequestId; - } - - public BulkSendJobGetResponseSignatureRequests requesterEmailAddress( - @javax.annotation.Nullable String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - return this; - } + public String getFilesUrl() { + return filesUrl; + } + + + @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilesUrl(@javax.annotation.Nullable String filesUrl) { + this.filesUrl = filesUrl; + } + + + public BulkSendJobGetResponseSignatureRequests signingUrl(@javax.annotation.Nullable String signingUrl) { + this.signingUrl = signingUrl; + return this; + } + + /** + * The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. + * @return signingUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - /** - * The email address of the initiator of the SignatureRequest. - * - * @return requesterEmailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRequesterEmailAddress() { - return requesterEmailAddress; - } + public String getSigningUrl() { + return signingUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningUrl(@javax.annotation.Nullable String signingUrl) { + this.signingUrl = signingUrl; + } + + + public BulkSendJobGetResponseSignatureRequests detailsUrl(@javax.annotation.Nullable String detailsUrl) { + this.detailsUrl = detailsUrl; + return this; + } + + /** + * The URL where the requester and the signers can view the current status of the SignatureRequest. + * @return detailsUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DETAILS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequesterEmailAddress(@javax.annotation.Nullable String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - } + public String getDetailsUrl() { + return detailsUrl; + } - public BulkSendJobGetResponseSignatureRequests title(@javax.annotation.Nullable String title) { - this.title = title; - return this; - } - /** - * The title the specified Account uses for the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; - } + @JsonProperty(JSON_PROPERTY_DETAILS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetailsUrl(@javax.annotation.Nullable String detailsUrl) { + this.detailsUrl = detailsUrl; + } + + + public BulkSendJobGetResponseSignatureRequests ccEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; + } + + public BulkSendJobGetResponseSignatureRequests addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); + } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } + + /** + * A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. + * @return ccEmailAddresses + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } + + + public BulkSendJobGetResponseSignatureRequests signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want the signer redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public BulkSendJobGetResponseSignatureRequests finalCopyUri(@javax.annotation.Nullable String finalCopyUri) { + this.finalCopyUri = finalCopyUri; + return this; + } + + /** + * The path where the completed document can be downloaded + * @return finalCopyUri + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFinalCopyUri() { + return finalCopyUri; + } + + + @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFinalCopyUri(@javax.annotation.Nullable String finalCopyUri) { + this.finalCopyUri = finalCopyUri; + } + + + public BulkSendJobGetResponseSignatureRequests templateIds(@javax.annotation.Nullable List templateIds) { + this.templateIds = templateIds; + return this; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + public BulkSendJobGetResponseSignatureRequests addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Templates IDs used in this SignatureRequest (if any). + * @return templateIds + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTemplateIds() { + return templateIds; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateIds(@javax.annotation.Nullable List templateIds) { + this.templateIds = templateIds; + } + + + public BulkSendJobGetResponseSignatureRequests customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } - public BulkSendJobGetResponseSignatureRequests originalTitle( - @javax.annotation.Nullable String originalTitle) { - this.originalTitle = originalTitle; - return this; + public BulkSendJobGetResponseSignatureRequests addCustomFieldsItem(SignatureRequestResponseCustomFieldBase customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } - /** - * Default Label for account. - * - * @return originalTitle - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getOriginalTitle() { - return originalTitle; - } - - @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOriginalTitle(@javax.annotation.Nullable String originalTitle) { - this.originalTitle = originalTitle; - } - - public BulkSendJobGetResponseSignatureRequests subject( - @javax.annotation.Nullable String subject) { - this.subject = subject; - return this; - } - - /** - * The subject in the email that was initially sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; - } - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; - } - - public BulkSendJobGetResponseSignatureRequests message( - @javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that was initially sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } + public BulkSendJobGetResponseSignatureRequests attachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + return this; + } + + public BulkSendJobGetResponseSignatureRequests addAttachmentsItem(SignatureRequestResponseAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * Signer attachments. + * @return attachments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } - public BulkSendJobGetResponseSignatureRequests metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - public BulkSendJobGetResponseSignatureRequests putMetadataItem( - String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + } + + + public BulkSendJobGetResponseSignatureRequests responseData(@javax.annotation.Nullable List responseData) { + this.responseData = responseData; + return this; + } + + public BulkSendJobGetResponseSignatureRequests addResponseDataItem(SignatureRequestResponseDataBase responseDataItem) { + if (this.responseData == null) { + this.responseData = new ArrayList<>(); + } + this.responseData.add(responseDataItem); + return this; + } + + /** + * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. + * @return responseData + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getResponseData() { + return responseData; + } + + + @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseData(@javax.annotation.Nullable List responseData) { + this.responseData = responseData; + } + + + public BulkSendJobGetResponseSignatureRequests signatures(@javax.annotation.Nullable List signatures) { + this.signatures = signatures; + return this; + } + + public BulkSendJobGetResponseSignatureRequests addSignaturesItem(SignatureRequestResponseSignatures signaturesItem) { + if (this.signatures == null) { + this.signatures = new ArrayList<>(); + } + this.signatures.add(signaturesItem); + return this; + } + + /** + * An array of signature objects, 1 for each signer. + * @return signatures + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSignatures() { + return signatures; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatures(@javax.annotation.Nullable List signatures) { + this.signatures = signatures; + } + + + public BulkSendJobGetResponseSignatureRequests bulkSendJobId(@javax.annotation.Nullable String bulkSendJobId) { + this.bulkSendJobId = bulkSendJobId; + return this; + } + + /** + * The id of the BulkSendJob. + * @return bulkSendJobId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBulkSendJobId() { + return bulkSendJobId; + } + + + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBulkSendJobId(@javax.annotation.Nullable String bulkSendJobId) { + this.bulkSendJobId = bulkSendJobId; + } + + + /** + * Return true if this BulkSendJobGetResponseSignatureRequests object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkSendJobGetResponseSignatureRequests bulkSendJobGetResponseSignatureRequests = (BulkSendJobGetResponseSignatureRequests) o; + return Objects.equals(this.testMode, bulkSendJobGetResponseSignatureRequests.testMode) && + Objects.equals(this.signatureRequestId, bulkSendJobGetResponseSignatureRequests.signatureRequestId) && + Objects.equals(this.requesterEmailAddress, bulkSendJobGetResponseSignatureRequests.requesterEmailAddress) && + Objects.equals(this.title, bulkSendJobGetResponseSignatureRequests.title) && + Objects.equals(this.originalTitle, bulkSendJobGetResponseSignatureRequests.originalTitle) && + Objects.equals(this.subject, bulkSendJobGetResponseSignatureRequests.subject) && + Objects.equals(this.message, bulkSendJobGetResponseSignatureRequests.message) && + Objects.equals(this.metadata, bulkSendJobGetResponseSignatureRequests.metadata) && + Objects.equals(this.createdAt, bulkSendJobGetResponseSignatureRequests.createdAt) && + Objects.equals(this.expiresAt, bulkSendJobGetResponseSignatureRequests.expiresAt) && + Objects.equals(this.isComplete, bulkSendJobGetResponseSignatureRequests.isComplete) && + Objects.equals(this.isDeclined, bulkSendJobGetResponseSignatureRequests.isDeclined) && + Objects.equals(this.hasError, bulkSendJobGetResponseSignatureRequests.hasError) && + Objects.equals(this.filesUrl, bulkSendJobGetResponseSignatureRequests.filesUrl) && + Objects.equals(this.signingUrl, bulkSendJobGetResponseSignatureRequests.signingUrl) && + Objects.equals(this.detailsUrl, bulkSendJobGetResponseSignatureRequests.detailsUrl) && + Objects.equals(this.ccEmailAddresses, bulkSendJobGetResponseSignatureRequests.ccEmailAddresses) && + Objects.equals(this.signingRedirectUrl, bulkSendJobGetResponseSignatureRequests.signingRedirectUrl) && + Objects.equals(this.finalCopyUri, bulkSendJobGetResponseSignatureRequests.finalCopyUri) && + Objects.equals(this.templateIds, bulkSendJobGetResponseSignatureRequests.templateIds) && + Objects.equals(this.customFields, bulkSendJobGetResponseSignatureRequests.customFields) && + Objects.equals(this.attachments, bulkSendJobGetResponseSignatureRequests.attachments) && + Objects.equals(this.responseData, bulkSendJobGetResponseSignatureRequests.responseData) && + Objects.equals(this.signatures, bulkSendJobGetResponseSignatureRequests.signatures) && + Objects.equals(this.bulkSendJobId, bulkSendJobGetResponseSignatureRequests.bulkSendJobId); + } + + @Override + public int hashCode() { + return Objects.hash(testMode, signatureRequestId, requesterEmailAddress, title, originalTitle, subject, message, metadata, createdAt, expiresAt, isComplete, isDeclined, hasError, filesUrl, signingUrl, detailsUrl, ccEmailAddresses, signingRedirectUrl, finalCopyUri, templateIds, customFields, attachments, responseData, signatures, bulkSendJobId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkSendJobGetResponseSignatureRequests {\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" signatureRequestId: ").append(toIndentedString(signatureRequestId)).append("\n"); + sb.append(" requesterEmailAddress: ").append(toIndentedString(requesterEmailAddress)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" isComplete: ").append(toIndentedString(isComplete)).append("\n"); + sb.append(" isDeclined: ").append(toIndentedString(isDeclined)).append("\n"); + sb.append(" hasError: ").append(toIndentedString(hasError)).append("\n"); + sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); + sb.append(" signingUrl: ").append(toIndentedString(signingUrl)).append("\n"); + sb.append(" detailsUrl: ").append(toIndentedString(detailsUrl)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" finalCopyUri: ").append(toIndentedString(finalCopyUri)).append("\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" responseData: ").append(toIndentedString(responseData)).append("\n"); + sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); + sb.append(" bulkSendJobId: ").append(toIndentedString(bulkSendJobId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * The metadata attached to the signature request. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public BulkSendJobGetResponseSignatureRequests createdAt( - @javax.annotation.Nullable Integer createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Time the signature request was created. - * - * @return createdAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getCreatedAt() { - return createdAt; - } - - @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCreatedAt(@javax.annotation.Nullable Integer createdAt) { - this.createdAt = createdAt; - } - - public BulkSendJobGetResponseSignatureRequests expiresAt( - @javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * The time when the signature request will expire unsigned signatures. See [Signature Request - * Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for - * details. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; - } - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - } - - public BulkSendJobGetResponseSignatureRequests isComplete( - @javax.annotation.Nullable Boolean isComplete) { - this.isComplete = isComplete; - return this; - } - - /** - * Whether or not the SignatureRequest has been fully executed by all signers. - * - * @return isComplete - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsComplete() { - return isComplete; - } - - @JsonProperty(JSON_PROPERTY_IS_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsComplete(@javax.annotation.Nullable Boolean isComplete) { - this.isComplete = isComplete; - } - - public BulkSendJobGetResponseSignatureRequests isDeclined( - @javax.annotation.Nullable Boolean isDeclined) { - this.isDeclined = isDeclined; - return this; - } - - /** - * Whether or not the SignatureRequest has been declined by a signer. - * - * @return isDeclined - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_DECLINED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsDeclined() { - return isDeclined; - } - - @JsonProperty(JSON_PROPERTY_IS_DECLINED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsDeclined(@javax.annotation.Nullable Boolean isDeclined) { - this.isDeclined = isDeclined; - } - - public BulkSendJobGetResponseSignatureRequests hasError( - @javax.annotation.Nullable Boolean hasError) { - this.hasError = hasError; - return this; - } - - /** - * Whether or not an error occurred (either during the creation of the SignatureRequest or - * during one of the signings). - * - * @return hasError - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHasError() { - return hasError; - } - - @JsonProperty(JSON_PROPERTY_HAS_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasError(@javax.annotation.Nullable Boolean hasError) { - this.hasError = hasError; - } - - public BulkSendJobGetResponseSignatureRequests filesUrl( - @javax.annotation.Nullable String filesUrl) { - this.filesUrl = filesUrl; - return this; - } - - /** - * The URL where a copy of the request's documents can be downloaded. - * - * @return filesUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFilesUrl() { - return filesUrl; - } - - @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFilesUrl(@javax.annotation.Nullable String filesUrl) { - this.filesUrl = filesUrl; - } - - public BulkSendJobGetResponseSignatureRequests signingUrl( - @javax.annotation.Nullable String signingUrl) { - this.signingUrl = signingUrl; - return this; - } - - /** - * The URL where a signer, after authenticating, can sign the documents. This should only be - * used by users with existing Dropbox Sign accounts as they will be required to log in before - * signing. - * - * @return signingUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningUrl() { - return signingUrl; - } - - @JsonProperty(JSON_PROPERTY_SIGNING_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningUrl(@javax.annotation.Nullable String signingUrl) { - this.signingUrl = signingUrl; - } - - public BulkSendJobGetResponseSignatureRequests detailsUrl( - @javax.annotation.Nullable String detailsUrl) { - this.detailsUrl = detailsUrl; - return this; - } - /** - * The URL where the requester and the signers can view the current status of the - * SignatureRequest. - * - * @return detailsUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DETAILS_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getDetailsUrl() { - return detailsUrl; - } - - @JsonProperty(JSON_PROPERTY_DETAILS_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDetailsUrl(@javax.annotation.Nullable String detailsUrl) { - this.detailsUrl = detailsUrl; - } - - public BulkSendJobGetResponseSignatureRequests ccEmailAddresses( - @javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public BulkSendJobGetResponseSignatureRequests addCcEmailAddressesItem( - String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); } - this.ccEmailAddresses.add(ccEmailAddressesItem); - return this; - } - - /** - * A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of - * the final PDF once all the signers have signed. - * - * @return ccEmailAddresses - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } - - public BulkSendJobGetResponseSignatureRequests signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } - - /** - * The URL you want the signer redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - public BulkSendJobGetResponseSignatureRequests finalCopyUri( - @javax.annotation.Nullable String finalCopyUri) { - this.finalCopyUri = finalCopyUri; - return this; - } - - /** - * The path where the completed document can be downloaded - * - * @return finalCopyUri - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFinalCopyUri() { - return finalCopyUri; - } - - @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFinalCopyUri(@javax.annotation.Nullable String finalCopyUri) { - this.finalCopyUri = finalCopyUri; - } - - public BulkSendJobGetResponseSignatureRequests templateIds( - @javax.annotation.Nullable List templateIds) { - this.templateIds = templateIds; - return this; } + if (signatureRequestId != null) { + if (isFileTypeOrListOfFiles(signatureRequestId)) { + fileTypeFound = true; + } - public BulkSendJobGetResponseSignatureRequests addTemplateIdsItem(String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); + if (signatureRequestId.getClass().equals(java.io.File.class) || + signatureRequestId.getClass().equals(Integer.class) || + signatureRequestId.getClass().equals(String.class) || + signatureRequestId.getClass().isEnum()) { + map.put("signature_request_id", signatureRequestId); + } else if (isListOfFile(signatureRequestId)) { + for(int i = 0; i< getListSize(signatureRequestId); i++) { + map.put("signature_request_id[" + i + "]", getFromList(signatureRequestId, i)); + } + } + else { + map.put("signature_request_id", JSON.getDefault().getMapper().writeValueAsString(signatureRequestId)); } - this.templateIds.add(templateIdsItem); - return this; } + if (requesterEmailAddress != null) { + if (isFileTypeOrListOfFiles(requesterEmailAddress)) { + fileTypeFound = true; + } - /** - * Templates IDs used in this SignatureRequest (if any). - * - * @return templateIds - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getTemplateIds() { - return templateIds; + if (requesterEmailAddress.getClass().equals(java.io.File.class) || + requesterEmailAddress.getClass().equals(Integer.class) || + requesterEmailAddress.getClass().equals(String.class) || + requesterEmailAddress.getClass().isEnum()) { + map.put("requester_email_address", requesterEmailAddress); + } else if (isListOfFile(requesterEmailAddress)) { + for(int i = 0; i< getListSize(requesterEmailAddress); i++) { + map.put("requester_email_address[" + i + "]", getFromList(requesterEmailAddress, i)); + } + } + else { + map.put("requester_email_address", JSON.getDefault().getMapper().writeValueAsString(requesterEmailAddress)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplateIds(@javax.annotation.Nullable List templateIds) { - this.templateIds = templateIds; + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } + if (originalTitle != null) { + if (isFileTypeOrListOfFiles(originalTitle)) { + fileTypeFound = true; + } - public BulkSendJobGetResponseSignatureRequests customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; + if (originalTitle.getClass().equals(java.io.File.class) || + originalTitle.getClass().equals(Integer.class) || + originalTitle.getClass().equals(String.class) || + originalTitle.getClass().isEnum()) { + map.put("original_title", originalTitle); + } else if (isListOfFile(originalTitle)) { + for(int i = 0; i< getListSize(originalTitle); i++) { + map.put("original_title[" + i + "]", getFromList(originalTitle, i)); + } + } + else { + map.put("original_title", JSON.getDefault().getMapper().writeValueAsString(originalTitle)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - public BulkSendJobGetResponseSignatureRequests addCustomFieldsItem( - SignatureRequestResponseCustomFieldBase customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); } - this.customFields.add(customFieldsItem); - return this; } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - /** - * An array of Custom Field objects containing the name and type of each custom field. * Text - * Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses - * `SignatureRequestResponseCustomFieldCheckbox` - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (createdAt != null) { + if (isFileTypeOrListOfFiles(createdAt)) { + fileTypeFound = true; + } - public BulkSendJobGetResponseSignatureRequests attachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; - return this; + if (createdAt.getClass().equals(java.io.File.class) || + createdAt.getClass().equals(Integer.class) || + createdAt.getClass().equals(String.class) || + createdAt.getClass().isEnum()) { + map.put("created_at", createdAt); + } else if (isListOfFile(createdAt)) { + for(int i = 0; i< getListSize(createdAt); i++) { + map.put("created_at[" + i + "]", getFromList(createdAt, i)); + } + } + else { + map.put("created_at", JSON.getDefault().getMapper().writeValueAsString(createdAt)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - public BulkSendJobGetResponseSignatureRequests addAttachmentsItem( - SignatureRequestResponseAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); } - this.attachments.add(attachmentsItem); - return this; } + if (isComplete != null) { + if (isFileTypeOrListOfFiles(isComplete)) { + fileTypeFound = true; + } - /** - * Signer attachments. - * - * @return attachments - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAttachments() { - return attachments; + if (isComplete.getClass().equals(java.io.File.class) || + isComplete.getClass().equals(Integer.class) || + isComplete.getClass().equals(String.class) || + isComplete.getClass().isEnum()) { + map.put("is_complete", isComplete); + } else if (isListOfFile(isComplete)) { + for(int i = 0; i< getListSize(isComplete); i++) { + map.put("is_complete[" + i + "]", getFromList(isComplete, i)); + } + } + else { + map.put("is_complete", JSON.getDefault().getMapper().writeValueAsString(isComplete)); + } } + if (isDeclined != null) { + if (isFileTypeOrListOfFiles(isDeclined)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; + if (isDeclined.getClass().equals(java.io.File.class) || + isDeclined.getClass().equals(Integer.class) || + isDeclined.getClass().equals(String.class) || + isDeclined.getClass().isEnum()) { + map.put("is_declined", isDeclined); + } else if (isListOfFile(isDeclined)) { + for(int i = 0; i< getListSize(isDeclined); i++) { + map.put("is_declined[" + i + "]", getFromList(isDeclined, i)); + } + } + else { + map.put("is_declined", JSON.getDefault().getMapper().writeValueAsString(isDeclined)); + } } + if (hasError != null) { + if (isFileTypeOrListOfFiles(hasError)) { + fileTypeFound = true; + } - public BulkSendJobGetResponseSignatureRequests responseData( - @javax.annotation.Nullable List responseData) { - this.responseData = responseData; - return this; + if (hasError.getClass().equals(java.io.File.class) || + hasError.getClass().equals(Integer.class) || + hasError.getClass().equals(String.class) || + hasError.getClass().isEnum()) { + map.put("has_error", hasError); + } else if (isListOfFile(hasError)) { + for(int i = 0; i< getListSize(hasError); i++) { + map.put("has_error[" + i + "]", getFromList(hasError, i)); + } + } + else { + map.put("has_error", JSON.getDefault().getMapper().writeValueAsString(hasError)); + } } + if (filesUrl != null) { + if (isFileTypeOrListOfFiles(filesUrl)) { + fileTypeFound = true; + } - public BulkSendJobGetResponseSignatureRequests addResponseDataItem( - SignatureRequestResponseDataBase responseDataItem) { - if (this.responseData == null) { - this.responseData = new ArrayList<>(); + if (filesUrl.getClass().equals(java.io.File.class) || + filesUrl.getClass().equals(Integer.class) || + filesUrl.getClass().equals(String.class) || + filesUrl.getClass().isEnum()) { + map.put("files_url", filesUrl); + } else if (isListOfFile(filesUrl)) { + for(int i = 0; i< getListSize(filesUrl); i++) { + map.put("files_url[" + i + "]", getFromList(filesUrl, i)); + } + } + else { + map.put("files_url", JSON.getDefault().getMapper().writeValueAsString(filesUrl)); } - this.responseData.add(responseDataItem); - return this; } + if (signingUrl != null) { + if (isFileTypeOrListOfFiles(signingUrl)) { + fileTypeFound = true; + } - /** - * An array of form field objects containing the name, value, and type of each textbox or - * checkmark field filled in by the signers. - * - * @return responseData - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getResponseData() { - return responseData; + if (signingUrl.getClass().equals(java.io.File.class) || + signingUrl.getClass().equals(Integer.class) || + signingUrl.getClass().equals(String.class) || + signingUrl.getClass().isEnum()) { + map.put("signing_url", signingUrl); + } else if (isListOfFile(signingUrl)) { + for(int i = 0; i< getListSize(signingUrl); i++) { + map.put("signing_url[" + i + "]", getFromList(signingUrl, i)); + } + } + else { + map.put("signing_url", JSON.getDefault().getMapper().writeValueAsString(signingUrl)); + } } + if (detailsUrl != null) { + if (isFileTypeOrListOfFiles(detailsUrl)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setResponseData( - @javax.annotation.Nullable List responseData) { - this.responseData = responseData; + if (detailsUrl.getClass().equals(java.io.File.class) || + detailsUrl.getClass().equals(Integer.class) || + detailsUrl.getClass().equals(String.class) || + detailsUrl.getClass().isEnum()) { + map.put("details_url", detailsUrl); + } else if (isListOfFile(detailsUrl)) { + for(int i = 0; i< getListSize(detailsUrl); i++) { + map.put("details_url[" + i + "]", getFromList(detailsUrl, i)); + } + } + else { + map.put("details_url", JSON.getDefault().getMapper().writeValueAsString(detailsUrl)); + } } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } - public BulkSendJobGetResponseSignatureRequests signatures( - @javax.annotation.Nullable List signatures) { - this.signatures = signatures; - return this; + if (ccEmailAddresses.getClass().equals(java.io.File.class) || + ccEmailAddresses.getClass().equals(Integer.class) || + ccEmailAddresses.getClass().equals(String.class) || + ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for(int i = 0; i< getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } + else { + map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - public BulkSendJobGetResponseSignatureRequests addSignaturesItem( - SignatureRequestResponseSignatures signaturesItem) { - if (this.signatures == null) { - this.signatures = new ArrayList<>(); + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); } - this.signatures.add(signaturesItem); - return this; } + if (finalCopyUri != null) { + if (isFileTypeOrListOfFiles(finalCopyUri)) { + fileTypeFound = true; + } - /** - * An array of signature objects, 1 for each signer. - * - * @return signatures - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSignatures() { - return signatures; + if (finalCopyUri.getClass().equals(java.io.File.class) || + finalCopyUri.getClass().equals(Integer.class) || + finalCopyUri.getClass().equals(String.class) || + finalCopyUri.getClass().isEnum()) { + map.put("final_copy_uri", finalCopyUri); + } else if (isListOfFile(finalCopyUri)) { + for(int i = 0; i< getListSize(finalCopyUri); i++) { + map.put("final_copy_uri[" + i + "]", getFromList(finalCopyUri, i)); + } + } + else { + map.put("final_copy_uri", JSON.getDefault().getMapper().writeValueAsString(finalCopyUri)); + } } + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNATURES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatures( - @javax.annotation.Nullable List signatures) { - this.signatures = signatures; + if (templateIds.getClass().equals(java.io.File.class) || + templateIds.getClass().equals(Integer.class) || + templateIds.getClass().equals(String.class) || + templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for(int i = 0; i< getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } + else { + map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - public BulkSendJobGetResponseSignatureRequests bulkSendJobId( - @javax.annotation.Nullable String bulkSendJobId) { - this.bulkSendJobId = bulkSendJobId; - return this; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } - /** - * The id of the BulkSendJob. - * - * @return bulkSendJobId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBulkSendJobId() { - return bulkSendJobId; + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + } } + if (responseData != null) { + if (isFileTypeOrListOfFiles(responseData)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBulkSendJobId(@javax.annotation.Nullable String bulkSendJobId) { - this.bulkSendJobId = bulkSendJobId; + if (responseData.getClass().equals(java.io.File.class) || + responseData.getClass().equals(Integer.class) || + responseData.getClass().equals(String.class) || + responseData.getClass().isEnum()) { + map.put("response_data", responseData); + } else if (isListOfFile(responseData)) { + for(int i = 0; i< getListSize(responseData); i++) { + map.put("response_data[" + i + "]", getFromList(responseData, i)); + } + } + else { + map.put("response_data", JSON.getDefault().getMapper().writeValueAsString(responseData)); + } } + if (signatures != null) { + if (isFileTypeOrListOfFiles(signatures)) { + fileTypeFound = true; + } - /** Return true if this BulkSendJobGetResponseSignatureRequests object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BulkSendJobGetResponseSignatureRequests bulkSendJobGetResponseSignatureRequests = - (BulkSendJobGetResponseSignatureRequests) o; - return Objects.equals(this.testMode, bulkSendJobGetResponseSignatureRequests.testMode) - && Objects.equals( - this.signatureRequestId, - bulkSendJobGetResponseSignatureRequests.signatureRequestId) - && Objects.equals( - this.requesterEmailAddress, - bulkSendJobGetResponseSignatureRequests.requesterEmailAddress) - && Objects.equals(this.title, bulkSendJobGetResponseSignatureRequests.title) - && Objects.equals( - this.originalTitle, bulkSendJobGetResponseSignatureRequests.originalTitle) - && Objects.equals(this.subject, bulkSendJobGetResponseSignatureRequests.subject) - && Objects.equals(this.message, bulkSendJobGetResponseSignatureRequests.message) - && Objects.equals(this.metadata, bulkSendJobGetResponseSignatureRequests.metadata) - && Objects.equals(this.createdAt, bulkSendJobGetResponseSignatureRequests.createdAt) - && Objects.equals(this.expiresAt, bulkSendJobGetResponseSignatureRequests.expiresAt) - && Objects.equals( - this.isComplete, bulkSendJobGetResponseSignatureRequests.isComplete) - && Objects.equals( - this.isDeclined, bulkSendJobGetResponseSignatureRequests.isDeclined) - && Objects.equals(this.hasError, bulkSendJobGetResponseSignatureRequests.hasError) - && Objects.equals(this.filesUrl, bulkSendJobGetResponseSignatureRequests.filesUrl) - && Objects.equals( - this.signingUrl, bulkSendJobGetResponseSignatureRequests.signingUrl) - && Objects.equals( - this.detailsUrl, bulkSendJobGetResponseSignatureRequests.detailsUrl) - && Objects.equals( - this.ccEmailAddresses, - bulkSendJobGetResponseSignatureRequests.ccEmailAddresses) - && Objects.equals( - this.signingRedirectUrl, - bulkSendJobGetResponseSignatureRequests.signingRedirectUrl) - && Objects.equals( - this.finalCopyUri, bulkSendJobGetResponseSignatureRequests.finalCopyUri) - && Objects.equals( - this.templateIds, bulkSendJobGetResponseSignatureRequests.templateIds) - && Objects.equals( - this.customFields, bulkSendJobGetResponseSignatureRequests.customFields) - && Objects.equals( - this.attachments, bulkSendJobGetResponseSignatureRequests.attachments) - && Objects.equals( - this.responseData, bulkSendJobGetResponseSignatureRequests.responseData) - && Objects.equals( - this.signatures, bulkSendJobGetResponseSignatureRequests.signatures) - && Objects.equals( - this.bulkSendJobId, bulkSendJobGetResponseSignatureRequests.bulkSendJobId); + if (signatures.getClass().equals(java.io.File.class) || + signatures.getClass().equals(Integer.class) || + signatures.getClass().equals(String.class) || + signatures.getClass().isEnum()) { + map.put("signatures", signatures); + } else if (isListOfFile(signatures)) { + for(int i = 0; i< getListSize(signatures); i++) { + map.put("signatures[" + i + "]", getFromList(signatures, i)); + } + } + else { + map.put("signatures", JSON.getDefault().getMapper().writeValueAsString(signatures)); + } } + if (bulkSendJobId != null) { + if (isFileTypeOrListOfFiles(bulkSendJobId)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - testMode, - signatureRequestId, - requesterEmailAddress, - title, - originalTitle, - subject, - message, - metadata, - createdAt, - expiresAt, - isComplete, - isDeclined, - hasError, - filesUrl, - signingUrl, - detailsUrl, - ccEmailAddresses, - signingRedirectUrl, - finalCopyUri, - templateIds, - customFields, - attachments, - responseData, - signatures, - bulkSendJobId); + if (bulkSendJobId.getClass().equals(java.io.File.class) || + bulkSendJobId.getClass().equals(Integer.class) || + bulkSendJobId.getClass().equals(String.class) || + bulkSendJobId.getClass().isEnum()) { + map.put("bulk_send_job_id", bulkSendJobId); + } else if (isListOfFile(bulkSendJobId)) { + for(int i = 0; i< getListSize(bulkSendJobId); i++) { + map.put("bulk_send_job_id[" + i + "]", getFromList(bulkSendJobId, i)); + } + } + else { + map.put("bulk_send_job_id", JSON.getDefault().getMapper().writeValueAsString(bulkSendJobId)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BulkSendJobGetResponseSignatureRequests {\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" signatureRequestId: ") - .append(toIndentedString(signatureRequestId)) - .append("\n"); - sb.append(" requesterEmailAddress: ") - .append(toIndentedString(requesterEmailAddress)) - .append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append(" isComplete: ").append(toIndentedString(isComplete)).append("\n"); - sb.append(" isDeclined: ").append(toIndentedString(isDeclined)).append("\n"); - sb.append(" hasError: ").append(toIndentedString(hasError)).append("\n"); - sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); - sb.append(" signingUrl: ").append(toIndentedString(signingUrl)).append("\n"); - sb.append(" detailsUrl: ").append(toIndentedString(detailsUrl)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" finalCopyUri: ").append(toIndentedString(finalCopyUri)).append("\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" responseData: ").append(toIndentedString(responseData)).append("\n"); - sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); - sb.append(" bulkSendJobId: ").append(toIndentedString(bulkSendJobId)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (signatureRequestId != null) { - if (isFileTypeOrListOfFiles(signatureRequestId)) { - fileTypeFound = true; - } - - if (signatureRequestId.getClass().equals(java.io.File.class) - || signatureRequestId.getClass().equals(Integer.class) - || signatureRequestId.getClass().equals(String.class) - || signatureRequestId.getClass().isEnum()) { - map.put("signature_request_id", signatureRequestId); - } else if (isListOfFile(signatureRequestId)) { - for (int i = 0; i < getListSize(signatureRequestId); i++) { - map.put( - "signature_request_id[" + i + "]", - getFromList(signatureRequestId, i)); - } - } else { - map.put( - "signature_request_id", - JSON.getDefault().getMapper().writeValueAsString(signatureRequestId)); - } - } - if (requesterEmailAddress != null) { - if (isFileTypeOrListOfFiles(requesterEmailAddress)) { - fileTypeFound = true; - } - - if (requesterEmailAddress.getClass().equals(java.io.File.class) - || requesterEmailAddress.getClass().equals(Integer.class) - || requesterEmailAddress.getClass().equals(String.class) - || requesterEmailAddress.getClass().isEnum()) { - map.put("requester_email_address", requesterEmailAddress); - } else if (isListOfFile(requesterEmailAddress)) { - for (int i = 0; i < getListSize(requesterEmailAddress); i++) { - map.put( - "requester_email_address[" + i + "]", - getFromList(requesterEmailAddress, i)); - } - } else { - map.put( - "requester_email_address", - JSON.getDefault() - .getMapper() - .writeValueAsString(requesterEmailAddress)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (originalTitle != null) { - if (isFileTypeOrListOfFiles(originalTitle)) { - fileTypeFound = true; - } - - if (originalTitle.getClass().equals(java.io.File.class) - || originalTitle.getClass().equals(Integer.class) - || originalTitle.getClass().equals(String.class) - || originalTitle.getClass().isEnum()) { - map.put("original_title", originalTitle); - } else if (isListOfFile(originalTitle)) { - for (int i = 0; i < getListSize(originalTitle); i++) { - map.put("original_title[" + i + "]", getFromList(originalTitle, i)); - } - } else { - map.put( - "original_title", - JSON.getDefault().getMapper().writeValueAsString(originalTitle)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (createdAt != null) { - if (isFileTypeOrListOfFiles(createdAt)) { - fileTypeFound = true; - } - - if (createdAt.getClass().equals(java.io.File.class) - || createdAt.getClass().equals(Integer.class) - || createdAt.getClass().equals(String.class) - || createdAt.getClass().isEnum()) { - map.put("created_at", createdAt); - } else if (isListOfFile(createdAt)) { - for (int i = 0; i < getListSize(createdAt); i++) { - map.put("created_at[" + i + "]", getFromList(createdAt, i)); - } - } else { - map.put( - "created_at", - JSON.getDefault().getMapper().writeValueAsString(createdAt)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - if (isComplete != null) { - if (isFileTypeOrListOfFiles(isComplete)) { - fileTypeFound = true; - } - - if (isComplete.getClass().equals(java.io.File.class) - || isComplete.getClass().equals(Integer.class) - || isComplete.getClass().equals(String.class) - || isComplete.getClass().isEnum()) { - map.put("is_complete", isComplete); - } else if (isListOfFile(isComplete)) { - for (int i = 0; i < getListSize(isComplete); i++) { - map.put("is_complete[" + i + "]", getFromList(isComplete, i)); - } - } else { - map.put( - "is_complete", - JSON.getDefault().getMapper().writeValueAsString(isComplete)); - } - } - if (isDeclined != null) { - if (isFileTypeOrListOfFiles(isDeclined)) { - fileTypeFound = true; - } - - if (isDeclined.getClass().equals(java.io.File.class) - || isDeclined.getClass().equals(Integer.class) - || isDeclined.getClass().equals(String.class) - || isDeclined.getClass().isEnum()) { - map.put("is_declined", isDeclined); - } else if (isListOfFile(isDeclined)) { - for (int i = 0; i < getListSize(isDeclined); i++) { - map.put("is_declined[" + i + "]", getFromList(isDeclined, i)); - } - } else { - map.put( - "is_declined", - JSON.getDefault().getMapper().writeValueAsString(isDeclined)); - } - } - if (hasError != null) { - if (isFileTypeOrListOfFiles(hasError)) { - fileTypeFound = true; - } - - if (hasError.getClass().equals(java.io.File.class) - || hasError.getClass().equals(Integer.class) - || hasError.getClass().equals(String.class) - || hasError.getClass().isEnum()) { - map.put("has_error", hasError); - } else if (isListOfFile(hasError)) { - for (int i = 0; i < getListSize(hasError); i++) { - map.put("has_error[" + i + "]", getFromList(hasError, i)); - } - } else { - map.put( - "has_error", - JSON.getDefault().getMapper().writeValueAsString(hasError)); - } - } - if (filesUrl != null) { - if (isFileTypeOrListOfFiles(filesUrl)) { - fileTypeFound = true; - } - - if (filesUrl.getClass().equals(java.io.File.class) - || filesUrl.getClass().equals(Integer.class) - || filesUrl.getClass().equals(String.class) - || filesUrl.getClass().isEnum()) { - map.put("files_url", filesUrl); - } else if (isListOfFile(filesUrl)) { - for (int i = 0; i < getListSize(filesUrl); i++) { - map.put("files_url[" + i + "]", getFromList(filesUrl, i)); - } - } else { - map.put( - "files_url", - JSON.getDefault().getMapper().writeValueAsString(filesUrl)); - } - } - if (signingUrl != null) { - if (isFileTypeOrListOfFiles(signingUrl)) { - fileTypeFound = true; - } - - if (signingUrl.getClass().equals(java.io.File.class) - || signingUrl.getClass().equals(Integer.class) - || signingUrl.getClass().equals(String.class) - || signingUrl.getClass().isEnum()) { - map.put("signing_url", signingUrl); - } else if (isListOfFile(signingUrl)) { - for (int i = 0; i < getListSize(signingUrl); i++) { - map.put("signing_url[" + i + "]", getFromList(signingUrl, i)); - } - } else { - map.put( - "signing_url", - JSON.getDefault().getMapper().writeValueAsString(signingUrl)); - } - } - if (detailsUrl != null) { - if (isFileTypeOrListOfFiles(detailsUrl)) { - fileTypeFound = true; - } - - if (detailsUrl.getClass().equals(java.io.File.class) - || detailsUrl.getClass().equals(Integer.class) - || detailsUrl.getClass().equals(String.class) - || detailsUrl.getClass().isEnum()) { - map.put("details_url", detailsUrl); - } else if (isListOfFile(detailsUrl)) { - for (int i = 0; i < getListSize(detailsUrl); i++) { - map.put("details_url[" + i + "]", getFromList(detailsUrl, i)); - } - } else { - map.put( - "details_url", - JSON.getDefault().getMapper().writeValueAsString(detailsUrl)); - } - } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - - if (ccEmailAddresses.getClass().equals(java.io.File.class) - || ccEmailAddresses.getClass().equals(Integer.class) - || ccEmailAddresses.getClass().equals(String.class) - || ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for (int i = 0; i < getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } else { - map.put( - "cc_email_addresses", - JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (finalCopyUri != null) { - if (isFileTypeOrListOfFiles(finalCopyUri)) { - fileTypeFound = true; - } - - if (finalCopyUri.getClass().equals(java.io.File.class) - || finalCopyUri.getClass().equals(Integer.class) - || finalCopyUri.getClass().equals(String.class) - || finalCopyUri.getClass().isEnum()) { - map.put("final_copy_uri", finalCopyUri); - } else if (isListOfFile(finalCopyUri)) { - for (int i = 0; i < getListSize(finalCopyUri); i++) { - map.put("final_copy_uri[" + i + "]", getFromList(finalCopyUri, i)); - } - } else { - map.put( - "final_copy_uri", - JSON.getDefault().getMapper().writeValueAsString(finalCopyUri)); - } - } - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } - - if (templateIds.getClass().equals(java.io.File.class) - || templateIds.getClass().equals(Integer.class) - || templateIds.getClass().equals(String.class) - || templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for (int i = 0; i < getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } else { - map.put( - "template_ids", - JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - - if (attachments.getClass().equals(java.io.File.class) - || attachments.getClass().equals(Integer.class) - || attachments.getClass().equals(String.class) - || attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for (int i = 0; i < getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } else { - map.put( - "attachments", - JSON.getDefault().getMapper().writeValueAsString(attachments)); - } - } - if (responseData != null) { - if (isFileTypeOrListOfFiles(responseData)) { - fileTypeFound = true; - } - - if (responseData.getClass().equals(java.io.File.class) - || responseData.getClass().equals(Integer.class) - || responseData.getClass().equals(String.class) - || responseData.getClass().isEnum()) { - map.put("response_data", responseData); - } else if (isListOfFile(responseData)) { - for (int i = 0; i < getListSize(responseData); i++) { - map.put("response_data[" + i + "]", getFromList(responseData, i)); - } - } else { - map.put( - "response_data", - JSON.getDefault().getMapper().writeValueAsString(responseData)); - } - } - if (signatures != null) { - if (isFileTypeOrListOfFiles(signatures)) { - fileTypeFound = true; - } - - if (signatures.getClass().equals(java.io.File.class) - || signatures.getClass().equals(Integer.class) - || signatures.getClass().equals(String.class) - || signatures.getClass().isEnum()) { - map.put("signatures", signatures); - } else if (isListOfFile(signatures)) { - for (int i = 0; i < getListSize(signatures); i++) { - map.put("signatures[" + i + "]", getFromList(signatures, i)); - } - } else { - map.put( - "signatures", - JSON.getDefault().getMapper().writeValueAsString(signatures)); - } - } - if (bulkSendJobId != null) { - if (isFileTypeOrListOfFiles(bulkSendJobId)) { - fileTypeFound = true; - } - - if (bulkSendJobId.getClass().equals(java.io.File.class) - || bulkSendJobId.getClass().equals(Integer.class) - || bulkSendJobId.getClass().equals(String.class) - || bulkSendJobId.getClass().isEnum()) { - map.put("bulk_send_job_id", bulkSendJobId); - } else if (isListOfFile(bulkSendJobId)) { - for (int i = 0; i < getListSize(bulkSendJobId); i++) { - map.put("bulk_send_job_id[" + i + "]", getFromList(bulkSendJobId, i)); - } - } else { - map.put( - "bulk_send_job_id", - JSON.getDefault().getMapper().writeValueAsString(bulkSendJobId)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java index a47d9a259..06e57aa25 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java @@ -10,277 +10,293 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.BulkSendJobResponse; +import com.dropbox.sign.model.ListInfoResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** BulkSendJobListResponse */ +import com.dropbox.sign.ApiException; +/** + * BulkSendJobListResponse + */ @JsonPropertyOrder({ - BulkSendJobListResponse.JSON_PROPERTY_BULK_SEND_JOBS, - BulkSendJobListResponse.JSON_PROPERTY_LIST_INFO, - BulkSendJobListResponse.JSON_PROPERTY_WARNINGS + BulkSendJobListResponse.JSON_PROPERTY_BULK_SEND_JOBS, + BulkSendJobListResponse.JSON_PROPERTY_LIST_INFO, + BulkSendJobListResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class BulkSendJobListResponse { - public static final String JSON_PROPERTY_BULK_SEND_JOBS = "bulk_send_jobs"; - @javax.annotation.Nonnull private List bulkSendJobs = new ArrayList<>(); - - public static final String JSON_PROPERTY_LIST_INFO = "list_info"; - @javax.annotation.Nonnull private ListInfoResponse listInfo; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public BulkSendJobListResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static BulkSendJobListResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, BulkSendJobListResponse.class); - } - - public static BulkSendJobListResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), BulkSendJobListResponse.class); + public static final String JSON_PROPERTY_BULK_SEND_JOBS = "bulk_send_jobs"; + @javax.annotation.Nonnull + private List bulkSendJobs = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + @javax.annotation.Nonnull + private ListInfoResponse listInfo; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public BulkSendJobListResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public BulkSendJobListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, BulkSendJobListResponse.class); + } + + static public BulkSendJobListResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + BulkSendJobListResponse.class + ); + } + + public BulkSendJobListResponse bulkSendJobs(@javax.annotation.Nonnull List bulkSendJobs) { + this.bulkSendJobs = bulkSendJobs; + return this; + } + + public BulkSendJobListResponse addBulkSendJobsItem(BulkSendJobResponse bulkSendJobsItem) { + if (this.bulkSendJobs == null) { + this.bulkSendJobs = new ArrayList<>(); } - - public BulkSendJobListResponse bulkSendJobs( - @javax.annotation.Nonnull List bulkSendJobs) { - this.bulkSendJobs = bulkSendJobs; - return this; - } - - public BulkSendJobListResponse addBulkSendJobsItem(BulkSendJobResponse bulkSendJobsItem) { - if (this.bulkSendJobs == null) { - this.bulkSendJobs = new ArrayList<>(); - } - this.bulkSendJobs.add(bulkSendJobsItem); - return this; + this.bulkSendJobs.add(bulkSendJobsItem); + return this; + } + + /** + * Contains a list of BulkSendJobs that the API caller has access to. + * @return bulkSendJobs + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getBulkSendJobs() { + return bulkSendJobs; + } + + + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBulkSendJobs(@javax.annotation.Nonnull List bulkSendJobs) { + this.bulkSendJobs = bulkSendJobs; + } + + + public BulkSendJobListResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; + } + + /** + * Get listInfo + * @return listInfo + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ListInfoResponse getListInfo() { + return listInfo; + } + + + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + } + + + public BulkSendJobListResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public BulkSendJobListResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } - - /** - * Contains a list of BulkSendJobs that the API caller has access to. - * - * @return bulkSendJobs - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getBulkSendJobs() { - return bulkSendJobs; - } - - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setBulkSendJobs(@javax.annotation.Nonnull List bulkSendJobs) { - this.bulkSendJobs = bulkSendJobs; + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this BulkSendJobListResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public BulkSendJobListResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - /** - * Get listInfo - * - * @return listInfo - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ListInfoResponse getListInfo() { - return listInfo; - } - - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - } - - public BulkSendJobListResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public BulkSendJobListResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + BulkSendJobListResponse bulkSendJobListResponse = (BulkSendJobListResponse) o; + return Objects.equals(this.bulkSendJobs, bulkSendJobListResponse.bulkSendJobs) && + Objects.equals(this.listInfo, bulkSendJobListResponse.listInfo) && + Objects.equals(this.warnings, bulkSendJobListResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(bulkSendJobs, listInfo, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkSendJobListResponse {\n"); + sb.append(" bulkSendJobs: ").append(toIndentedString(bulkSendJobs)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (bulkSendJobs != null) { + if (isFileTypeOrListOfFiles(bulkSendJobs)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; + if (bulkSendJobs.getClass().equals(java.io.File.class) || + bulkSendJobs.getClass().equals(Integer.class) || + bulkSendJobs.getClass().equals(String.class) || + bulkSendJobs.getClass().isEnum()) { + map.put("bulk_send_jobs", bulkSendJobs); + } else if (isListOfFile(bulkSendJobs)) { + for(int i = 0; i< getListSize(bulkSendJobs); i++) { + map.put("bulk_send_jobs[" + i + "]", getFromList(bulkSendJobs, i)); + } + } + else { + map.put("bulk_send_jobs", JSON.getDefault().getMapper().writeValueAsString(bulkSendJobs)); + } } + if (listInfo != null) { + if (isFileTypeOrListOfFiles(listInfo)) { + fileTypeFound = true; + } - /** Return true if this BulkSendJobListResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (listInfo.getClass().equals(java.io.File.class) || + listInfo.getClass().equals(Integer.class) || + listInfo.getClass().equals(String.class) || + listInfo.getClass().isEnum()) { + map.put("list_info", listInfo); + } else if (isListOfFile(listInfo)) { + for(int i = 0; i< getListSize(listInfo); i++) { + map.put("list_info[" + i + "]", getFromList(listInfo, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("list_info", JSON.getDefault().getMapper().writeValueAsString(listInfo)); } - BulkSendJobListResponse bulkSendJobListResponse = (BulkSendJobListResponse) o; - return Objects.equals(this.bulkSendJobs, bulkSendJobListResponse.bulkSendJobs) - && Objects.equals(this.listInfo, bulkSendJobListResponse.listInfo) - && Objects.equals(this.warnings, bulkSendJobListResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(bulkSendJobs, listInfo, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BulkSendJobListResponse {\n"); - sb.append(" bulkSendJobs: ").append(toIndentedString(bulkSendJobs)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (bulkSendJobs != null) { - if (isFileTypeOrListOfFiles(bulkSendJobs)) { - fileTypeFound = true; - } - - if (bulkSendJobs.getClass().equals(java.io.File.class) - || bulkSendJobs.getClass().equals(Integer.class) - || bulkSendJobs.getClass().equals(String.class) - || bulkSendJobs.getClass().isEnum()) { - map.put("bulk_send_jobs", bulkSendJobs); - } else if (isListOfFile(bulkSendJobs)) { - for (int i = 0; i < getListSize(bulkSendJobs); i++) { - map.put("bulk_send_jobs[" + i + "]", getFromList(bulkSendJobs, i)); - } - } else { - map.put( - "bulk_send_jobs", - JSON.getDefault().getMapper().writeValueAsString(bulkSendJobs)); - } - } - if (listInfo != null) { - if (isFileTypeOrListOfFiles(listInfo)) { - fileTypeFound = true; - } - - if (listInfo.getClass().equals(java.io.File.class) - || listInfo.getClass().equals(Integer.class) - || listInfo.getClass().equals(String.class) - || listInfo.getClass().isEnum()) { - map.put("list_info", listInfo); - } else if (isListOfFile(listInfo)) { - for (int i = 0; i < getListSize(listInfo); i++) { - map.put("list_info[" + i + "]", getFromList(listInfo, i)); - } - } else { - map.put( - "list_info", - JSON.getDefault().getMapper().writeValueAsString(listInfo)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java index 442e2b628..dd3f2ae48 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java @@ -10,306 +10,323 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; + +import com.dropbox.sign.ApiException; /** - * Contains information about the BulkSendJob such as when it was created and how many signature - * requests are queued. + * Contains information about the BulkSendJob such as when it was created and how many signature requests are queued. */ @JsonPropertyOrder({ - BulkSendJobResponse.JSON_PROPERTY_BULK_SEND_JOB_ID, - BulkSendJobResponse.JSON_PROPERTY_TOTAL, - BulkSendJobResponse.JSON_PROPERTY_IS_CREATOR, - BulkSendJobResponse.JSON_PROPERTY_CREATED_AT + BulkSendJobResponse.JSON_PROPERTY_BULK_SEND_JOB_ID, + BulkSendJobResponse.JSON_PROPERTY_TOTAL, + BulkSendJobResponse.JSON_PROPERTY_IS_CREATOR, + BulkSendJobResponse.JSON_PROPERTY_CREATED_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class BulkSendJobResponse { - public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; - @javax.annotation.Nullable private String bulkSendJobId; - - public static final String JSON_PROPERTY_TOTAL = "total"; - @javax.annotation.Nullable private Integer total; - - public static final String JSON_PROPERTY_IS_CREATOR = "is_creator"; - @javax.annotation.Nullable private Boolean isCreator; - - public static final String JSON_PROPERTY_CREATED_AT = "created_at"; - @javax.annotation.Nullable private Integer createdAt; - - public BulkSendJobResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static BulkSendJobResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, BulkSendJobResponse.class); - } - - public static BulkSendJobResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), BulkSendJobResponse.class); - } - - public BulkSendJobResponse bulkSendJobId(@javax.annotation.Nullable String bulkSendJobId) { - this.bulkSendJobId = bulkSendJobId; - return this; - } - - /** - * The id of the BulkSendJob. - * - * @return bulkSendJobId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBulkSendJobId() { - return bulkSendJobId; - } - - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBulkSendJobId(@javax.annotation.Nullable String bulkSendJobId) { - this.bulkSendJobId = bulkSendJobId; - } - - public BulkSendJobResponse total(@javax.annotation.Nullable Integer total) { - this.total = total; - return this; - } - - /** - * The total amount of Signature Requests queued for sending. - * - * @return total - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TOTAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getTotal() { - return total; - } - - @JsonProperty(JSON_PROPERTY_TOTAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTotal(@javax.annotation.Nullable Integer total) { - this.total = total; - } - - public BulkSendJobResponse isCreator(@javax.annotation.Nullable Boolean isCreator) { - this.isCreator = isCreator; - return this; + public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; + @javax.annotation.Nullable + private String bulkSendJobId; + + public static final String JSON_PROPERTY_TOTAL = "total"; + @javax.annotation.Nullable + private Integer total; + + public static final String JSON_PROPERTY_IS_CREATOR = "is_creator"; + @javax.annotation.Nullable + private Boolean isCreator; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @javax.annotation.Nullable + private Integer createdAt; + + public BulkSendJobResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public BulkSendJobResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, BulkSendJobResponse.class); + } + + static public BulkSendJobResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + BulkSendJobResponse.class + ); + } + + public BulkSendJobResponse bulkSendJobId(@javax.annotation.Nullable String bulkSendJobId) { + this.bulkSendJobId = bulkSendJobId; + return this; + } + + /** + * The id of the BulkSendJob. + * @return bulkSendJobId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBulkSendJobId() { + return bulkSendJobId; + } + + + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBulkSendJobId(@javax.annotation.Nullable String bulkSendJobId) { + this.bulkSendJobId = bulkSendJobId; + } + + + public BulkSendJobResponse total(@javax.annotation.Nullable Integer total) { + this.total = total; + return this; + } + + /** + * The total amount of Signature Requests queued for sending. + * @return total + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getTotal() { + return total; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotal(@javax.annotation.Nullable Integer total) { + this.total = total; + } + + + public BulkSendJobResponse isCreator(@javax.annotation.Nullable Boolean isCreator) { + this.isCreator = isCreator; + return this; + } + + /** + * True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. + * @return isCreator + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_CREATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsCreator() { + return isCreator; + } + + + @JsonProperty(JSON_PROPERTY_IS_CREATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsCreator(@javax.annotation.Nullable Boolean isCreator) { + this.isCreator = isCreator; + } + + + public BulkSendJobResponse createdAt(@javax.annotation.Nullable Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Time that the BulkSendJob was created. + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@javax.annotation.Nullable Integer createdAt) { + this.createdAt = createdAt; + } + + + /** + * Return true if this BulkSendJobResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * True if you are the owner of this BulkSendJob, false if it's been shared with you by a - * team member. - * - * @return isCreator - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_CREATOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsCreator() { - return isCreator; - } - - @JsonProperty(JSON_PROPERTY_IS_CREATOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsCreator(@javax.annotation.Nullable Boolean isCreator) { - this.isCreator = isCreator; - } - - public BulkSendJobResponse createdAt(@javax.annotation.Nullable Integer createdAt) { - this.createdAt = createdAt; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + BulkSendJobResponse bulkSendJobResponse = (BulkSendJobResponse) o; + return Objects.equals(this.bulkSendJobId, bulkSendJobResponse.bulkSendJobId) && + Objects.equals(this.total, bulkSendJobResponse.total) && + Objects.equals(this.isCreator, bulkSendJobResponse.isCreator) && + Objects.equals(this.createdAt, bulkSendJobResponse.createdAt); + } + + @Override + public int hashCode() { + return Objects.hash(bulkSendJobId, total, isCreator, createdAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkSendJobResponse {\n"); + sb.append(" bulkSendJobId: ").append(toIndentedString(bulkSendJobId)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" isCreator: ").append(toIndentedString(isCreator)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (bulkSendJobId != null) { + if (isFileTypeOrListOfFiles(bulkSendJobId)) { + fileTypeFound = true; + } - /** - * Time that the BulkSendJob was created. - * - * @return createdAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getCreatedAt() { - return createdAt; + if (bulkSendJobId.getClass().equals(java.io.File.class) || + bulkSendJobId.getClass().equals(Integer.class) || + bulkSendJobId.getClass().equals(String.class) || + bulkSendJobId.getClass().isEnum()) { + map.put("bulk_send_job_id", bulkSendJobId); + } else if (isListOfFile(bulkSendJobId)) { + for(int i = 0; i< getListSize(bulkSendJobId); i++) { + map.put("bulk_send_job_id[" + i + "]", getFromList(bulkSendJobId, i)); + } + } + else { + map.put("bulk_send_job_id", JSON.getDefault().getMapper().writeValueAsString(bulkSendJobId)); + } } + if (total != null) { + if (isFileTypeOrListOfFiles(total)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCreatedAt(@javax.annotation.Nullable Integer createdAt) { - this.createdAt = createdAt; + if (total.getClass().equals(java.io.File.class) || + total.getClass().equals(Integer.class) || + total.getClass().equals(String.class) || + total.getClass().isEnum()) { + map.put("total", total); + } else if (isListOfFile(total)) { + for(int i = 0; i< getListSize(total); i++) { + map.put("total[" + i + "]", getFromList(total, i)); + } + } + else { + map.put("total", JSON.getDefault().getMapper().writeValueAsString(total)); + } } + if (isCreator != null) { + if (isFileTypeOrListOfFiles(isCreator)) { + fileTypeFound = true; + } - /** Return true if this BulkSendJobResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (isCreator.getClass().equals(java.io.File.class) || + isCreator.getClass().equals(Integer.class) || + isCreator.getClass().equals(String.class) || + isCreator.getClass().isEnum()) { + map.put("is_creator", isCreator); + } else if (isListOfFile(isCreator)) { + for(int i = 0; i< getListSize(isCreator); i++) { + map.put("is_creator[" + i + "]", getFromList(isCreator, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("is_creator", JSON.getDefault().getMapper().writeValueAsString(isCreator)); } - BulkSendJobResponse bulkSendJobResponse = (BulkSendJobResponse) o; - return Objects.equals(this.bulkSendJobId, bulkSendJobResponse.bulkSendJobId) - && Objects.equals(this.total, bulkSendJobResponse.total) - && Objects.equals(this.isCreator, bulkSendJobResponse.isCreator) - && Objects.equals(this.createdAt, bulkSendJobResponse.createdAt); } + if (createdAt != null) { + if (isFileTypeOrListOfFiles(createdAt)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(bulkSendJobId, total, isCreator, createdAt); + if (createdAt.getClass().equals(java.io.File.class) || + createdAt.getClass().equals(Integer.class) || + createdAt.getClass().equals(String.class) || + createdAt.getClass().isEnum()) { + map.put("created_at", createdAt); + } else if (isListOfFile(createdAt)) { + for(int i = 0; i< getListSize(createdAt); i++) { + map.put("created_at[" + i + "]", getFromList(createdAt, i)); + } + } + else { + map.put("created_at", JSON.getDefault().getMapper().writeValueAsString(createdAt)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BulkSendJobResponse {\n"); - sb.append(" bulkSendJobId: ").append(toIndentedString(bulkSendJobId)).append("\n"); - sb.append(" total: ").append(toIndentedString(total)).append("\n"); - sb.append(" isCreator: ").append(toIndentedString(isCreator)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (bulkSendJobId != null) { - if (isFileTypeOrListOfFiles(bulkSendJobId)) { - fileTypeFound = true; - } - - if (bulkSendJobId.getClass().equals(java.io.File.class) - || bulkSendJobId.getClass().equals(Integer.class) - || bulkSendJobId.getClass().equals(String.class) - || bulkSendJobId.getClass().isEnum()) { - map.put("bulk_send_job_id", bulkSendJobId); - } else if (isListOfFile(bulkSendJobId)) { - for (int i = 0; i < getListSize(bulkSendJobId); i++) { - map.put("bulk_send_job_id[" + i + "]", getFromList(bulkSendJobId, i)); - } - } else { - map.put( - "bulk_send_job_id", - JSON.getDefault().getMapper().writeValueAsString(bulkSendJobId)); - } - } - if (total != null) { - if (isFileTypeOrListOfFiles(total)) { - fileTypeFound = true; - } - - if (total.getClass().equals(java.io.File.class) - || total.getClass().equals(Integer.class) - || total.getClass().equals(String.class) - || total.getClass().isEnum()) { - map.put("total", total); - } else if (isListOfFile(total)) { - for (int i = 0; i < getListSize(total); i++) { - map.put("total[" + i + "]", getFromList(total, i)); - } - } else { - map.put("total", JSON.getDefault().getMapper().writeValueAsString(total)); - } - } - if (isCreator != null) { - if (isFileTypeOrListOfFiles(isCreator)) { - fileTypeFound = true; - } - - if (isCreator.getClass().equals(java.io.File.class) - || isCreator.getClass().equals(Integer.class) - || isCreator.getClass().equals(String.class) - || isCreator.getClass().isEnum()) { - map.put("is_creator", isCreator); - } else if (isListOfFile(isCreator)) { - for (int i = 0; i < getListSize(isCreator); i++) { - map.put("is_creator[" + i + "]", getFromList(isCreator, i)); - } - } else { - map.put( - "is_creator", - JSON.getDefault().getMapper().writeValueAsString(isCreator)); - } - } - if (createdAt != null) { - if (isFileTypeOrListOfFiles(createdAt)) { - fileTypeFound = true; - } - - if (createdAt.getClass().equals(java.io.File.class) - || createdAt.getClass().equals(Integer.class) - || createdAt.getClass().equals(String.class) - || createdAt.getClass().isEnum()) { - map.put("created_at", createdAt); - } else if (isListOfFile(createdAt)) { - for (int i = 0; i < getListSize(createdAt); i++) { - map.put("created_at[" + i + "]", getFromList(createdAt, i)); - } - } else { - map.put( - "created_at", - JSON.getDefault().getMapper().writeValueAsString(createdAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java index b59c28092..f53a0b0ff 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java @@ -10,220 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.BulkSendJobResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** BulkSendJobSendResponse */ + +import com.dropbox.sign.ApiException; +/** + * BulkSendJobSendResponse + */ @JsonPropertyOrder({ - BulkSendJobSendResponse.JSON_PROPERTY_BULK_SEND_JOB, - BulkSendJobSendResponse.JSON_PROPERTY_WARNINGS + BulkSendJobSendResponse.JSON_PROPERTY_BULK_SEND_JOB, + BulkSendJobSendResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class BulkSendJobSendResponse { - public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; - @javax.annotation.Nonnull private BulkSendJobResponse bulkSendJob; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public BulkSendJobSendResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static BulkSendJobSendResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, BulkSendJobSendResponse.class); - } - - public static BulkSendJobSendResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), BulkSendJobSendResponse.class); - } - - public BulkSendJobSendResponse bulkSendJob( - @javax.annotation.Nonnull BulkSendJobResponse bulkSendJob) { - this.bulkSendJob = bulkSendJob; - return this; - } - - /** - * Get bulkSendJob - * - * @return bulkSendJob - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BulkSendJobResponse getBulkSendJob() { - return bulkSendJob; - } - - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setBulkSendJob(@javax.annotation.Nonnull BulkSendJobResponse bulkSendJob) { - this.bulkSendJob = bulkSendJob; - } - - public BulkSendJobSendResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public BulkSendJobSendResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; + @javax.annotation.Nonnull + private BulkSendJobResponse bulkSendJob; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public BulkSendJobSendResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public BulkSendJobSendResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, BulkSendJobSendResponse.class); + } + + static public BulkSendJobSendResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + BulkSendJobSendResponse.class + ); + } + + public BulkSendJobSendResponse bulkSendJob(@javax.annotation.Nonnull BulkSendJobResponse bulkSendJob) { + this.bulkSendJob = bulkSendJob; + return this; + } + + /** + * Get bulkSendJob + * @return bulkSendJob + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BulkSendJobResponse getBulkSendJob() { + return bulkSendJob; + } + + + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBulkSendJob(@javax.annotation.Nonnull BulkSendJobResponse bulkSendJob) { + this.bulkSendJob = bulkSendJob; + } + + + public BulkSendJobSendResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public BulkSendJobSendResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this BulkSendJobSendResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkSendJobSendResponse bulkSendJobSendResponse = (BulkSendJobSendResponse) o; + return Objects.equals(this.bulkSendJob, bulkSendJobSendResponse.bulkSendJob) && + Objects.equals(this.warnings, bulkSendJobSendResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(bulkSendJob, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkSendJobSendResponse {\n"); + sb.append(" bulkSendJob: ").append(toIndentedString(bulkSendJob)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (bulkSendJob != null) { + if (isFileTypeOrListOfFiles(bulkSendJob)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this BulkSendJobSendResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (bulkSendJob.getClass().equals(java.io.File.class) || + bulkSendJob.getClass().equals(Integer.class) || + bulkSendJob.getClass().equals(String.class) || + bulkSendJob.getClass().isEnum()) { + map.put("bulk_send_job", bulkSendJob); + } else if (isListOfFile(bulkSendJob)) { + for(int i = 0; i< getListSize(bulkSendJob); i++) { + map.put("bulk_send_job[" + i + "]", getFromList(bulkSendJob, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("bulk_send_job", JSON.getDefault().getMapper().writeValueAsString(bulkSendJob)); } - BulkSendJobSendResponse bulkSendJobSendResponse = (BulkSendJobSendResponse) o; - return Objects.equals(this.bulkSendJob, bulkSendJobSendResponse.bulkSendJob) - && Objects.equals(this.warnings, bulkSendJobSendResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(bulkSendJob, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BulkSendJobSendResponse {\n"); - sb.append(" bulkSendJob: ").append(toIndentedString(bulkSendJob)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (bulkSendJob != null) { - if (isFileTypeOrListOfFiles(bulkSendJob)) { - fileTypeFound = true; - } - - if (bulkSendJob.getClass().equals(java.io.File.class) - || bulkSendJob.getClass().equals(Integer.class) - || bulkSendJob.getClass().equals(String.class) - || bulkSendJob.getClass().isEnum()) { - map.put("bulk_send_job", bulkSendJob); - } else if (isListOfFile(bulkSendJob)) { - for (int i = 0; i < getListSize(bulkSendJob); i++) { - map.put("bulk_send_job[" + i + "]", getFromList(bulkSendJob, i)); - } - } else { - map.put( - "bulk_send_job", - JSON.getDefault().getMapper().writeValueAsString(bulkSendJob)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java index a1628c72d..3de92fa41 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java @@ -10,692 +10,700 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubEditorOptions; +import com.dropbox.sign.model.SubMergeField; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** EmbeddedEditUrlRequest */ +import com.dropbox.sign.ApiException; +/** + * EmbeddedEditUrlRequest + */ @JsonPropertyOrder({ - EmbeddedEditUrlRequest.JSON_PROPERTY_ALLOW_EDIT_CCS, - EmbeddedEditUrlRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, - EmbeddedEditUrlRequest.JSON_PROPERTY_CC_ROLES, - EmbeddedEditUrlRequest.JSON_PROPERTY_EDITOR_OPTIONS, - EmbeddedEditUrlRequest.JSON_PROPERTY_FORCE_SIGNER_ROLES, - EmbeddedEditUrlRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, - EmbeddedEditUrlRequest.JSON_PROPERTY_MERGE_FIELDS, - EmbeddedEditUrlRequest.JSON_PROPERTY_PREVIEW_ONLY, - EmbeddedEditUrlRequest.JSON_PROPERTY_SHOW_PREVIEW, - EmbeddedEditUrlRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, - EmbeddedEditUrlRequest.JSON_PROPERTY_TEST_MODE + EmbeddedEditUrlRequest.JSON_PROPERTY_ALLOW_EDIT_CCS, + EmbeddedEditUrlRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, + EmbeddedEditUrlRequest.JSON_PROPERTY_CC_ROLES, + EmbeddedEditUrlRequest.JSON_PROPERTY_EDITOR_OPTIONS, + EmbeddedEditUrlRequest.JSON_PROPERTY_FORCE_SIGNER_ROLES, + EmbeddedEditUrlRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, + EmbeddedEditUrlRequest.JSON_PROPERTY_MERGE_FIELDS, + EmbeddedEditUrlRequest.JSON_PROPERTY_PREVIEW_ONLY, + EmbeddedEditUrlRequest.JSON_PROPERTY_SHOW_PREVIEW, + EmbeddedEditUrlRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, + EmbeddedEditUrlRequest.JSON_PROPERTY_TEST_MODE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class EmbeddedEditUrlRequest { - public static final String JSON_PROPERTY_ALLOW_EDIT_CCS = "allow_edit_ccs"; - @javax.annotation.Nullable private Boolean allowEditCcs = false; - - public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; - @javax.annotation.Nullable private Boolean allowFormView = false; - - public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - @javax.annotation.Nullable private List ccRoles = null; - - public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; - @javax.annotation.Nullable private SubEditorOptions editorOptions; - - public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; - @javax.annotation.Nullable private Boolean forceSignerRoles = false; - - public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; - @javax.annotation.Nullable private Boolean forceSubjectMessage = false; - - public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; - @javax.annotation.Nullable private List mergeFields = null; - - public static final String JSON_PROPERTY_PREVIEW_ONLY = "preview_only"; - @javax.annotation.Nullable private Boolean previewOnly = false; - - public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; - @javax.annotation.Nullable private Boolean showPreview = false; - - public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; - @javax.annotation.Nullable private Boolean showProgressStepper = true; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public EmbeddedEditUrlRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static EmbeddedEditUrlRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EmbeddedEditUrlRequest.class); - } - - public static EmbeddedEditUrlRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), EmbeddedEditUrlRequest.class); - } - - public EmbeddedEditUrlRequest allowEditCcs(@javax.annotation.Nullable Boolean allowEditCcs) { - this.allowEditCcs = allowEditCcs; - return this; - } - - /** - * This allows the requester to enable/disable to add or change CC roles when editing the - * template. - * - * @return allowEditCcs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowEditCcs() { - return allowEditCcs; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowEditCcs(@javax.annotation.Nullable Boolean allowEditCcs) { - this.allowEditCcs = allowEditCcs; - } - - public EmbeddedEditUrlRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - return this; - } + public static final String JSON_PROPERTY_ALLOW_EDIT_CCS = "allow_edit_ccs"; + @javax.annotation.Nullable + private Boolean allowEditCcs = false; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @javax.annotation.Nullable + private Boolean allowFormView = false; + + public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; + @javax.annotation.Nullable + private List ccRoles = null; + + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; + @javax.annotation.Nullable + private SubEditorOptions editorOptions; + + public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; + @javax.annotation.Nullable + private Boolean forceSignerRoles = false; + + public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; + @javax.annotation.Nullable + private Boolean forceSubjectMessage = false; + + public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; + @javax.annotation.Nullable + private List mergeFields = null; + + public static final String JSON_PROPERTY_PREVIEW_ONLY = "preview_only"; + @javax.annotation.Nullable + private Boolean previewOnly = false; + + public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; + @javax.annotation.Nullable + private Boolean showPreview = false; + + public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; + @javax.annotation.Nullable + private Boolean showProgressStepper = true; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public EmbeddedEditUrlRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public EmbeddedEditUrlRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EmbeddedEditUrlRequest.class); + } + + static public EmbeddedEditUrlRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + EmbeddedEditUrlRequest.class + ); + } + + public EmbeddedEditUrlRequest allowEditCcs(@javax.annotation.Nullable Boolean allowEditCcs) { + this.allowEditCcs = allowEditCcs; + return this; + } + + /** + * This allows the requester to enable/disable to add or change CC roles when editing the template. + * @return allowEditCcs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowEditCcs() { + return allowEditCcs; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowEditCcs(@javax.annotation.Nullable Boolean allowEditCcs) { + this.allowEditCcs = allowEditCcs; + } + + + public EmbeddedEditUrlRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. + * @return allowFormView + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + public EmbeddedEditUrlRequest ccRoles(@javax.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + return this; + } + + public EmbeddedEditUrlRequest addCcRolesItem(String ccRolesItem) { + if (this.ccRoles == null) { + this.ccRoles = new ArrayList<>(); + } + this.ccRoles.add(ccRolesItem); + return this; + } + + /** + * The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. + * @return ccRoles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcRoles() { + return ccRoles; + } + + + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcRoles(@javax.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + } + + + public EmbeddedEditUrlRequest editorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + return this; + } + + /** + * Get editorOptions + * @return editorOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubEditorOptions getEditorOptions() { + return editorOptions; + } + + + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + } + + + public EmbeddedEditUrlRequest forceSignerRoles(@javax.annotation.Nullable Boolean forceSignerRoles) { + this.forceSignerRoles = forceSignerRoles; + return this; + } + + /** + * Provide users the ability to review/edit the template signer roles. + * @return forceSignerRoles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getForceSignerRoles() { + return forceSignerRoles; + } + + + @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSignerRoles(@javax.annotation.Nullable Boolean forceSignerRoles) { + this.forceSignerRoles = forceSignerRoles; + } + + + public EmbeddedEditUrlRequest forceSubjectMessage(@javax.annotation.Nullable Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + return this; + } + + /** + * Provide users the ability to review/edit the template subject and message. + * @return forceSubjectMessage + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getForceSubjectMessage() { + return forceSubjectMessage; + } + + + @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSubjectMessage(@javax.annotation.Nullable Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + } + + + public EmbeddedEditUrlRequest mergeFields(@javax.annotation.Nullable List mergeFields) { + this.mergeFields = mergeFields; + return this; + } + + public EmbeddedEditUrlRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { + if (this.mergeFields == null) { + this.mergeFields = new ArrayList<>(); + } + this.mergeFields.add(mergeFieldsItem); + return this; + } - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to - * `false`. - * - * @return allowFormView - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowFormView() { - return allowFormView; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - } - - public EmbeddedEditUrlRequest ccRoles(@javax.annotation.Nullable List ccRoles) { - this.ccRoles = ccRoles; - return this; - } - - public EmbeddedEditUrlRequest addCcRolesItem(String ccRolesItem) { - if (this.ccRoles == null) { - this.ccRoles = new ArrayList<>(); + /** + * Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`. + * @return mergeFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMergeFields() { + return mergeFields; + } + + + @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMergeFields(@javax.annotation.Nullable List mergeFields) { + this.mergeFields = mergeFields; + } + + + public EmbeddedEditUrlRequest previewOnly(@javax.annotation.Nullable Boolean previewOnly) { + this.previewOnly = previewOnly; + return this; + } + + /** + * This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set). + * @return previewOnly + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPreviewOnly() { + return previewOnly; + } + + + @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviewOnly(@javax.annotation.Nullable Boolean previewOnly) { + this.previewOnly = previewOnly; + } + + + public EmbeddedEditUrlRequest showPreview(@javax.annotation.Nullable Boolean showPreview) { + this.showPreview = showPreview; + return this; + } + + /** + * This allows the requester to enable the editor/preview experience. + * @return showPreview + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getShowPreview() { + return showPreview; + } + + + @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowPreview(@javax.annotation.Nullable Boolean showPreview) { + this.showPreview = showPreview; + } + + + public EmbeddedEditUrlRequest showProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + return this; + } + + /** + * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. + * @return showProgressStepper + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getShowProgressStepper() { + return showProgressStepper; + } + + + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + } + + + public EmbeddedEditUrlRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + /** + * Return true if this EmbeddedEditUrlRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmbeddedEditUrlRequest embeddedEditUrlRequest = (EmbeddedEditUrlRequest) o; + return Objects.equals(this.allowEditCcs, embeddedEditUrlRequest.allowEditCcs) && + Objects.equals(this.allowFormView, embeddedEditUrlRequest.allowFormView) && + Objects.equals(this.ccRoles, embeddedEditUrlRequest.ccRoles) && + Objects.equals(this.editorOptions, embeddedEditUrlRequest.editorOptions) && + Objects.equals(this.forceSignerRoles, embeddedEditUrlRequest.forceSignerRoles) && + Objects.equals(this.forceSubjectMessage, embeddedEditUrlRequest.forceSubjectMessage) && + Objects.equals(this.mergeFields, embeddedEditUrlRequest.mergeFields) && + Objects.equals(this.previewOnly, embeddedEditUrlRequest.previewOnly) && + Objects.equals(this.showPreview, embeddedEditUrlRequest.showPreview) && + Objects.equals(this.showProgressStepper, embeddedEditUrlRequest.showProgressStepper) && + Objects.equals(this.testMode, embeddedEditUrlRequest.testMode); + } + + @Override + public int hashCode() { + return Objects.hash(allowEditCcs, allowFormView, ccRoles, editorOptions, forceSignerRoles, forceSubjectMessage, mergeFields, previewOnly, showPreview, showProgressStepper, testMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedEditUrlRequest {\n"); + sb.append(" allowEditCcs: ").append(toIndentedString(allowEditCcs)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); + sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); + sb.append(" forceSignerRoles: ").append(toIndentedString(forceSignerRoles)).append("\n"); + sb.append(" forceSubjectMessage: ").append(toIndentedString(forceSubjectMessage)).append("\n"); + sb.append(" mergeFields: ").append(toIndentedString(mergeFields)).append("\n"); + sb.append(" previewOnly: ").append(toIndentedString(previewOnly)).append("\n"); + sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); + sb.append(" showProgressStepper: ").append(toIndentedString(showProgressStepper)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (allowEditCcs != null) { + if (isFileTypeOrListOfFiles(allowEditCcs)) { + fileTypeFound = true; } - this.ccRoles.add(ccRolesItem); - return this; - } - /** - * The CC roles that must be assigned when using the template to send a signature request. To - * remove all CC roles, pass in a single role with no name. For use in a POST request. - * - * @return ccRoles - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcRoles() { - return ccRoles; - } - - @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcRoles(@javax.annotation.Nullable List ccRoles) { - this.ccRoles = ccRoles; - } - - public EmbeddedEditUrlRequest editorOptions( - @javax.annotation.Nullable SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - return this; - } - - /** - * Get editorOptions - * - * @return editorOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubEditorOptions getEditorOptions() { - return editorOptions; - } - - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - } - - public EmbeddedEditUrlRequest forceSignerRoles( - @javax.annotation.Nullable Boolean forceSignerRoles) { - this.forceSignerRoles = forceSignerRoles; - return this; - } - - /** - * Provide users the ability to review/edit the template signer roles. - * - * @return forceSignerRoles - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getForceSignerRoles() { - return forceSignerRoles; - } - - @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSignerRoles(@javax.annotation.Nullable Boolean forceSignerRoles) { - this.forceSignerRoles = forceSignerRoles; - } - - public EmbeddedEditUrlRequest forceSubjectMessage( - @javax.annotation.Nullable Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - return this; - } - - /** - * Provide users the ability to review/edit the template subject and message. - * - * @return forceSubjectMessage - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getForceSubjectMessage() { - return forceSubjectMessage; - } - - @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSubjectMessage(@javax.annotation.Nullable Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - } - - public EmbeddedEditUrlRequest mergeFields( - @javax.annotation.Nullable List mergeFields) { - this.mergeFields = mergeFields; - return this; - } - - public EmbeddedEditUrlRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { - if (this.mergeFields == null) { - this.mergeFields = new ArrayList<>(); + if (allowEditCcs.getClass().equals(java.io.File.class) || + allowEditCcs.getClass().equals(Integer.class) || + allowEditCcs.getClass().equals(String.class) || + allowEditCcs.getClass().isEnum()) { + map.put("allow_edit_ccs", allowEditCcs); + } else if (isListOfFile(allowEditCcs)) { + for(int i = 0; i< getListSize(allowEditCcs); i++) { + map.put("allow_edit_ccs[" + i + "]", getFromList(allowEditCcs, i)); + } + } + else { + map.put("allow_edit_ccs", JSON.getDefault().getMapper().writeValueAsString(allowEditCcs)); } - this.mergeFields.add(mergeFieldsItem); - return this; - } - - /** - * Add additional merge fields to the template, which can be used used to pre-fill data by - * passing values into signature requests made with that template. Remove all merge fields on - * the template by passing an empty array `[]`. - * - * @return mergeFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getMergeFields() { - return mergeFields; - } - - @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMergeFields(@javax.annotation.Nullable List mergeFields) { - this.mergeFields = mergeFields; - } - - public EmbeddedEditUrlRequest previewOnly(@javax.annotation.Nullable Boolean previewOnly) { - this.previewOnly = previewOnly; - return this; - } - - /** - * This allows the requester to enable the preview experience (i.e. does not allow the - * requester's end user to add any additional fields via the editor). **NOTE:** This - * parameter overwrites `show_preview=true` (if set). - * - * @return previewOnly - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPreviewOnly() { - return previewOnly; - } - - @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPreviewOnly(@javax.annotation.Nullable Boolean previewOnly) { - this.previewOnly = previewOnly; - } - - public EmbeddedEditUrlRequest showPreview(@javax.annotation.Nullable Boolean showPreview) { - this.showPreview = showPreview; - return this; } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } - /** - * This allows the requester to enable the editor/preview experience. - * - * @return showPreview - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getShowPreview() { - return showPreview; + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } } + if (ccRoles != null) { + if (isFileTypeOrListOfFiles(ccRoles)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowPreview(@javax.annotation.Nullable Boolean showPreview) { - this.showPreview = showPreview; + if (ccRoles.getClass().equals(java.io.File.class) || + ccRoles.getClass().equals(Integer.class) || + ccRoles.getClass().equals(String.class) || + ccRoles.getClass().isEnum()) { + map.put("cc_roles", ccRoles); + } else if (isListOfFile(ccRoles)) { + for(int i = 0; i< getListSize(ccRoles); i++) { + map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); + } + } + else { + map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + } } + if (editorOptions != null) { + if (isFileTypeOrListOfFiles(editorOptions)) { + fileTypeFound = true; + } - public EmbeddedEditUrlRequest showProgressStepper( - @javax.annotation.Nullable Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - return this; + if (editorOptions.getClass().equals(java.io.File.class) || + editorOptions.getClass().equals(Integer.class) || + editorOptions.getClass().equals(String.class) || + editorOptions.getClass().isEnum()) { + map.put("editor_options", editorOptions); + } else if (isListOfFile(editorOptions)) { + for(int i = 0; i< getListSize(editorOptions); i++) { + map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); + } + } + else { + map.put("editor_options", JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + } } + if (forceSignerRoles != null) { + if (isFileTypeOrListOfFiles(forceSignerRoles)) { + fileTypeFound = true; + } - /** - * When only one step remains in the signature request process and this parameter is set to - * `false` then the progress stepper will be hidden. - * - * @return showProgressStepper - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getShowProgressStepper() { - return showProgressStepper; + if (forceSignerRoles.getClass().equals(java.io.File.class) || + forceSignerRoles.getClass().equals(Integer.class) || + forceSignerRoles.getClass().equals(String.class) || + forceSignerRoles.getClass().isEnum()) { + map.put("force_signer_roles", forceSignerRoles); + } else if (isListOfFile(forceSignerRoles)) { + for(int i = 0; i< getListSize(forceSignerRoles); i++) { + map.put("force_signer_roles[" + i + "]", getFromList(forceSignerRoles, i)); + } + } + else { + map.put("force_signer_roles", JSON.getDefault().getMapper().writeValueAsString(forceSignerRoles)); + } } + if (forceSubjectMessage != null) { + if (isFileTypeOrListOfFiles(forceSubjectMessage)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; + if (forceSubjectMessage.getClass().equals(java.io.File.class) || + forceSubjectMessage.getClass().equals(Integer.class) || + forceSubjectMessage.getClass().equals(String.class) || + forceSubjectMessage.getClass().isEnum()) { + map.put("force_subject_message", forceSubjectMessage); + } else if (isListOfFile(forceSubjectMessage)) { + for(int i = 0; i< getListSize(forceSubjectMessage); i++) { + map.put("force_subject_message[" + i + "]", getFromList(forceSubjectMessage, i)); + } + } + else { + map.put("force_subject_message", JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); + } } + if (mergeFields != null) { + if (isFileTypeOrListOfFiles(mergeFields)) { + fileTypeFound = true; + } - public EmbeddedEditUrlRequest testMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (mergeFields.getClass().equals(java.io.File.class) || + mergeFields.getClass().equals(Integer.class) || + mergeFields.getClass().equals(String.class) || + mergeFields.getClass().isEnum()) { + map.put("merge_fields", mergeFields); + } else if (isListOfFile(mergeFields)) { + for(int i = 0; i< getListSize(mergeFields); i++) { + map.put("merge_fields[" + i + "]", getFromList(mergeFields, i)); + } + } + else { + map.put("merge_fields", JSON.getDefault().getMapper().writeValueAsString(mergeFields)); + } } + if (previewOnly != null) { + if (isFileTypeOrListOfFiles(previewOnly)) { + fileTypeFound = true; + } - /** - * Whether this is a test, locked templates will only be available for editing if this is set to - * `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (previewOnly.getClass().equals(java.io.File.class) || + previewOnly.getClass().equals(Integer.class) || + previewOnly.getClass().equals(String.class) || + previewOnly.getClass().isEnum()) { + map.put("preview_only", previewOnly); + } else if (isListOfFile(previewOnly)) { + for(int i = 0; i< getListSize(previewOnly); i++) { + map.put("preview_only[" + i + "]", getFromList(previewOnly, i)); + } + } + else { + map.put("preview_only", JSON.getDefault().getMapper().writeValueAsString(previewOnly)); + } } + if (showPreview != null) { + if (isFileTypeOrListOfFiles(showPreview)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (showPreview.getClass().equals(java.io.File.class) || + showPreview.getClass().equals(Integer.class) || + showPreview.getClass().equals(String.class) || + showPreview.getClass().isEnum()) { + map.put("show_preview", showPreview); + } else if (isListOfFile(showPreview)) { + for(int i = 0; i< getListSize(showPreview); i++) { + map.put("show_preview[" + i + "]", getFromList(showPreview, i)); + } + } + else { + map.put("show_preview", JSON.getDefault().getMapper().writeValueAsString(showPreview)); + } } + if (showProgressStepper != null) { + if (isFileTypeOrListOfFiles(showProgressStepper)) { + fileTypeFound = true; + } - /** Return true if this EmbeddedEditUrlRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmbeddedEditUrlRequest embeddedEditUrlRequest = (EmbeddedEditUrlRequest) o; - return Objects.equals(this.allowEditCcs, embeddedEditUrlRequest.allowEditCcs) - && Objects.equals(this.allowFormView, embeddedEditUrlRequest.allowFormView) - && Objects.equals(this.ccRoles, embeddedEditUrlRequest.ccRoles) - && Objects.equals(this.editorOptions, embeddedEditUrlRequest.editorOptions) - && Objects.equals(this.forceSignerRoles, embeddedEditUrlRequest.forceSignerRoles) - && Objects.equals( - this.forceSubjectMessage, embeddedEditUrlRequest.forceSubjectMessage) - && Objects.equals(this.mergeFields, embeddedEditUrlRequest.mergeFields) - && Objects.equals(this.previewOnly, embeddedEditUrlRequest.previewOnly) - && Objects.equals(this.showPreview, embeddedEditUrlRequest.showPreview) - && Objects.equals( - this.showProgressStepper, embeddedEditUrlRequest.showProgressStepper) - && Objects.equals(this.testMode, embeddedEditUrlRequest.testMode); + if (showProgressStepper.getClass().equals(java.io.File.class) || + showProgressStepper.getClass().equals(Integer.class) || + showProgressStepper.getClass().equals(String.class) || + showProgressStepper.getClass().isEnum()) { + map.put("show_progress_stepper", showProgressStepper); + } else if (isListOfFile(showProgressStepper)) { + for(int i = 0; i< getListSize(showProgressStepper); i++) { + map.put("show_progress_stepper[" + i + "]", getFromList(showProgressStepper, i)); + } + } + else { + map.put("show_progress_stepper", JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - allowEditCcs, - allowFormView, - ccRoles, - editorOptions, - forceSignerRoles, - forceSubjectMessage, - mergeFields, - previewOnly, - showPreview, - showProgressStepper, - testMode); + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmbeddedEditUrlRequest {\n"); - sb.append(" allowEditCcs: ").append(toIndentedString(allowEditCcs)).append("\n"); - sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); - sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); - sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); - sb.append(" forceSignerRoles: ").append(toIndentedString(forceSignerRoles)).append("\n"); - sb.append(" forceSubjectMessage: ") - .append(toIndentedString(forceSubjectMessage)) - .append("\n"); - sb.append(" mergeFields: ").append(toIndentedString(mergeFields)).append("\n"); - sb.append(" previewOnly: ").append(toIndentedString(previewOnly)).append("\n"); - sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); - sb.append(" showProgressStepper: ") - .append(toIndentedString(showProgressStepper)) - .append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (allowEditCcs != null) { - if (isFileTypeOrListOfFiles(allowEditCcs)) { - fileTypeFound = true; - } - - if (allowEditCcs.getClass().equals(java.io.File.class) - || allowEditCcs.getClass().equals(Integer.class) - || allowEditCcs.getClass().equals(String.class) - || allowEditCcs.getClass().isEnum()) { - map.put("allow_edit_ccs", allowEditCcs); - } else if (isListOfFile(allowEditCcs)) { - for (int i = 0; i < getListSize(allowEditCcs); i++) { - map.put("allow_edit_ccs[" + i + "]", getFromList(allowEditCcs, i)); - } - } else { - map.put( - "allow_edit_ccs", - JSON.getDefault().getMapper().writeValueAsString(allowEditCcs)); - } - } - if (allowFormView != null) { - if (isFileTypeOrListOfFiles(allowFormView)) { - fileTypeFound = true; - } - - if (allowFormView.getClass().equals(java.io.File.class) - || allowFormView.getClass().equals(Integer.class) - || allowFormView.getClass().equals(String.class) - || allowFormView.getClass().isEnum()) { - map.put("allow_form_view", allowFormView); - } else if (isListOfFile(allowFormView)) { - for (int i = 0; i < getListSize(allowFormView); i++) { - map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); - } - } else { - map.put( - "allow_form_view", - JSON.getDefault().getMapper().writeValueAsString(allowFormView)); - } - } - if (ccRoles != null) { - if (isFileTypeOrListOfFiles(ccRoles)) { - fileTypeFound = true; - } - - if (ccRoles.getClass().equals(java.io.File.class) - || ccRoles.getClass().equals(Integer.class) - || ccRoles.getClass().equals(String.class) - || ccRoles.getClass().isEnum()) { - map.put("cc_roles", ccRoles); - } else if (isListOfFile(ccRoles)) { - for (int i = 0; i < getListSize(ccRoles); i++) { - map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); - } - } else { - map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); - } - } - if (editorOptions != null) { - if (isFileTypeOrListOfFiles(editorOptions)) { - fileTypeFound = true; - } - - if (editorOptions.getClass().equals(java.io.File.class) - || editorOptions.getClass().equals(Integer.class) - || editorOptions.getClass().equals(String.class) - || editorOptions.getClass().isEnum()) { - map.put("editor_options", editorOptions); - } else if (isListOfFile(editorOptions)) { - for (int i = 0; i < getListSize(editorOptions); i++) { - map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); - } - } else { - map.put( - "editor_options", - JSON.getDefault().getMapper().writeValueAsString(editorOptions)); - } - } - if (forceSignerRoles != null) { - if (isFileTypeOrListOfFiles(forceSignerRoles)) { - fileTypeFound = true; - } - - if (forceSignerRoles.getClass().equals(java.io.File.class) - || forceSignerRoles.getClass().equals(Integer.class) - || forceSignerRoles.getClass().equals(String.class) - || forceSignerRoles.getClass().isEnum()) { - map.put("force_signer_roles", forceSignerRoles); - } else if (isListOfFile(forceSignerRoles)) { - for (int i = 0; i < getListSize(forceSignerRoles); i++) { - map.put("force_signer_roles[" + i + "]", getFromList(forceSignerRoles, i)); - } - } else { - map.put( - "force_signer_roles", - JSON.getDefault().getMapper().writeValueAsString(forceSignerRoles)); - } - } - if (forceSubjectMessage != null) { - if (isFileTypeOrListOfFiles(forceSubjectMessage)) { - fileTypeFound = true; - } - - if (forceSubjectMessage.getClass().equals(java.io.File.class) - || forceSubjectMessage.getClass().equals(Integer.class) - || forceSubjectMessage.getClass().equals(String.class) - || forceSubjectMessage.getClass().isEnum()) { - map.put("force_subject_message", forceSubjectMessage); - } else if (isListOfFile(forceSubjectMessage)) { - for (int i = 0; i < getListSize(forceSubjectMessage); i++) { - map.put( - "force_subject_message[" + i + "]", - getFromList(forceSubjectMessage, i)); - } - } else { - map.put( - "force_subject_message", - JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); - } - } - if (mergeFields != null) { - if (isFileTypeOrListOfFiles(mergeFields)) { - fileTypeFound = true; - } - - if (mergeFields.getClass().equals(java.io.File.class) - || mergeFields.getClass().equals(Integer.class) - || mergeFields.getClass().equals(String.class) - || mergeFields.getClass().isEnum()) { - map.put("merge_fields", mergeFields); - } else if (isListOfFile(mergeFields)) { - for (int i = 0; i < getListSize(mergeFields); i++) { - map.put("merge_fields[" + i + "]", getFromList(mergeFields, i)); - } - } else { - map.put( - "merge_fields", - JSON.getDefault().getMapper().writeValueAsString(mergeFields)); - } - } - if (previewOnly != null) { - if (isFileTypeOrListOfFiles(previewOnly)) { - fileTypeFound = true; - } - - if (previewOnly.getClass().equals(java.io.File.class) - || previewOnly.getClass().equals(Integer.class) - || previewOnly.getClass().equals(String.class) - || previewOnly.getClass().isEnum()) { - map.put("preview_only", previewOnly); - } else if (isListOfFile(previewOnly)) { - for (int i = 0; i < getListSize(previewOnly); i++) { - map.put("preview_only[" + i + "]", getFromList(previewOnly, i)); - } - } else { - map.put( - "preview_only", - JSON.getDefault().getMapper().writeValueAsString(previewOnly)); - } - } - if (showPreview != null) { - if (isFileTypeOrListOfFiles(showPreview)) { - fileTypeFound = true; - } - - if (showPreview.getClass().equals(java.io.File.class) - || showPreview.getClass().equals(Integer.class) - || showPreview.getClass().equals(String.class) - || showPreview.getClass().isEnum()) { - map.put("show_preview", showPreview); - } else if (isListOfFile(showPreview)) { - for (int i = 0; i < getListSize(showPreview); i++) { - map.put("show_preview[" + i + "]", getFromList(showPreview, i)); - } - } else { - map.put( - "show_preview", - JSON.getDefault().getMapper().writeValueAsString(showPreview)); - } - } - if (showProgressStepper != null) { - if (isFileTypeOrListOfFiles(showProgressStepper)) { - fileTypeFound = true; - } - - if (showProgressStepper.getClass().equals(java.io.File.class) - || showProgressStepper.getClass().equals(Integer.class) - || showProgressStepper.getClass().equals(String.class) - || showProgressStepper.getClass().isEnum()) { - map.put("show_progress_stepper", showProgressStepper); - } else if (isListOfFile(showProgressStepper)) { - for (int i = 0; i < getListSize(showProgressStepper); i++) { - map.put( - "show_progress_stepper[" + i + "]", - getFromList(showProgressStepper, i)); - } - } else { - map.put( - "show_progress_stepper", - JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java index 30bd517e5..5bcc9d6b8 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java @@ -10,218 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.EmbeddedEditUrlResponseEmbedded; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** EmbeddedEditUrlResponse */ + +import com.dropbox.sign.ApiException; +/** + * EmbeddedEditUrlResponse + */ @JsonPropertyOrder({ - EmbeddedEditUrlResponse.JSON_PROPERTY_EMBEDDED, - EmbeddedEditUrlResponse.JSON_PROPERTY_WARNINGS + EmbeddedEditUrlResponse.JSON_PROPERTY_EMBEDDED, + EmbeddedEditUrlResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class EmbeddedEditUrlResponse { - public static final String JSON_PROPERTY_EMBEDDED = "embedded"; - @javax.annotation.Nonnull private EmbeddedEditUrlResponseEmbedded embedded; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public EmbeddedEditUrlResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static EmbeddedEditUrlResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EmbeddedEditUrlResponse.class); - } - - public static EmbeddedEditUrlResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), EmbeddedEditUrlResponse.class); - } - - public EmbeddedEditUrlResponse embedded( - @javax.annotation.Nonnull EmbeddedEditUrlResponseEmbedded embedded) { - this.embedded = embedded; - return this; - } - - /** - * Get embedded - * - * @return embedded - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public EmbeddedEditUrlResponseEmbedded getEmbedded() { - return embedded; - } - - @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmbedded(@javax.annotation.Nonnull EmbeddedEditUrlResponseEmbedded embedded) { - this.embedded = embedded; - } - - public EmbeddedEditUrlResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public EmbeddedEditUrlResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_EMBEDDED = "embedded"; + @javax.annotation.Nonnull + private EmbeddedEditUrlResponseEmbedded embedded; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public EmbeddedEditUrlResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public EmbeddedEditUrlResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EmbeddedEditUrlResponse.class); + } + + static public EmbeddedEditUrlResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + EmbeddedEditUrlResponse.class + ); + } + + public EmbeddedEditUrlResponse embedded(@javax.annotation.Nonnull EmbeddedEditUrlResponseEmbedded embedded) { + this.embedded = embedded; + return this; + } + + /** + * Get embedded + * @return embedded + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMBEDDED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public EmbeddedEditUrlResponseEmbedded getEmbedded() { + return embedded; + } + + + @JsonProperty(JSON_PROPERTY_EMBEDDED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmbedded(@javax.annotation.Nonnull EmbeddedEditUrlResponseEmbedded embedded) { + this.embedded = embedded; + } + + + public EmbeddedEditUrlResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public EmbeddedEditUrlResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this EmbeddedEditUrlResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmbeddedEditUrlResponse embeddedEditUrlResponse = (EmbeddedEditUrlResponse) o; + return Objects.equals(this.embedded, embeddedEditUrlResponse.embedded) && + Objects.equals(this.warnings, embeddedEditUrlResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(embedded, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedEditUrlResponse {\n"); + sb.append(" embedded: ").append(toIndentedString(embedded)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (embedded != null) { + if (isFileTypeOrListOfFiles(embedded)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this EmbeddedEditUrlResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (embedded.getClass().equals(java.io.File.class) || + embedded.getClass().equals(Integer.class) || + embedded.getClass().equals(String.class) || + embedded.getClass().isEnum()) { + map.put("embedded", embedded); + } else if (isListOfFile(embedded)) { + for(int i = 0; i< getListSize(embedded); i++) { + map.put("embedded[" + i + "]", getFromList(embedded, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("embedded", JSON.getDefault().getMapper().writeValueAsString(embedded)); } - EmbeddedEditUrlResponse embeddedEditUrlResponse = (EmbeddedEditUrlResponse) o; - return Objects.equals(this.embedded, embeddedEditUrlResponse.embedded) - && Objects.equals(this.warnings, embeddedEditUrlResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(embedded, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmbeddedEditUrlResponse {\n"); - sb.append(" embedded: ").append(toIndentedString(embedded)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (embedded != null) { - if (isFileTypeOrListOfFiles(embedded)) { - fileTypeFound = true; - } - - if (embedded.getClass().equals(java.io.File.class) - || embedded.getClass().equals(Integer.class) - || embedded.getClass().equals(String.class) - || embedded.getClass().isEnum()) { - map.put("embedded", embedded); - } else if (isListOfFile(embedded)) { - for (int i = 0; i < getListSize(embedded); i++) { - map.put("embedded[" + i + "]", getFromList(embedded, i)); - } - } else { - map.put("embedded", JSON.getDefault().getMapper().writeValueAsString(embedded)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java index 92ea6cbe0..85f0d3b41 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java @@ -10,209 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** An embedded template object. */ + +import com.dropbox.sign.ApiException; +/** + * An embedded template object. + */ @JsonPropertyOrder({ - EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EDIT_URL, - EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT + EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EDIT_URL, + EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class EmbeddedEditUrlResponseEmbedded { - public static final String JSON_PROPERTY_EDIT_URL = "edit_url"; - @javax.annotation.Nullable private String editUrl; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public EmbeddedEditUrlResponseEmbedded() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static EmbeddedEditUrlResponseEmbedded init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EmbeddedEditUrlResponseEmbedded.class); - } - - public static EmbeddedEditUrlResponseEmbedded init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - EmbeddedEditUrlResponseEmbedded.class); - } - - public EmbeddedEditUrlResponseEmbedded editUrl(@javax.annotation.Nullable String editUrl) { - this.editUrl = editUrl; - return this; - } - - /** - * A template url that can be opened in an iFrame. - * - * @return editUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDIT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEditUrl() { - return editUrl; - } - - @JsonProperty(JSON_PROPERTY_EDIT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditUrl(@javax.annotation.Nullable String editUrl) { - this.editUrl = editUrl; - } - - public EmbeddedEditUrlResponseEmbedded expiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * The specific time that the the `edit_url` link expires, in epoch. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; - } + public static final String JSON_PROPERTY_EDIT_URL = "edit_url"; + @javax.annotation.Nullable + private String editUrl; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public EmbeddedEditUrlResponseEmbedded() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public EmbeddedEditUrlResponseEmbedded init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EmbeddedEditUrlResponseEmbedded.class); + } + + static public EmbeddedEditUrlResponseEmbedded init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + EmbeddedEditUrlResponseEmbedded.class + ); + } + + public EmbeddedEditUrlResponseEmbedded editUrl(@javax.annotation.Nullable String editUrl) { + this.editUrl = editUrl; + return this; + } + + /** + * A template url that can be opened in an iFrame. + * @return editUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EDIT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEditUrl() { + return editUrl; + } + + + @JsonProperty(JSON_PROPERTY_EDIT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditUrl(@javax.annotation.Nullable String editUrl) { + this.editUrl = editUrl; + } + + + public EmbeddedEditUrlResponseEmbedded expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * The specific time that the the `edit_url` link expires, in epoch. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this EmbeddedEditUrlResponseEmbedded object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmbeddedEditUrlResponseEmbedded embeddedEditUrlResponseEmbedded = (EmbeddedEditUrlResponseEmbedded) o; + return Objects.equals(this.editUrl, embeddedEditUrlResponseEmbedded.editUrl) && + Objects.equals(this.expiresAt, embeddedEditUrlResponseEmbedded.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(editUrl, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedEditUrlResponseEmbedded {\n"); + sb.append(" editUrl: ").append(toIndentedString(editUrl)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (editUrl != null) { + if (isFileTypeOrListOfFiles(editUrl)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; + if (editUrl.getClass().equals(java.io.File.class) || + editUrl.getClass().equals(Integer.class) || + editUrl.getClass().equals(String.class) || + editUrl.getClass().isEnum()) { + map.put("edit_url", editUrl); + } else if (isListOfFile(editUrl)) { + for(int i = 0; i< getListSize(editUrl); i++) { + map.put("edit_url[" + i + "]", getFromList(editUrl, i)); + } + } + else { + map.put("edit_url", JSON.getDefault().getMapper().writeValueAsString(editUrl)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - /** Return true if this EmbeddedEditUrlResponseEmbedded object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); } - EmbeddedEditUrlResponseEmbedded embeddedEditUrlResponseEmbedded = - (EmbeddedEditUrlResponseEmbedded) o; - return Objects.equals(this.editUrl, embeddedEditUrlResponseEmbedded.editUrl) - && Objects.equals(this.expiresAt, embeddedEditUrlResponseEmbedded.expiresAt); } - - @Override - public int hashCode() { - return Objects.hash(editUrl, expiresAt); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmbeddedEditUrlResponseEmbedded {\n"); - sb.append(" editUrl: ").append(toIndentedString(editUrl)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (editUrl != null) { - if (isFileTypeOrListOfFiles(editUrl)) { - fileTypeFound = true; - } - - if (editUrl.getClass().equals(java.io.File.class) - || editUrl.getClass().equals(Integer.class) - || editUrl.getClass().equals(String.class) - || editUrl.getClass().isEnum()) { - map.put("edit_url", editUrl); - } else if (isListOfFile(editUrl)) { - for (int i = 0; i < getListSize(editUrl); i++) { - map.put("edit_url[" + i + "]", getFromList(editUrl, i)); - } - } else { - map.put("edit_url", JSON.getDefault().getMapper().writeValueAsString(editUrl)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java index a49ec4993..aaefc2237 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java @@ -10,218 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.EmbeddedSignUrlResponseEmbedded; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** EmbeddedSignUrlResponse */ + +import com.dropbox.sign.ApiException; +/** + * EmbeddedSignUrlResponse + */ @JsonPropertyOrder({ - EmbeddedSignUrlResponse.JSON_PROPERTY_EMBEDDED, - EmbeddedSignUrlResponse.JSON_PROPERTY_WARNINGS + EmbeddedSignUrlResponse.JSON_PROPERTY_EMBEDDED, + EmbeddedSignUrlResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class EmbeddedSignUrlResponse { - public static final String JSON_PROPERTY_EMBEDDED = "embedded"; - @javax.annotation.Nonnull private EmbeddedSignUrlResponseEmbedded embedded; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public EmbeddedSignUrlResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static EmbeddedSignUrlResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EmbeddedSignUrlResponse.class); - } - - public static EmbeddedSignUrlResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), EmbeddedSignUrlResponse.class); - } - - public EmbeddedSignUrlResponse embedded( - @javax.annotation.Nonnull EmbeddedSignUrlResponseEmbedded embedded) { - this.embedded = embedded; - return this; - } - - /** - * Get embedded - * - * @return embedded - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public EmbeddedSignUrlResponseEmbedded getEmbedded() { - return embedded; - } - - @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmbedded(@javax.annotation.Nonnull EmbeddedSignUrlResponseEmbedded embedded) { - this.embedded = embedded; - } - - public EmbeddedSignUrlResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public EmbeddedSignUrlResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_EMBEDDED = "embedded"; + @javax.annotation.Nonnull + private EmbeddedSignUrlResponseEmbedded embedded; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public EmbeddedSignUrlResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public EmbeddedSignUrlResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EmbeddedSignUrlResponse.class); + } + + static public EmbeddedSignUrlResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + EmbeddedSignUrlResponse.class + ); + } + + public EmbeddedSignUrlResponse embedded(@javax.annotation.Nonnull EmbeddedSignUrlResponseEmbedded embedded) { + this.embedded = embedded; + return this; + } + + /** + * Get embedded + * @return embedded + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMBEDDED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public EmbeddedSignUrlResponseEmbedded getEmbedded() { + return embedded; + } + + + @JsonProperty(JSON_PROPERTY_EMBEDDED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmbedded(@javax.annotation.Nonnull EmbeddedSignUrlResponseEmbedded embedded) { + this.embedded = embedded; + } + + + public EmbeddedSignUrlResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public EmbeddedSignUrlResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this EmbeddedSignUrlResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmbeddedSignUrlResponse embeddedSignUrlResponse = (EmbeddedSignUrlResponse) o; + return Objects.equals(this.embedded, embeddedSignUrlResponse.embedded) && + Objects.equals(this.warnings, embeddedSignUrlResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(embedded, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedSignUrlResponse {\n"); + sb.append(" embedded: ").append(toIndentedString(embedded)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (embedded != null) { + if (isFileTypeOrListOfFiles(embedded)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this EmbeddedSignUrlResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (embedded.getClass().equals(java.io.File.class) || + embedded.getClass().equals(Integer.class) || + embedded.getClass().equals(String.class) || + embedded.getClass().isEnum()) { + map.put("embedded", embedded); + } else if (isListOfFile(embedded)) { + for(int i = 0; i< getListSize(embedded); i++) { + map.put("embedded[" + i + "]", getFromList(embedded, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("embedded", JSON.getDefault().getMapper().writeValueAsString(embedded)); } - EmbeddedSignUrlResponse embeddedSignUrlResponse = (EmbeddedSignUrlResponse) o; - return Objects.equals(this.embedded, embeddedSignUrlResponse.embedded) - && Objects.equals(this.warnings, embeddedSignUrlResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(embedded, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmbeddedSignUrlResponse {\n"); - sb.append(" embedded: ").append(toIndentedString(embedded)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (embedded != null) { - if (isFileTypeOrListOfFiles(embedded)) { - fileTypeFound = true; - } - - if (embedded.getClass().equals(java.io.File.class) - || embedded.getClass().equals(Integer.class) - || embedded.getClass().equals(String.class) - || embedded.getClass().isEnum()) { - map.put("embedded", embedded); - } else if (isListOfFile(embedded)) { - for (int i = 0; i < getListSize(embedded); i++) { - map.put("embedded[" + i + "]", getFromList(embedded, i)); - } - } else { - map.put("embedded", JSON.getDefault().getMapper().writeValueAsString(embedded)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java index cb4820ae6..c8e9c639a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java @@ -10,209 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** An object that contains necessary information to set up embedded signing. */ + +import com.dropbox.sign.ApiException; +/** + * An object that contains necessary information to set up embedded signing. + */ @JsonPropertyOrder({ - EmbeddedSignUrlResponseEmbedded.JSON_PROPERTY_SIGN_URL, - EmbeddedSignUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT + EmbeddedSignUrlResponseEmbedded.JSON_PROPERTY_SIGN_URL, + EmbeddedSignUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class EmbeddedSignUrlResponseEmbedded { - public static final String JSON_PROPERTY_SIGN_URL = "sign_url"; - @javax.annotation.Nullable private String signUrl; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public EmbeddedSignUrlResponseEmbedded() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static EmbeddedSignUrlResponseEmbedded init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EmbeddedSignUrlResponseEmbedded.class); - } - - public static EmbeddedSignUrlResponseEmbedded init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - EmbeddedSignUrlResponseEmbedded.class); - } - - public EmbeddedSignUrlResponseEmbedded signUrl(@javax.annotation.Nullable String signUrl) { - this.signUrl = signUrl; - return this; - } - - /** - * A signature url that can be opened in an iFrame. - * - * @return signUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGN_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSignUrl() { - return signUrl; - } - - @JsonProperty(JSON_PROPERTY_SIGN_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignUrl(@javax.annotation.Nullable String signUrl) { - this.signUrl = signUrl; - } - - public EmbeddedSignUrlResponseEmbedded expiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * The specific time that the the `sign_url` link expires, in epoch. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; - } + public static final String JSON_PROPERTY_SIGN_URL = "sign_url"; + @javax.annotation.Nullable + private String signUrl; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public EmbeddedSignUrlResponseEmbedded() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public EmbeddedSignUrlResponseEmbedded init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EmbeddedSignUrlResponseEmbedded.class); + } + + static public EmbeddedSignUrlResponseEmbedded init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + EmbeddedSignUrlResponseEmbedded.class + ); + } + + public EmbeddedSignUrlResponseEmbedded signUrl(@javax.annotation.Nullable String signUrl) { + this.signUrl = signUrl; + return this; + } + + /** + * A signature url that can be opened in an iFrame. + * @return signUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGN_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSignUrl() { + return signUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGN_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignUrl(@javax.annotation.Nullable String signUrl) { + this.signUrl = signUrl; + } + + + public EmbeddedSignUrlResponseEmbedded expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * The specific time that the the `sign_url` link expires, in epoch. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this EmbeddedSignUrlResponseEmbedded object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmbeddedSignUrlResponseEmbedded embeddedSignUrlResponseEmbedded = (EmbeddedSignUrlResponseEmbedded) o; + return Objects.equals(this.signUrl, embeddedSignUrlResponseEmbedded.signUrl) && + Objects.equals(this.expiresAt, embeddedSignUrlResponseEmbedded.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(signUrl, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedSignUrlResponseEmbedded {\n"); + sb.append(" signUrl: ").append(toIndentedString(signUrl)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (signUrl != null) { + if (isFileTypeOrListOfFiles(signUrl)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; + if (signUrl.getClass().equals(java.io.File.class) || + signUrl.getClass().equals(Integer.class) || + signUrl.getClass().equals(String.class) || + signUrl.getClass().isEnum()) { + map.put("sign_url", signUrl); + } else if (isListOfFile(signUrl)) { + for(int i = 0; i< getListSize(signUrl); i++) { + map.put("sign_url[" + i + "]", getFromList(signUrl, i)); + } + } + else { + map.put("sign_url", JSON.getDefault().getMapper().writeValueAsString(signUrl)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - /** Return true if this EmbeddedSignUrlResponseEmbedded object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); } - EmbeddedSignUrlResponseEmbedded embeddedSignUrlResponseEmbedded = - (EmbeddedSignUrlResponseEmbedded) o; - return Objects.equals(this.signUrl, embeddedSignUrlResponseEmbedded.signUrl) - && Objects.equals(this.expiresAt, embeddedSignUrlResponseEmbedded.expiresAt); } - - @Override - public int hashCode() { - return Objects.hash(signUrl, expiresAt); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmbeddedSignUrlResponseEmbedded {\n"); - sb.append(" signUrl: ").append(toIndentedString(signUrl)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (signUrl != null) { - if (isFileTypeOrListOfFiles(signUrl)) { - fileTypeFound = true; - } - - if (signUrl.getClass().equals(java.io.File.class) - || signUrl.getClass().equals(Integer.class) - || signUrl.getClass().equals(String.class) - || signUrl.getClass().isEnum()) { - map.put("sign_url", signUrl); - } else if (isListOfFile(signUrl)) { - for (int i = 0; i < getListSize(signUrl); i++) { - map.put("sign_url[" + i + "]", getFromList(signUrl, i)); - } - } else { - map.put("sign_url", JSON.getDefault().getMapper().writeValueAsString(signUrl)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponse.java index e8d26b220..f40120d03 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponse.java @@ -10,157 +10,171 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.ErrorResponseError; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** ErrorResponse */ -@JsonPropertyOrder({ErrorResponse.JSON_PROPERTY_ERROR}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class ErrorResponse { - public static final String JSON_PROPERTY_ERROR = "error"; - @javax.annotation.Nonnull private ErrorResponseError error; - - public ErrorResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ErrorResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ErrorResponse.class); - } - public static ErrorResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), ErrorResponse.class); - } - - public ErrorResponse error(@javax.annotation.Nonnull ErrorResponseError error) { - this.error = error; - return this; - } - - /** - * Get error - * - * @return error - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ERROR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ErrorResponseError getError() { - return error; +import com.dropbox.sign.ApiException; +/** + * ErrorResponse + */ +@JsonPropertyOrder({ + ErrorResponse.JSON_PROPERTY_ERROR +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class ErrorResponse { + public static final String JSON_PROPERTY_ERROR = "error"; + @javax.annotation.Nonnull + private ErrorResponseError error; + + public ErrorResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ErrorResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ErrorResponse.class); + } + + static public ErrorResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ErrorResponse.class + ); + } + + public ErrorResponse error(@javax.annotation.Nonnull ErrorResponseError error) { + this.error = error; + return this; + } + + /** + * Get error + * @return error + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ErrorResponseError getError() { + return error; + } + + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setError(@javax.annotation.Nonnull ErrorResponseError error) { + this.error = error; + } + + + /** + * Return true if this ErrorResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_ERROR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setError(@javax.annotation.Nonnull ErrorResponseError error) { - this.error = error; + if (o == null || getClass() != o.getClass()) { + return false; } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.error, errorResponse.error); + } + + @Override + public int hashCode() { + return Objects.hash(error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (error != null) { + if (isFileTypeOrListOfFiles(error)) { + fileTypeFound = true; + } - /** Return true if this ErrorResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (error.getClass().equals(java.io.File.class) || + error.getClass().equals(Integer.class) || + error.getClass().equals(String.class) || + error.getClass().isEnum()) { + map.put("error", error); + } else if (isListOfFile(error)) { + for(int i = 0; i< getListSize(error); i++) { + map.put("error[" + i + "]", getFromList(error, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("error", JSON.getDefault().getMapper().writeValueAsString(error)); } - ErrorResponse errorResponse = (ErrorResponse) o; - return Objects.equals(this.error, errorResponse.error); } - - @Override - public int hashCode() { - return Objects.hash(error); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ErrorResponse {\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (error != null) { - if (isFileTypeOrListOfFiles(error)) { - fileTypeFound = true; - } - - if (error.getClass().equals(java.io.File.class) - || error.getClass().equals(Integer.class) - || error.getClass().equals(String.class) - || error.getClass().isEnum()) { - map.put("error", error); - } else if (isListOfFile(error)) { - for (int i = 0; i < getListSize(error); i++) { - map.put("error[" + i + "]", getFromList(error, i)); - } - } else { - map.put("error", JSON.getDefault().getMapper().writeValueAsString(error)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponseError.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponseError.java index e9624c65f..82aacde97 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponseError.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponseError.java @@ -10,258 +10,272 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** Contains information about an error that occurred. */ + +import com.dropbox.sign.ApiException; +/** + * Contains information about an error that occurred. + */ @JsonPropertyOrder({ - ErrorResponseError.JSON_PROPERTY_ERROR_MSG, - ErrorResponseError.JSON_PROPERTY_ERROR_NAME, - ErrorResponseError.JSON_PROPERTY_ERROR_PATH + ErrorResponseError.JSON_PROPERTY_ERROR_MSG, + ErrorResponseError.JSON_PROPERTY_ERROR_NAME, + ErrorResponseError.JSON_PROPERTY_ERROR_PATH }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ErrorResponseError { - public static final String JSON_PROPERTY_ERROR_MSG = "error_msg"; - @javax.annotation.Nonnull private String errorMsg; + public static final String JSON_PROPERTY_ERROR_MSG = "error_msg"; + @javax.annotation.Nonnull + private String errorMsg; - public static final String JSON_PROPERTY_ERROR_NAME = "error_name"; - @javax.annotation.Nonnull private String errorName; + public static final String JSON_PROPERTY_ERROR_NAME = "error_name"; + @javax.annotation.Nonnull + private String errorName; - public static final String JSON_PROPERTY_ERROR_PATH = "error_path"; - @javax.annotation.Nullable private String errorPath; + public static final String JSON_PROPERTY_ERROR_PATH = "error_path"; + @javax.annotation.Nullable + private String errorPath; - public ErrorResponseError() {} + public ErrorResponseError() { + } - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ErrorResponseError init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ErrorResponseError.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ErrorResponseError init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ErrorResponseError.class); + } - public static ErrorResponseError init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), ErrorResponseError.class); - } + static public ErrorResponseError init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ErrorResponseError.class + ); + } - public ErrorResponseError errorMsg(@javax.annotation.Nonnull String errorMsg) { - this.errorMsg = errorMsg; - return this; - } + public ErrorResponseError errorMsg(@javax.annotation.Nonnull String errorMsg) { + this.errorMsg = errorMsg; + return this; + } - /** - * Message describing an error. - * - * @return errorMsg - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ERROR_MSG) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getErrorMsg() { - return errorMsg; - } + /** + * Message describing an error. + * @return errorMsg + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ERROR_MSG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - @JsonProperty(JSON_PROPERTY_ERROR_MSG) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setErrorMsg(@javax.annotation.Nonnull String errorMsg) { - this.errorMsg = errorMsg; - } + public String getErrorMsg() { + return errorMsg; + } - public ErrorResponseError errorName(@javax.annotation.Nonnull String errorName) { - this.errorName = errorName; - return this; - } - /** - * Name of the error. - * - * @return errorName - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ERROR_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getErrorName() { - return errorName; - } + @JsonProperty(JSON_PROPERTY_ERROR_MSG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setErrorMsg(@javax.annotation.Nonnull String errorMsg) { + this.errorMsg = errorMsg; + } - @JsonProperty(JSON_PROPERTY_ERROR_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setErrorName(@javax.annotation.Nonnull String errorName) { - this.errorName = errorName; - } - public ErrorResponseError errorPath(@javax.annotation.Nullable String errorPath) { - this.errorPath = errorPath; - return this; - } + public ErrorResponseError errorName(@javax.annotation.Nonnull String errorName) { + this.errorName = errorName; + return this; + } - /** - * Path at which an error occurred. - * - * @return errorPath - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ERROR_PATH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getErrorPath() { - return errorPath; - } + /** + * Name of the error. + * @return errorName + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ERROR_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getErrorName() { + return errorName; + } + + + @JsonProperty(JSON_PROPERTY_ERROR_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setErrorName(@javax.annotation.Nonnull String errorName) { + this.errorName = errorName; + } + + + public ErrorResponseError errorPath(@javax.annotation.Nullable String errorPath) { + this.errorPath = errorPath; + return this; + } + + /** + * Path at which an error occurred. + * @return errorPath + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_ERROR_PATH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setErrorPath(@javax.annotation.Nullable String errorPath) { - this.errorPath = errorPath; + public String getErrorPath() { + return errorPath; + } + + + @JsonProperty(JSON_PROPERTY_ERROR_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorPath(@javax.annotation.Nullable String errorPath) { + this.errorPath = errorPath; + } + + + /** + * Return true if this ErrorResponseError object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponseError errorResponseError = (ErrorResponseError) o; + return Objects.equals(this.errorMsg, errorResponseError.errorMsg) && + Objects.equals(this.errorName, errorResponseError.errorName) && + Objects.equals(this.errorPath, errorResponseError.errorPath); + } - /** Return true if this ErrorResponseError object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; + @Override + public int hashCode() { + return Objects.hash(errorMsg, errorName, errorPath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponseError {\n"); + sb.append(" errorMsg: ").append(toIndentedString(errorMsg)).append("\n"); + sb.append(" errorName: ").append(toIndentedString(errorName)).append("\n"); + sb.append(" errorPath: ").append(toIndentedString(errorPath)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (errorMsg != null) { + if (isFileTypeOrListOfFiles(errorMsg)) { + fileTypeFound = true; } - ErrorResponseError errorResponseError = (ErrorResponseError) o; - return Objects.equals(this.errorMsg, errorResponseError.errorMsg) - && Objects.equals(this.errorName, errorResponseError.errorName) - && Objects.equals(this.errorPath, errorResponseError.errorPath); - } - @Override - public int hashCode() { - return Objects.hash(errorMsg, errorName, errorPath); + if (errorMsg.getClass().equals(java.io.File.class) || + errorMsg.getClass().equals(Integer.class) || + errorMsg.getClass().equals(String.class) || + errorMsg.getClass().isEnum()) { + map.put("error_msg", errorMsg); + } else if (isListOfFile(errorMsg)) { + for(int i = 0; i< getListSize(errorMsg); i++) { + map.put("error_msg[" + i + "]", getFromList(errorMsg, i)); + } + } + else { + map.put("error_msg", JSON.getDefault().getMapper().writeValueAsString(errorMsg)); + } } + if (errorName != null) { + if (isFileTypeOrListOfFiles(errorName)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ErrorResponseError {\n"); - sb.append(" errorMsg: ").append(toIndentedString(errorMsg)).append("\n"); - sb.append(" errorName: ").append(toIndentedString(errorName)).append("\n"); - sb.append(" errorPath: ").append(toIndentedString(errorPath)).append("\n"); - sb.append("}"); - return sb.toString(); + if (errorName.getClass().equals(java.io.File.class) || + errorName.getClass().equals(Integer.class) || + errorName.getClass().equals(String.class) || + errorName.getClass().isEnum()) { + map.put("error_name", errorName); + } else if (isListOfFile(errorName)) { + for(int i = 0; i< getListSize(errorName); i++) { + map.put("error_name[" + i + "]", getFromList(errorName, i)); + } + } + else { + map.put("error_name", JSON.getDefault().getMapper().writeValueAsString(errorName)); + } } + if (errorPath != null) { + if (isFileTypeOrListOfFiles(errorPath)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (errorMsg != null) { - if (isFileTypeOrListOfFiles(errorMsg)) { - fileTypeFound = true; - } - - if (errorMsg.getClass().equals(java.io.File.class) - || errorMsg.getClass().equals(Integer.class) - || errorMsg.getClass().equals(String.class) - || errorMsg.getClass().isEnum()) { - map.put("error_msg", errorMsg); - } else if (isListOfFile(errorMsg)) { - for (int i = 0; i < getListSize(errorMsg); i++) { - map.put("error_msg[" + i + "]", getFromList(errorMsg, i)); - } - } else { - map.put( - "error_msg", - JSON.getDefault().getMapper().writeValueAsString(errorMsg)); - } - } - if (errorName != null) { - if (isFileTypeOrListOfFiles(errorName)) { - fileTypeFound = true; - } - - if (errorName.getClass().equals(java.io.File.class) - || errorName.getClass().equals(Integer.class) - || errorName.getClass().equals(String.class) - || errorName.getClass().isEnum()) { - map.put("error_name", errorName); - } else if (isListOfFile(errorName)) { - for (int i = 0; i < getListSize(errorName); i++) { - map.put("error_name[" + i + "]", getFromList(errorName, i)); - } - } else { - map.put( - "error_name", - JSON.getDefault().getMapper().writeValueAsString(errorName)); - } + if (errorPath.getClass().equals(java.io.File.class) || + errorPath.getClass().equals(Integer.class) || + errorPath.getClass().equals(String.class) || + errorPath.getClass().isEnum()) { + map.put("error_path", errorPath); + } else if (isListOfFile(errorPath)) { + for(int i = 0; i< getListSize(errorPath); i++) { + map.put("error_path[" + i + "]", getFromList(errorPath, i)); } - if (errorPath != null) { - if (isFileTypeOrListOfFiles(errorPath)) { - fileTypeFound = true; - } - - if (errorPath.getClass().equals(java.io.File.class) - || errorPath.getClass().equals(Integer.class) - || errorPath.getClass().equals(String.class) - || errorPath.getClass().isEnum()) { - map.put("error_path", errorPath); - } else if (isListOfFile(errorPath)) { - for (int i = 0; i < getListSize(errorPath); i++) { - map.put("error_path[" + i + "]", getFromList(errorPath, i)); - } - } else { - map.put( - "error_path", - JSON.getDefault().getMapper().writeValueAsString(errorPath)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("error_path", JSON.getDefault().getMapper().writeValueAsString(errorPath)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java index a7c7f100e..cc56f2727 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java @@ -10,301 +10,327 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.AccountResponse; +import com.dropbox.sign.model.EventCallbackRequestEvent; +import com.dropbox.sign.model.SignatureRequestResponse; +import com.dropbox.sign.model.TemplateResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** EventCallbackRequest */ + +import com.dropbox.sign.ApiException; +/** + * EventCallbackRequest + */ @JsonPropertyOrder({ - EventCallbackRequest.JSON_PROPERTY_EVENT, - EventCallbackRequest.JSON_PROPERTY_ACCOUNT, - EventCallbackRequest.JSON_PROPERTY_SIGNATURE_REQUEST, - EventCallbackRequest.JSON_PROPERTY_TEMPLATE + EventCallbackRequest.JSON_PROPERTY_EVENT, + EventCallbackRequest.JSON_PROPERTY_ACCOUNT, + EventCallbackRequest.JSON_PROPERTY_SIGNATURE_REQUEST, + EventCallbackRequest.JSON_PROPERTY_TEMPLATE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class EventCallbackRequest { - public static final String JSON_PROPERTY_EVENT = "event"; - @javax.annotation.Nonnull private EventCallbackRequestEvent event; - - public static final String JSON_PROPERTY_ACCOUNT = "account"; - @javax.annotation.Nullable private AccountResponse account; - - public static final String JSON_PROPERTY_SIGNATURE_REQUEST = "signature_request"; - @javax.annotation.Nullable private SignatureRequestResponse signatureRequest; - - public static final String JSON_PROPERTY_TEMPLATE = "template"; - @javax.annotation.Nullable private TemplateResponse template; - - public EventCallbackRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static EventCallbackRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EventCallbackRequest.class); + public static final String JSON_PROPERTY_EVENT = "event"; + @javax.annotation.Nonnull + private EventCallbackRequestEvent event; + + public static final String JSON_PROPERTY_ACCOUNT = "account"; + @javax.annotation.Nullable + private AccountResponse account; + + public static final String JSON_PROPERTY_SIGNATURE_REQUEST = "signature_request"; + @javax.annotation.Nullable + private SignatureRequestResponse signatureRequest; + + public static final String JSON_PROPERTY_TEMPLATE = "template"; + @javax.annotation.Nullable + private TemplateResponse template; + + public EventCallbackRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public EventCallbackRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EventCallbackRequest.class); + } + + static public EventCallbackRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + EventCallbackRequest.class + ); + } + + public EventCallbackRequest event(@javax.annotation.Nonnull EventCallbackRequestEvent event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public EventCallbackRequestEvent getEvent() { + return event; + } + + + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEvent(@javax.annotation.Nonnull EventCallbackRequestEvent event) { + this.event = event; + } + + + public EventCallbackRequest account(@javax.annotation.Nullable AccountResponse account) { + this.account = account; + return this; + } + + /** + * Get account + * @return account + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AccountResponse getAccount() { + return account; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccount(@javax.annotation.Nullable AccountResponse account) { + this.account = account; + } + + + public EventCallbackRequest signatureRequest(@javax.annotation.Nullable SignatureRequestResponse signatureRequest) { + this.signatureRequest = signatureRequest; + return this; + } + + /** + * Get signatureRequest + * @return signatureRequest + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SignatureRequestResponse getSignatureRequest() { + return signatureRequest; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatureRequest(@javax.annotation.Nullable SignatureRequestResponse signatureRequest) { + this.signatureRequest = signatureRequest; + } + + + public EventCallbackRequest template(@javax.annotation.Nullable TemplateResponse template) { + this.template = template; + return this; + } + + /** + * Get template + * @return template + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TemplateResponse getTemplate() { + return template; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplate(@javax.annotation.Nullable TemplateResponse template) { + this.template = template; + } + + + /** + * Return true if this EventCallbackRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public static EventCallbackRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), EventCallbackRequest.class); - } - - public EventCallbackRequest event(@javax.annotation.Nonnull EventCallbackRequestEvent event) { - this.event = event; - return this; - } - - /** - * Get event - * - * @return event - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EVENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public EventCallbackRequestEvent getEvent() { - return event; - } - - @JsonProperty(JSON_PROPERTY_EVENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEvent(@javax.annotation.Nonnull EventCallbackRequestEvent event) { - this.event = event; - } - - public EventCallbackRequest account(@javax.annotation.Nullable AccountResponse account) { - this.account = account; - return this; - } - - /** - * Get account - * - * @return account - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AccountResponse getAccount() { - return account; - } - - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccount(@javax.annotation.Nullable AccountResponse account) { - this.account = account; - } - - public EventCallbackRequest signatureRequest( - @javax.annotation.Nullable SignatureRequestResponse signatureRequest) { - this.signatureRequest = signatureRequest; - return this; - } - - /** - * Get signatureRequest - * - * @return signatureRequest - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SignatureRequestResponse getSignatureRequest() { - return signatureRequest; - } - - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatureRequest( - @javax.annotation.Nullable SignatureRequestResponse signatureRequest) { - this.signatureRequest = signatureRequest; - } - - public EventCallbackRequest template(@javax.annotation.Nullable TemplateResponse template) { - this.template = template; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + EventCallbackRequest eventCallbackRequest = (EventCallbackRequest) o; + return Objects.equals(this.event, eventCallbackRequest.event) && + Objects.equals(this.account, eventCallbackRequest.account) && + Objects.equals(this.signatureRequest, eventCallbackRequest.signatureRequest) && + Objects.equals(this.template, eventCallbackRequest.template); + } + + @Override + public int hashCode() { + return Objects.hash(event, account, signatureRequest, template); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventCallbackRequest {\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" account: ").append(toIndentedString(account)).append("\n"); + sb.append(" signatureRequest: ").append(toIndentedString(signatureRequest)).append("\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (event != null) { + if (isFileTypeOrListOfFiles(event)) { + fileTypeFound = true; + } - /** - * Get template - * - * @return template - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TemplateResponse getTemplate() { - return template; + if (event.getClass().equals(java.io.File.class) || + event.getClass().equals(Integer.class) || + event.getClass().equals(String.class) || + event.getClass().isEnum()) { + map.put("event", event); + } else if (isListOfFile(event)) { + for(int i = 0; i< getListSize(event); i++) { + map.put("event[" + i + "]", getFromList(event, i)); + } + } + else { + map.put("event", JSON.getDefault().getMapper().writeValueAsString(event)); + } } + if (account != null) { + if (isFileTypeOrListOfFiles(account)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplate(@javax.annotation.Nullable TemplateResponse template) { - this.template = template; + if (account.getClass().equals(java.io.File.class) || + account.getClass().equals(Integer.class) || + account.getClass().equals(String.class) || + account.getClass().isEnum()) { + map.put("account", account); + } else if (isListOfFile(account)) { + for(int i = 0; i< getListSize(account); i++) { + map.put("account[" + i + "]", getFromList(account, i)); + } + } + else { + map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); + } } + if (signatureRequest != null) { + if (isFileTypeOrListOfFiles(signatureRequest)) { + fileTypeFound = true; + } - /** Return true if this EventCallbackRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (signatureRequest.getClass().equals(java.io.File.class) || + signatureRequest.getClass().equals(Integer.class) || + signatureRequest.getClass().equals(String.class) || + signatureRequest.getClass().isEnum()) { + map.put("signature_request", signatureRequest); + } else if (isListOfFile(signatureRequest)) { + for(int i = 0; i< getListSize(signatureRequest); i++) { + map.put("signature_request[" + i + "]", getFromList(signatureRequest, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("signature_request", JSON.getDefault().getMapper().writeValueAsString(signatureRequest)); } - EventCallbackRequest eventCallbackRequest = (EventCallbackRequest) o; - return Objects.equals(this.event, eventCallbackRequest.event) - && Objects.equals(this.account, eventCallbackRequest.account) - && Objects.equals(this.signatureRequest, eventCallbackRequest.signatureRequest) - && Objects.equals(this.template, eventCallbackRequest.template); } + if (template != null) { + if (isFileTypeOrListOfFiles(template)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(event, account, signatureRequest, template); + if (template.getClass().equals(java.io.File.class) || + template.getClass().equals(Integer.class) || + template.getClass().equals(String.class) || + template.getClass().isEnum()) { + map.put("template", template); + } else if (isListOfFile(template)) { + for(int i = 0; i< getListSize(template); i++) { + map.put("template[" + i + "]", getFromList(template, i)); + } + } + else { + map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EventCallbackRequest {\n"); - sb.append(" event: ").append(toIndentedString(event)).append("\n"); - sb.append(" account: ").append(toIndentedString(account)).append("\n"); - sb.append(" signatureRequest: ").append(toIndentedString(signatureRequest)).append("\n"); - sb.append(" template: ").append(toIndentedString(template)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (event != null) { - if (isFileTypeOrListOfFiles(event)) { - fileTypeFound = true; - } - - if (event.getClass().equals(java.io.File.class) - || event.getClass().equals(Integer.class) - || event.getClass().equals(String.class) - || event.getClass().isEnum()) { - map.put("event", event); - } else if (isListOfFile(event)) { - for (int i = 0; i < getListSize(event); i++) { - map.put("event[" + i + "]", getFromList(event, i)); - } - } else { - map.put("event", JSON.getDefault().getMapper().writeValueAsString(event)); - } - } - if (account != null) { - if (isFileTypeOrListOfFiles(account)) { - fileTypeFound = true; - } - - if (account.getClass().equals(java.io.File.class) - || account.getClass().equals(Integer.class) - || account.getClass().equals(String.class) - || account.getClass().isEnum()) { - map.put("account", account); - } else if (isListOfFile(account)) { - for (int i = 0; i < getListSize(account); i++) { - map.put("account[" + i + "]", getFromList(account, i)); - } - } else { - map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); - } - } - if (signatureRequest != null) { - if (isFileTypeOrListOfFiles(signatureRequest)) { - fileTypeFound = true; - } - - if (signatureRequest.getClass().equals(java.io.File.class) - || signatureRequest.getClass().equals(Integer.class) - || signatureRequest.getClass().equals(String.class) - || signatureRequest.getClass().isEnum()) { - map.put("signature_request", signatureRequest); - } else if (isListOfFile(signatureRequest)) { - for (int i = 0; i < getListSize(signatureRequest); i++) { - map.put("signature_request[" + i + "]", getFromList(signatureRequest, i)); - } - } else { - map.put( - "signature_request", - JSON.getDefault().getMapper().writeValueAsString(signatureRequest)); - } - } - if (template != null) { - if (isFileTypeOrListOfFiles(template)) { - fileTypeFound = true; - } - - if (template.getClass().equals(java.io.File.class) - || template.getClass().equals(Integer.class) - || template.getClass().equals(String.class) - || template.getClass().isEnum()) { - map.put("template", template); - } else if (isListOfFile(template)) { - for (int i = 0; i < getListSize(template); i++) { - map.put("template[" + i + "]", getFromList(template, i)); - } - } else { - map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java index a3e999816..85a354c10 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java @@ -10,388 +10,401 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.EventCallbackRequestEventMetadata; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** Basic information about the event that occurred. */ + +import com.dropbox.sign.ApiException; +/** + * Basic information about the event that occurred. + */ @JsonPropertyOrder({ - EventCallbackRequestEvent.JSON_PROPERTY_EVENT_TIME, - EventCallbackRequestEvent.JSON_PROPERTY_EVENT_TYPE, - EventCallbackRequestEvent.JSON_PROPERTY_EVENT_HASH, - EventCallbackRequestEvent.JSON_PROPERTY_EVENT_METADATA + EventCallbackRequestEvent.JSON_PROPERTY_EVENT_TIME, + EventCallbackRequestEvent.JSON_PROPERTY_EVENT_TYPE, + EventCallbackRequestEvent.JSON_PROPERTY_EVENT_HASH, + EventCallbackRequestEvent.JSON_PROPERTY_EVENT_METADATA }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class EventCallbackRequestEvent { - public static final String JSON_PROPERTY_EVENT_TIME = "event_time"; - @javax.annotation.Nonnull private String eventTime; - - /** Type of callback event that was triggered. */ - public enum EventTypeEnum { - ACCOUNT_CONFIRMED(String.valueOf("account_confirmed")), - - UNKNOWN_ERROR(String.valueOf("unknown_error")), - - FILE_ERROR(String.valueOf("file_error")), - - SIGN_URL_INVALID(String.valueOf("sign_url_invalid")), - - SIGNATURE_REQUEST_VIEWED(String.valueOf("signature_request_viewed")), - - SIGNATURE_REQUEST_SIGNED(String.valueOf("signature_request_signed")), - - SIGNATURE_REQUEST_SENT(String.valueOf("signature_request_sent")), - - SIGNATURE_REQUEST_ALL_SIGNED(String.valueOf("signature_request_all_signed")), - - SIGNATURE_REQUEST_EMAIL_BOUNCE(String.valueOf("signature_request_email_bounce")), - - SIGNATURE_REQUEST_REMIND(String.valueOf("signature_request_remind")), - - SIGNATURE_REQUEST_INCOMPLETE_QES(String.valueOf("signature_request_incomplete_qes")), - - SIGNATURE_REQUEST_DESTROYED(String.valueOf("signature_request_destroyed")), - - SIGNATURE_REQUEST_CANCELED(String.valueOf("signature_request_canceled")), - - SIGNATURE_REQUEST_DOWNLOADABLE(String.valueOf("signature_request_downloadable")), - - SIGNATURE_REQUEST_DECLINED(String.valueOf("signature_request_declined")), - - SIGNATURE_REQUEST_REASSIGNED(String.valueOf("signature_request_reassigned")), - - SIGNATURE_REQUEST_INVALID(String.valueOf("signature_request_invalid")), - - SIGNATURE_REQUEST_PREPARED(String.valueOf("signature_request_prepared")), - - SIGNATURE_REQUEST_EXPIRED(String.valueOf("signature_request_expired")), - - TEMPLATE_CREATED(String.valueOf("template_created")), - - TEMPLATE_ERROR(String.valueOf("template_error")), - - CALLBACK_TEST(String.valueOf("callback_test")), - - SIGNATURE_REQUEST_SIGNER_REMOVED(String.valueOf("signature_request_signer_removed")); - - private String value; - - EventTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EventTypeEnum fromValue(String value) { - for (EventTypeEnum b : EventTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + public static final String JSON_PROPERTY_EVENT_TIME = "event_time"; + @javax.annotation.Nonnull + private String eventTime; + + /** + * Type of callback event that was triggered. + */ + public enum EventTypeEnum { + ACCOUNT_CONFIRMED(String.valueOf("account_confirmed")), + + UNKNOWN_ERROR(String.valueOf("unknown_error")), + + FILE_ERROR(String.valueOf("file_error")), + + SIGN_URL_INVALID(String.valueOf("sign_url_invalid")), + + SIGNATURE_REQUEST_VIEWED(String.valueOf("signature_request_viewed")), + + SIGNATURE_REQUEST_SIGNED(String.valueOf("signature_request_signed")), + + SIGNATURE_REQUEST_SENT(String.valueOf("signature_request_sent")), + + SIGNATURE_REQUEST_ALL_SIGNED(String.valueOf("signature_request_all_signed")), + + SIGNATURE_REQUEST_EMAIL_BOUNCE(String.valueOf("signature_request_email_bounce")), + + SIGNATURE_REQUEST_REMIND(String.valueOf("signature_request_remind")), + + SIGNATURE_REQUEST_INCOMPLETE_QES(String.valueOf("signature_request_incomplete_qes")), + + SIGNATURE_REQUEST_DESTROYED(String.valueOf("signature_request_destroyed")), + + SIGNATURE_REQUEST_CANCELED(String.valueOf("signature_request_canceled")), + + SIGNATURE_REQUEST_DOWNLOADABLE(String.valueOf("signature_request_downloadable")), + + SIGNATURE_REQUEST_DECLINED(String.valueOf("signature_request_declined")), + + SIGNATURE_REQUEST_REASSIGNED(String.valueOf("signature_request_reassigned")), + + SIGNATURE_REQUEST_INVALID(String.valueOf("signature_request_invalid")), + + SIGNATURE_REQUEST_PREPARED(String.valueOf("signature_request_prepared")), + + SIGNATURE_REQUEST_EXPIRED(String.valueOf("signature_request_expired")), + + TEMPLATE_CREATED(String.valueOf("template_created")), + + TEMPLATE_ERROR(String.valueOf("template_error")), + + CALLBACK_TEST(String.valueOf("callback_test")), + + SIGNATURE_REQUEST_SIGNER_REMOVED(String.valueOf("signature_request_signer_removed")); + + private String value; + + EventTypeEnum(String value) { + this.value = value; } - public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; - @javax.annotation.Nonnull private EventTypeEnum eventType; - - public static final String JSON_PROPERTY_EVENT_HASH = "event_hash"; - @javax.annotation.Nonnull private String eventHash; - - public static final String JSON_PROPERTY_EVENT_METADATA = "event_metadata"; - @javax.annotation.Nullable private EventCallbackRequestEventMetadata eventMetadata; - - public EventCallbackRequestEvent() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static EventCallbackRequestEvent init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EventCallbackRequestEvent.class); - } - - public static EventCallbackRequestEvent init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - EventCallbackRequestEvent.class); - } - - public EventCallbackRequestEvent eventTime(@javax.annotation.Nonnull String eventTime) { - this.eventTime = eventTime; - return this; - } - - /** - * Time the event was created (using Unix time). - * - * @return eventTime - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EVENT_TIME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getEventTime() { - return eventTime; - } - - @JsonProperty(JSON_PROPERTY_EVENT_TIME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEventTime(@javax.annotation.Nonnull String eventTime) { - this.eventTime = eventTime; - } - - public EventCallbackRequestEvent eventType(@javax.annotation.Nonnull EventTypeEnum eventType) { - this.eventType = eventType; - return this; - } - - /** - * Type of callback event that was triggered. - * - * @return eventType - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EVENT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public EventTypeEnum getEventType() { - return eventType; + @JsonValue + public String getValue() { + return value; } - @JsonProperty(JSON_PROPERTY_EVENT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEventType(@javax.annotation.Nonnull EventTypeEnum eventType) { - this.eventType = eventType; - } - - public EventCallbackRequestEvent eventHash(@javax.annotation.Nonnull String eventHash) { - this.eventHash = eventHash; - return this; + @Override + public String toString() { + return String.valueOf(value); } - /** - * Generated hash used to verify source of event data. - * - * @return eventHash - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EVENT_HASH) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getEventHash() { - return eventHash; + @JsonCreator + public static EventTypeEnum fromValue(String value) { + for (EventTypeEnum b : EventTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - @JsonProperty(JSON_PROPERTY_EVENT_HASH) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEventHash(@javax.annotation.Nonnull String eventHash) { - this.eventHash = eventHash; + } + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + @javax.annotation.Nonnull + private EventTypeEnum eventType; + + public static final String JSON_PROPERTY_EVENT_HASH = "event_hash"; + @javax.annotation.Nonnull + private String eventHash; + + public static final String JSON_PROPERTY_EVENT_METADATA = "event_metadata"; + @javax.annotation.Nullable + private EventCallbackRequestEventMetadata eventMetadata; + + public EventCallbackRequestEvent() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public EventCallbackRequestEvent init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EventCallbackRequestEvent.class); + } + + static public EventCallbackRequestEvent init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + EventCallbackRequestEvent.class + ); + } + + public EventCallbackRequestEvent eventTime(@javax.annotation.Nonnull String eventTime) { + this.eventTime = eventTime; + return this; + } + + /** + * Time the event was created (using Unix time). + * @return eventTime + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEventTime() { + return eventTime; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventTime(@javax.annotation.Nonnull String eventTime) { + this.eventTime = eventTime; + } + + + public EventCallbackRequestEvent eventType(@javax.annotation.Nonnull EventTypeEnum eventType) { + this.eventType = eventType; + return this; + } + + /** + * Type of callback event that was triggered. + * @return eventType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public EventTypeEnum getEventType() { + return eventType; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventType(@javax.annotation.Nonnull EventTypeEnum eventType) { + this.eventType = eventType; + } + + + public EventCallbackRequestEvent eventHash(@javax.annotation.Nonnull String eventHash) { + this.eventHash = eventHash; + return this; + } + + /** + * Generated hash used to verify source of event data. + * @return eventHash + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEventHash() { + return eventHash; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventHash(@javax.annotation.Nonnull String eventHash) { + this.eventHash = eventHash; + } + + + public EventCallbackRequestEvent eventMetadata(@javax.annotation.Nullable EventCallbackRequestEventMetadata eventMetadata) { + this.eventMetadata = eventMetadata; + return this; + } + + /** + * Get eventMetadata + * @return eventMetadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventCallbackRequestEventMetadata getEventMetadata() { + return eventMetadata; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventMetadata(@javax.annotation.Nullable EventCallbackRequestEventMetadata eventMetadata) { + this.eventMetadata = eventMetadata; + } + + + /** + * Return true if this EventCallbackRequestEvent object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public EventCallbackRequestEvent eventMetadata( - @javax.annotation.Nullable EventCallbackRequestEventMetadata eventMetadata) { - this.eventMetadata = eventMetadata; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + EventCallbackRequestEvent eventCallbackRequestEvent = (EventCallbackRequestEvent) o; + return Objects.equals(this.eventTime, eventCallbackRequestEvent.eventTime) && + Objects.equals(this.eventType, eventCallbackRequestEvent.eventType) && + Objects.equals(this.eventHash, eventCallbackRequestEvent.eventHash) && + Objects.equals(this.eventMetadata, eventCallbackRequestEvent.eventMetadata); + } + + @Override + public int hashCode() { + return Objects.hash(eventTime, eventType, eventHash, eventMetadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventCallbackRequestEvent {\n"); + sb.append(" eventTime: ").append(toIndentedString(eventTime)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" eventHash: ").append(toIndentedString(eventHash)).append("\n"); + sb.append(" eventMetadata: ").append(toIndentedString(eventMetadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (eventTime != null) { + if (isFileTypeOrListOfFiles(eventTime)) { + fileTypeFound = true; + } - /** - * Get eventMetadata - * - * @return eventMetadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EVENT_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EventCallbackRequestEventMetadata getEventMetadata() { - return eventMetadata; + if (eventTime.getClass().equals(java.io.File.class) || + eventTime.getClass().equals(Integer.class) || + eventTime.getClass().equals(String.class) || + eventTime.getClass().isEnum()) { + map.put("event_time", eventTime); + } else if (isListOfFile(eventTime)) { + for(int i = 0; i< getListSize(eventTime); i++) { + map.put("event_time[" + i + "]", getFromList(eventTime, i)); + } + } + else { + map.put("event_time", JSON.getDefault().getMapper().writeValueAsString(eventTime)); + } } + if (eventType != null) { + if (isFileTypeOrListOfFiles(eventType)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EVENT_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEventMetadata( - @javax.annotation.Nullable EventCallbackRequestEventMetadata eventMetadata) { - this.eventMetadata = eventMetadata; + if (eventType.getClass().equals(java.io.File.class) || + eventType.getClass().equals(Integer.class) || + eventType.getClass().equals(String.class) || + eventType.getClass().isEnum()) { + map.put("event_type", eventType); + } else if (isListOfFile(eventType)) { + for(int i = 0; i< getListSize(eventType); i++) { + map.put("event_type[" + i + "]", getFromList(eventType, i)); + } + } + else { + map.put("event_type", JSON.getDefault().getMapper().writeValueAsString(eventType)); + } } + if (eventHash != null) { + if (isFileTypeOrListOfFiles(eventHash)) { + fileTypeFound = true; + } - /** Return true if this EventCallbackRequestEvent object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (eventHash.getClass().equals(java.io.File.class) || + eventHash.getClass().equals(Integer.class) || + eventHash.getClass().equals(String.class) || + eventHash.getClass().isEnum()) { + map.put("event_hash", eventHash); + } else if (isListOfFile(eventHash)) { + for(int i = 0; i< getListSize(eventHash); i++) { + map.put("event_hash[" + i + "]", getFromList(eventHash, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("event_hash", JSON.getDefault().getMapper().writeValueAsString(eventHash)); } - EventCallbackRequestEvent eventCallbackRequestEvent = (EventCallbackRequestEvent) o; - return Objects.equals(this.eventTime, eventCallbackRequestEvent.eventTime) - && Objects.equals(this.eventType, eventCallbackRequestEvent.eventType) - && Objects.equals(this.eventHash, eventCallbackRequestEvent.eventHash) - && Objects.equals(this.eventMetadata, eventCallbackRequestEvent.eventMetadata); } + if (eventMetadata != null) { + if (isFileTypeOrListOfFiles(eventMetadata)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(eventTime, eventType, eventHash, eventMetadata); + if (eventMetadata.getClass().equals(java.io.File.class) || + eventMetadata.getClass().equals(Integer.class) || + eventMetadata.getClass().equals(String.class) || + eventMetadata.getClass().isEnum()) { + map.put("event_metadata", eventMetadata); + } else if (isListOfFile(eventMetadata)) { + for(int i = 0; i< getListSize(eventMetadata); i++) { + map.put("event_metadata[" + i + "]", getFromList(eventMetadata, i)); + } + } + else { + map.put("event_metadata", JSON.getDefault().getMapper().writeValueAsString(eventMetadata)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EventCallbackRequestEvent {\n"); - sb.append(" eventTime: ").append(toIndentedString(eventTime)).append("\n"); - sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); - sb.append(" eventHash: ").append(toIndentedString(eventHash)).append("\n"); - sb.append(" eventMetadata: ").append(toIndentedString(eventMetadata)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (eventTime != null) { - if (isFileTypeOrListOfFiles(eventTime)) { - fileTypeFound = true; - } - - if (eventTime.getClass().equals(java.io.File.class) - || eventTime.getClass().equals(Integer.class) - || eventTime.getClass().equals(String.class) - || eventTime.getClass().isEnum()) { - map.put("event_time", eventTime); - } else if (isListOfFile(eventTime)) { - for (int i = 0; i < getListSize(eventTime); i++) { - map.put("event_time[" + i + "]", getFromList(eventTime, i)); - } - } else { - map.put( - "event_time", - JSON.getDefault().getMapper().writeValueAsString(eventTime)); - } - } - if (eventType != null) { - if (isFileTypeOrListOfFiles(eventType)) { - fileTypeFound = true; - } - - if (eventType.getClass().equals(java.io.File.class) - || eventType.getClass().equals(Integer.class) - || eventType.getClass().equals(String.class) - || eventType.getClass().isEnum()) { - map.put("event_type", eventType); - } else if (isListOfFile(eventType)) { - for (int i = 0; i < getListSize(eventType); i++) { - map.put("event_type[" + i + "]", getFromList(eventType, i)); - } - } else { - map.put( - "event_type", - JSON.getDefault().getMapper().writeValueAsString(eventType)); - } - } - if (eventHash != null) { - if (isFileTypeOrListOfFiles(eventHash)) { - fileTypeFound = true; - } - - if (eventHash.getClass().equals(java.io.File.class) - || eventHash.getClass().equals(Integer.class) - || eventHash.getClass().equals(String.class) - || eventHash.getClass().isEnum()) { - map.put("event_hash", eventHash); - } else if (isListOfFile(eventHash)) { - for (int i = 0; i < getListSize(eventHash); i++) { - map.put("event_hash[" + i + "]", getFromList(eventHash, i)); - } - } else { - map.put( - "event_hash", - JSON.getDefault().getMapper().writeValueAsString(eventHash)); - } - } - if (eventMetadata != null) { - if (isFileTypeOrListOfFiles(eventMetadata)) { - fileTypeFound = true; - } - - if (eventMetadata.getClass().equals(java.io.File.class) - || eventMetadata.getClass().equals(Integer.class) - || eventMetadata.getClass().equals(String.class) - || eventMetadata.getClass().isEnum()) { - map.put("event_metadata", eventMetadata); - } else if (isListOfFile(eventMetadata)) { - for (int i = 0; i < getListSize(eventMetadata); i++) { - map.put("event_metadata[" + i + "]", getFromList(eventMetadata, i)); - } - } else { - map.put( - "event_metadata", - JSON.getDefault().getMapper().writeValueAsString(eventMetadata)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java index 453c6a291..7962def2c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java @@ -10,327 +10,323 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** Specific metadata about the event. */ + +import com.dropbox.sign.ApiException; +/** + * Specific metadata about the event. + */ @JsonPropertyOrder({ - EventCallbackRequestEventMetadata.JSON_PROPERTY_RELATED_SIGNATURE_ID, - EventCallbackRequestEventMetadata.JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID, - EventCallbackRequestEventMetadata.JSON_PROPERTY_REPORTED_FOR_APP_ID, - EventCallbackRequestEventMetadata.JSON_PROPERTY_EVENT_MESSAGE + EventCallbackRequestEventMetadata.JSON_PROPERTY_RELATED_SIGNATURE_ID, + EventCallbackRequestEventMetadata.JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID, + EventCallbackRequestEventMetadata.JSON_PROPERTY_REPORTED_FOR_APP_ID, + EventCallbackRequestEventMetadata.JSON_PROPERTY_EVENT_MESSAGE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class EventCallbackRequestEventMetadata { - public static final String JSON_PROPERTY_RELATED_SIGNATURE_ID = "related_signature_id"; - @javax.annotation.Nullable private String relatedSignatureId; - - public static final String JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID = "reported_for_account_id"; - @javax.annotation.Nullable private String reportedForAccountId; - - public static final String JSON_PROPERTY_REPORTED_FOR_APP_ID = "reported_for_app_id"; - @javax.annotation.Nullable private String reportedForAppId; - - public static final String JSON_PROPERTY_EVENT_MESSAGE = "event_message"; - @javax.annotation.Nullable private String eventMessage; - - public EventCallbackRequestEventMetadata() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static EventCallbackRequestEventMetadata init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EventCallbackRequestEventMetadata.class); + public static final String JSON_PROPERTY_RELATED_SIGNATURE_ID = "related_signature_id"; + @javax.annotation.Nullable + private String relatedSignatureId; + + public static final String JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID = "reported_for_account_id"; + @javax.annotation.Nullable + private String reportedForAccountId; + + public static final String JSON_PROPERTY_REPORTED_FOR_APP_ID = "reported_for_app_id"; + @javax.annotation.Nullable + private String reportedForAppId; + + public static final String JSON_PROPERTY_EVENT_MESSAGE = "event_message"; + @javax.annotation.Nullable + private String eventMessage; + + public EventCallbackRequestEventMetadata() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public EventCallbackRequestEventMetadata init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EventCallbackRequestEventMetadata.class); + } + + static public EventCallbackRequestEventMetadata init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + EventCallbackRequestEventMetadata.class + ); + } + + public EventCallbackRequestEventMetadata relatedSignatureId(@javax.annotation.Nullable String relatedSignatureId) { + this.relatedSignatureId = relatedSignatureId; + return this; + } + + /** + * Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. + * @return relatedSignatureId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATED_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRelatedSignatureId() { + return relatedSignatureId; + } + + + @JsonProperty(JSON_PROPERTY_RELATED_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRelatedSignatureId(@javax.annotation.Nullable String relatedSignatureId) { + this.relatedSignatureId = relatedSignatureId; + } + + + public EventCallbackRequestEventMetadata reportedForAccountId(@javax.annotation.Nullable String reportedForAccountId) { + this.reportedForAccountId = reportedForAccountId; + return this; + } + + /** + * Account ID the event was reported for. + * @return reportedForAccountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReportedForAccountId() { + return reportedForAccountId; + } + + + @JsonProperty(JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReportedForAccountId(@javax.annotation.Nullable String reportedForAccountId) { + this.reportedForAccountId = reportedForAccountId; + } + + + public EventCallbackRequestEventMetadata reportedForAppId(@javax.annotation.Nullable String reportedForAppId) { + this.reportedForAppId = reportedForAppId; + return this; + } + + /** + * App ID the event was reported for. + * @return reportedForAppId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPORTED_FOR_APP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReportedForAppId() { + return reportedForAppId; + } + + + @JsonProperty(JSON_PROPERTY_REPORTED_FOR_APP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReportedForAppId(@javax.annotation.Nullable String reportedForAppId) { + this.reportedForAppId = reportedForAppId; + } + + + public EventCallbackRequestEventMetadata eventMessage(@javax.annotation.Nullable String eventMessage) { + this.eventMessage = eventMessage; + return this; + } + + /** + * Message about a declined or failed (due to error) signature flow. + * @return eventMessage + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEventMessage() { + return eventMessage; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventMessage(@javax.annotation.Nullable String eventMessage) { + this.eventMessage = eventMessage; + } + + + /** + * Return true if this EventCallbackRequestEventMetadata object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public static EventCallbackRequestEventMetadata init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - EventCallbackRequestEventMetadata.class); - } - - public EventCallbackRequestEventMetadata relatedSignatureId( - @javax.annotation.Nullable String relatedSignatureId) { - this.relatedSignatureId = relatedSignatureId; - return this; - } - - /** - * Signature ID for a specific signer. Applicable to `signature_request_signed` and - * `signature_request_viewed` events. - * - * @return relatedSignatureId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RELATED_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRelatedSignatureId() { - return relatedSignatureId; - } - - @JsonProperty(JSON_PROPERTY_RELATED_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRelatedSignatureId(@javax.annotation.Nullable String relatedSignatureId) { - this.relatedSignatureId = relatedSignatureId; - } - - public EventCallbackRequestEventMetadata reportedForAccountId( - @javax.annotation.Nullable String reportedForAccountId) { - this.reportedForAccountId = reportedForAccountId; - return this; - } - - /** - * Account ID the event was reported for. - * - * @return reportedForAccountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getReportedForAccountId() { - return reportedForAccountId; - } - - @JsonProperty(JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReportedForAccountId(@javax.annotation.Nullable String reportedForAccountId) { - this.reportedForAccountId = reportedForAccountId; - } - - public EventCallbackRequestEventMetadata reportedForAppId( - @javax.annotation.Nullable String reportedForAppId) { - this.reportedForAppId = reportedForAppId; - return this; - } - - /** - * App ID the event was reported for. - * - * @return reportedForAppId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REPORTED_FOR_APP_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getReportedForAppId() { - return reportedForAppId; - } - - @JsonProperty(JSON_PROPERTY_REPORTED_FOR_APP_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReportedForAppId(@javax.annotation.Nullable String reportedForAppId) { - this.reportedForAppId = reportedForAppId; - } - - public EventCallbackRequestEventMetadata eventMessage( - @javax.annotation.Nullable String eventMessage) { - this.eventMessage = eventMessage; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + EventCallbackRequestEventMetadata eventCallbackRequestEventMetadata = (EventCallbackRequestEventMetadata) o; + return Objects.equals(this.relatedSignatureId, eventCallbackRequestEventMetadata.relatedSignatureId) && + Objects.equals(this.reportedForAccountId, eventCallbackRequestEventMetadata.reportedForAccountId) && + Objects.equals(this.reportedForAppId, eventCallbackRequestEventMetadata.reportedForAppId) && + Objects.equals(this.eventMessage, eventCallbackRequestEventMetadata.eventMessage); + } + + @Override + public int hashCode() { + return Objects.hash(relatedSignatureId, reportedForAccountId, reportedForAppId, eventMessage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventCallbackRequestEventMetadata {\n"); + sb.append(" relatedSignatureId: ").append(toIndentedString(relatedSignatureId)).append("\n"); + sb.append(" reportedForAccountId: ").append(toIndentedString(reportedForAccountId)).append("\n"); + sb.append(" reportedForAppId: ").append(toIndentedString(reportedForAppId)).append("\n"); + sb.append(" eventMessage: ").append(toIndentedString(eventMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (relatedSignatureId != null) { + if (isFileTypeOrListOfFiles(relatedSignatureId)) { + fileTypeFound = true; + } - /** - * Message about a declined or failed (due to error) signature flow. - * - * @return eventMessage - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EVENT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEventMessage() { - return eventMessage; + if (relatedSignatureId.getClass().equals(java.io.File.class) || + relatedSignatureId.getClass().equals(Integer.class) || + relatedSignatureId.getClass().equals(String.class) || + relatedSignatureId.getClass().isEnum()) { + map.put("related_signature_id", relatedSignatureId); + } else if (isListOfFile(relatedSignatureId)) { + for(int i = 0; i< getListSize(relatedSignatureId); i++) { + map.put("related_signature_id[" + i + "]", getFromList(relatedSignatureId, i)); + } + } + else { + map.put("related_signature_id", JSON.getDefault().getMapper().writeValueAsString(relatedSignatureId)); + } } + if (reportedForAccountId != null) { + if (isFileTypeOrListOfFiles(reportedForAccountId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EVENT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEventMessage(@javax.annotation.Nullable String eventMessage) { - this.eventMessage = eventMessage; + if (reportedForAccountId.getClass().equals(java.io.File.class) || + reportedForAccountId.getClass().equals(Integer.class) || + reportedForAccountId.getClass().equals(String.class) || + reportedForAccountId.getClass().isEnum()) { + map.put("reported_for_account_id", reportedForAccountId); + } else if (isListOfFile(reportedForAccountId)) { + for(int i = 0; i< getListSize(reportedForAccountId); i++) { + map.put("reported_for_account_id[" + i + "]", getFromList(reportedForAccountId, i)); + } + } + else { + map.put("reported_for_account_id", JSON.getDefault().getMapper().writeValueAsString(reportedForAccountId)); + } } + if (reportedForAppId != null) { + if (isFileTypeOrListOfFiles(reportedForAppId)) { + fileTypeFound = true; + } - /** Return true if this EventCallbackRequestEventMetadata object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (reportedForAppId.getClass().equals(java.io.File.class) || + reportedForAppId.getClass().equals(Integer.class) || + reportedForAppId.getClass().equals(String.class) || + reportedForAppId.getClass().isEnum()) { + map.put("reported_for_app_id", reportedForAppId); + } else if (isListOfFile(reportedForAppId)) { + for(int i = 0; i< getListSize(reportedForAppId); i++) { + map.put("reported_for_app_id[" + i + "]", getFromList(reportedForAppId, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("reported_for_app_id", JSON.getDefault().getMapper().writeValueAsString(reportedForAppId)); } - EventCallbackRequestEventMetadata eventCallbackRequestEventMetadata = - (EventCallbackRequestEventMetadata) o; - return Objects.equals( - this.relatedSignatureId, - eventCallbackRequestEventMetadata.relatedSignatureId) - && Objects.equals( - this.reportedForAccountId, - eventCallbackRequestEventMetadata.reportedForAccountId) - && Objects.equals( - this.reportedForAppId, eventCallbackRequestEventMetadata.reportedForAppId) - && Objects.equals( - this.eventMessage, eventCallbackRequestEventMetadata.eventMessage); } + if (eventMessage != null) { + if (isFileTypeOrListOfFiles(eventMessage)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - relatedSignatureId, reportedForAccountId, reportedForAppId, eventMessage); + if (eventMessage.getClass().equals(java.io.File.class) || + eventMessage.getClass().equals(Integer.class) || + eventMessage.getClass().equals(String.class) || + eventMessage.getClass().isEnum()) { + map.put("event_message", eventMessage); + } else if (isListOfFile(eventMessage)) { + for(int i = 0; i< getListSize(eventMessage); i++) { + map.put("event_message[" + i + "]", getFromList(eventMessage, i)); + } + } + else { + map.put("event_message", JSON.getDefault().getMapper().writeValueAsString(eventMessage)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EventCallbackRequestEventMetadata {\n"); - sb.append(" relatedSignatureId: ") - .append(toIndentedString(relatedSignatureId)) - .append("\n"); - sb.append(" reportedForAccountId: ") - .append(toIndentedString(reportedForAccountId)) - .append("\n"); - sb.append(" reportedForAppId: ").append(toIndentedString(reportedForAppId)).append("\n"); - sb.append(" eventMessage: ").append(toIndentedString(eventMessage)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (relatedSignatureId != null) { - if (isFileTypeOrListOfFiles(relatedSignatureId)) { - fileTypeFound = true; - } - - if (relatedSignatureId.getClass().equals(java.io.File.class) - || relatedSignatureId.getClass().equals(Integer.class) - || relatedSignatureId.getClass().equals(String.class) - || relatedSignatureId.getClass().isEnum()) { - map.put("related_signature_id", relatedSignatureId); - } else if (isListOfFile(relatedSignatureId)) { - for (int i = 0; i < getListSize(relatedSignatureId); i++) { - map.put( - "related_signature_id[" + i + "]", - getFromList(relatedSignatureId, i)); - } - } else { - map.put( - "related_signature_id", - JSON.getDefault().getMapper().writeValueAsString(relatedSignatureId)); - } - } - if (reportedForAccountId != null) { - if (isFileTypeOrListOfFiles(reportedForAccountId)) { - fileTypeFound = true; - } - - if (reportedForAccountId.getClass().equals(java.io.File.class) - || reportedForAccountId.getClass().equals(Integer.class) - || reportedForAccountId.getClass().equals(String.class) - || reportedForAccountId.getClass().isEnum()) { - map.put("reported_for_account_id", reportedForAccountId); - } else if (isListOfFile(reportedForAccountId)) { - for (int i = 0; i < getListSize(reportedForAccountId); i++) { - map.put( - "reported_for_account_id[" + i + "]", - getFromList(reportedForAccountId, i)); - } - } else { - map.put( - "reported_for_account_id", - JSON.getDefault().getMapper().writeValueAsString(reportedForAccountId)); - } - } - if (reportedForAppId != null) { - if (isFileTypeOrListOfFiles(reportedForAppId)) { - fileTypeFound = true; - } - - if (reportedForAppId.getClass().equals(java.io.File.class) - || reportedForAppId.getClass().equals(Integer.class) - || reportedForAppId.getClass().equals(String.class) - || reportedForAppId.getClass().isEnum()) { - map.put("reported_for_app_id", reportedForAppId); - } else if (isListOfFile(reportedForAppId)) { - for (int i = 0; i < getListSize(reportedForAppId); i++) { - map.put("reported_for_app_id[" + i + "]", getFromList(reportedForAppId, i)); - } - } else { - map.put( - "reported_for_app_id", - JSON.getDefault().getMapper().writeValueAsString(reportedForAppId)); - } - } - if (eventMessage != null) { - if (isFileTypeOrListOfFiles(eventMessage)) { - fileTypeFound = true; - } - - if (eventMessage.getClass().equals(java.io.File.class) - || eventMessage.getClass().equals(Integer.class) - || eventMessage.getClass().equals(String.class) - || eventMessage.getClass().isEnum()) { - map.put("event_message", eventMessage); - } else if (isListOfFile(eventMessage)) { - for (int i = 0; i < getListSize(eventMessage); i++) { - map.put("event_message[" + i + "]", getFromList(eventMessage, i)); - } - } else { - map.put( - "event_message", - JSON.getDefault().getMapper().writeValueAsString(eventMessage)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxGetResponse.java index 8d018468f..689434c25 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxGetResponse.java @@ -10,212 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.FaxResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** FaxGetResponse */ -@JsonPropertyOrder({FaxGetResponse.JSON_PROPERTY_FAX, FaxGetResponse.JSON_PROPERTY_WARNINGS}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class FaxGetResponse { - public static final String JSON_PROPERTY_FAX = "fax"; - @javax.annotation.Nonnull private FaxResponse fax; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public FaxGetResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxGetResponse.class); - } - - public static FaxGetResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), FaxGetResponse.class); - } - - public FaxGetResponse fax(@javax.annotation.Nonnull FaxResponse fax) { - this.fax = fax; - return this; - } - - /** - * Get fax - * - * @return fax - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FAX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public FaxResponse getFax() { - return fax; - } - - @JsonProperty(JSON_PROPERTY_FAX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFax(@javax.annotation.Nonnull FaxResponse fax) { - this.fax = fax; - } +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; - public FaxGetResponse warnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - public FaxGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); +import com.dropbox.sign.ApiException; +/** + * FaxGetResponse + */ +@JsonPropertyOrder({ + FaxGetResponse.JSON_PROPERTY_FAX, + FaxGetResponse.JSON_PROPERTY_WARNINGS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxGetResponse { + public static final String JSON_PROPERTY_FAX = "fax"; + @javax.annotation.Nonnull + private FaxResponse fax; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public FaxGetResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxGetResponse.class); + } + + static public FaxGetResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxGetResponse.class + ); + } + + public FaxGetResponse fax(@javax.annotation.Nonnull FaxResponse fax) { + this.fax = fax; + return this; + } + + /** + * Get fax + * @return fax + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public FaxResponse getFax() { + return fax; + } + + + @JsonProperty(JSON_PROPERTY_FAX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFax(@javax.annotation.Nonnull FaxResponse fax) { + this.fax = fax; + } + + + public FaxGetResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public FaxGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this FaxGetResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxGetResponse faxGetResponse = (FaxGetResponse) o; + return Objects.equals(this.fax, faxGetResponse.fax) && + Objects.equals(this.warnings, faxGetResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(fax, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxGetResponse {\n"); + sb.append(" fax: ").append(toIndentedString(fax)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (fax != null) { + if (isFileTypeOrListOfFiles(fax)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this FaxGetResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (fax.getClass().equals(java.io.File.class) || + fax.getClass().equals(Integer.class) || + fax.getClass().equals(String.class) || + fax.getClass().isEnum()) { + map.put("fax", fax); + } else if (isListOfFile(fax)) { + for(int i = 0; i< getListSize(fax); i++) { + map.put("fax[" + i + "]", getFromList(fax, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("fax", JSON.getDefault().getMapper().writeValueAsString(fax)); } - FaxGetResponse faxGetResponse = (FaxGetResponse) o; - return Objects.equals(this.fax, faxGetResponse.fax) - && Objects.equals(this.warnings, faxGetResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(fax, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxGetResponse {\n"); - sb.append(" fax: ").append(toIndentedString(fax)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (fax != null) { - if (isFileTypeOrListOfFiles(fax)) { - fileTypeFound = true; - } - - if (fax.getClass().equals(java.io.File.class) - || fax.getClass().equals(Integer.class) - || fax.getClass().equals(String.class) - || fax.getClass().isEnum()) { - map.put("fax", fax); - } else if (isListOfFile(fax)) { - for (int i = 0; i < getListSize(fax); i++) { - map.put("fax[" + i + "]", getFromList(fax, i)); - } - } else { - map.put("fax", JSON.getDefault().getMapper().writeValueAsString(fax)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java index c8163b3a1..46e5b7d05 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java @@ -10,256 +10,272 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** FaxLineAddUserRequest */ + +import com.dropbox.sign.ApiException; +/** + * FaxLineAddUserRequest + */ @JsonPropertyOrder({ - FaxLineAddUserRequest.JSON_PROPERTY_NUMBER, - FaxLineAddUserRequest.JSON_PROPERTY_ACCOUNT_ID, - FaxLineAddUserRequest.JSON_PROPERTY_EMAIL_ADDRESS + FaxLineAddUserRequest.JSON_PROPERTY_NUMBER, + FaxLineAddUserRequest.JSON_PROPERTY_ACCOUNT_ID, + FaxLineAddUserRequest.JSON_PROPERTY_EMAIL_ADDRESS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class FaxLineAddUserRequest { - public static final String JSON_PROPERTY_NUMBER = "number"; - @javax.annotation.Nonnull private String number; + public static final String JSON_PROPERTY_NUMBER = "number"; + @javax.annotation.Nonnull + private String number; - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - @javax.annotation.Nullable private String accountId; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + @javax.annotation.Nullable + private String accountId; - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; - public FaxLineAddUserRequest() {} + public FaxLineAddUserRequest() { + } - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxLineAddUserRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxLineAddUserRequest.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineAddUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineAddUserRequest.class); + } - public static FaxLineAddUserRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), FaxLineAddUserRequest.class); - } + static public FaxLineAddUserRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineAddUserRequest.class + ); + } - public FaxLineAddUserRequest number(@javax.annotation.Nonnull String number) { - this.number = number; - return this; - } + public FaxLineAddUserRequest number(@javax.annotation.Nonnull String number) { + this.number = number; + return this; + } - /** - * The Fax Line number - * - * @return number - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getNumber() { - return number; - } + /** + * The Fax Line number + * @return number + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setNumber(@javax.annotation.Nonnull String number) { - this.number = number; - } + public String getNumber() { + return number; + } - public FaxLineAddUserRequest accountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; - } - /** - * Account ID - * - * @return accountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccountId() { - return accountId; - } + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(@javax.annotation.Nonnull String number) { + this.number = number; + } - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - } - public FaxLineAddUserRequest emailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } + public FaxLineAddUserRequest accountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + return this; + } - /** - * Email address - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; - } + /** + * Account ID + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + } + + + public FaxLineAddUserRequest emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Email address + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this FaxLineAddUserRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineAddUserRequest faxLineAddUserRequest = (FaxLineAddUserRequest) o; + return Objects.equals(this.number, faxLineAddUserRequest.number) && + Objects.equals(this.accountId, faxLineAddUserRequest.accountId) && + Objects.equals(this.emailAddress, faxLineAddUserRequest.emailAddress); + } - /** Return true if this FaxLineAddUserRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; + @Override + public int hashCode() { + return Objects.hash(number, accountId, emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineAddUserRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; } - FaxLineAddUserRequest faxLineAddUserRequest = (FaxLineAddUserRequest) o; - return Objects.equals(this.number, faxLineAddUserRequest.number) - && Objects.equals(this.accountId, faxLineAddUserRequest.accountId) - && Objects.equals(this.emailAddress, faxLineAddUserRequest.emailAddress); - } - @Override - public int hashCode() { - return Objects.hash(number, accountId, emailAddress); + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } } + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxLineAddUserRequest {\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append("}"); - return sb.toString(); + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (number != null) { - if (isFileTypeOrListOfFiles(number)) { - fileTypeFound = true; - } - - if (number.getClass().equals(java.io.File.class) - || number.getClass().equals(Integer.class) - || number.getClass().equals(String.class) - || number.getClass().isEnum()) { - map.put("number", number); - } else if (isListOfFile(number)) { - for (int i = 0; i < getListSize(number); i++) { - map.put("number[" + i + "]", getFromList(number, i)); - } - } else { - map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); - } - } - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } - - if (accountId.getClass().equals(java.io.File.class) - || accountId.getClass().equals(Integer.class) - || accountId.getClass().equals(String.class) - || accountId.getClass().isEnum()) { - map.put("account_id", accountId); - } else if (isListOfFile(accountId)) { - for (int i = 0; i < getListSize(accountId); i++) { - map.put("account_id[" + i + "]", getFromList(accountId, i)); - } - } else { - map.put( - "account_id", - JSON.getDefault().getMapper().writeValueAsString(accountId)); - } + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java index 2749d7769..d6ef80861 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java @@ -10,42 +10,56 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets FaxLineAreaCodeGetCountryEnum */ +/** + * Gets or Sets FaxLineAreaCodeGetCountryEnum + */ public enum FaxLineAreaCodeGetCountryEnum { - CA("CA"), - - US("US"), + + CA("CA"), + + US("US"), + + UK("UK"); - UK("UK"); + private String value; - private String value; + FaxLineAreaCodeGetCountryEnum(String value) { + this.value = value; + } - FaxLineAreaCodeGetCountryEnum(String value) { - this.value = value; - } + @JsonValue + public String getValue() { + return value; + } - @JsonValue - public String getValue() { - return value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static FaxLineAreaCodeGetCountryEnum fromValue(String value) { - for (FaxLineAreaCodeGetCountryEnum b : FaxLineAreaCodeGetCountryEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + @JsonCreator + public static FaxLineAreaCodeGetCountryEnum fromValue(String value) { + for (FaxLineAreaCodeGetCountryEnum b : FaxLineAreaCodeGetCountryEnum.values()) { + if (b.value.equals(value)) { + return b; + } } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java index 6016ba996..3c0b91340 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java @@ -10,62 +10,76 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets FaxLineAreaCodeGetProvinceEnum */ +/** + * Gets or Sets FaxLineAreaCodeGetProvinceEnum + */ public enum FaxLineAreaCodeGetProvinceEnum { - AB("AB"), - - BC("BC"), - - MB("MB"), - - NB("NB"), - - NL("NL"), - - NT("NT"), - - NS("NS"), - - NU("NU"), - - ON("ON"), - - PE("PE"), - - QC("QC"), - - SK("SK"), - - YT("YT"); - - private String value; - - FaxLineAreaCodeGetProvinceEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static FaxLineAreaCodeGetProvinceEnum fromValue(String value) { - for (FaxLineAreaCodeGetProvinceEnum b : FaxLineAreaCodeGetProvinceEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + + AB("AB"), + + BC("BC"), + + MB("MB"), + + NB("NB"), + + NL("NL"), + + NT("NT"), + + NS("NS"), + + NU("NU"), + + ON("ON"), + + PE("PE"), + + QC("QC"), + + SK("SK"), + + YT("YT"); + + private String value; + + FaxLineAreaCodeGetProvinceEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FaxLineAreaCodeGetProvinceEnum fromValue(String value) { + for (FaxLineAreaCodeGetProvinceEnum b : FaxLineAreaCodeGetProvinceEnum.values()) { + if (b.value.equals(value)) { + return b; + } } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java index bdf27b0cc..df6d06667 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java @@ -10,171 +10,180 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** FaxLineAreaCodeGetResponse */ -@JsonPropertyOrder({FaxLineAreaCodeGetResponse.JSON_PROPERTY_AREA_CODES}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class FaxLineAreaCodeGetResponse { - public static final String JSON_PROPERTY_AREA_CODES = "area_codes"; - @javax.annotation.Nonnull private List areaCodes = new ArrayList<>(); - - public FaxLineAreaCodeGetResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxLineAreaCodeGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxLineAreaCodeGetResponse.class); - } - - public static FaxLineAreaCodeGetResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - FaxLineAreaCodeGetResponse.class); - } +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; - public FaxLineAreaCodeGetResponse areaCodes(@javax.annotation.Nonnull List areaCodes) { - this.areaCodes = areaCodes; - return this; - } - public FaxLineAreaCodeGetResponse addAreaCodesItem(Integer areaCodesItem) { - if (this.areaCodes == null) { - this.areaCodes = new ArrayList<>(); +import com.dropbox.sign.ApiException; +/** + * FaxLineAreaCodeGetResponse + */ +@JsonPropertyOrder({ + FaxLineAreaCodeGetResponse.JSON_PROPERTY_AREA_CODES +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineAreaCodeGetResponse { + public static final String JSON_PROPERTY_AREA_CODES = "area_codes"; + @javax.annotation.Nonnull + private List areaCodes = new ArrayList<>(); + + public FaxLineAreaCodeGetResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineAreaCodeGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineAreaCodeGetResponse.class); + } + + static public FaxLineAreaCodeGetResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineAreaCodeGetResponse.class + ); + } + + public FaxLineAreaCodeGetResponse areaCodes(@javax.annotation.Nonnull List areaCodes) { + this.areaCodes = areaCodes; + return this; + } + + public FaxLineAreaCodeGetResponse addAreaCodesItem(Integer areaCodesItem) { + if (this.areaCodes == null) { + this.areaCodes = new ArrayList<>(); + } + this.areaCodes.add(areaCodesItem); + return this; + } + + /** + * Get areaCodes + * @return areaCodes + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AREA_CODES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getAreaCodes() { + return areaCodes; + } + + + @JsonProperty(JSON_PROPERTY_AREA_CODES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAreaCodes(@javax.annotation.Nonnull List areaCodes) { + this.areaCodes = areaCodes; + } + + + /** + * Return true if this FaxLineAreaCodeGetResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineAreaCodeGetResponse faxLineAreaCodeGetResponse = (FaxLineAreaCodeGetResponse) o; + return Objects.equals(this.areaCodes, faxLineAreaCodeGetResponse.areaCodes); + } + + @Override + public int hashCode() { + return Objects.hash(areaCodes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineAreaCodeGetResponse {\n"); + sb.append(" areaCodes: ").append(toIndentedString(areaCodes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (areaCodes != null) { + if (isFileTypeOrListOfFiles(areaCodes)) { + fileTypeFound = true; } - this.areaCodes.add(areaCodesItem); - return this; - } - - /** - * Get areaCodes - * - * @return areaCodes - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_AREA_CODES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getAreaCodes() { - return areaCodes; - } - @JsonProperty(JSON_PROPERTY_AREA_CODES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setAreaCodes(@javax.annotation.Nonnull List areaCodes) { - this.areaCodes = areaCodes; - } - - /** Return true if this FaxLineAreaCodeGetResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (areaCodes.getClass().equals(java.io.File.class) || + areaCodes.getClass().equals(Integer.class) || + areaCodes.getClass().equals(String.class) || + areaCodes.getClass().isEnum()) { + map.put("area_codes", areaCodes); + } else if (isListOfFile(areaCodes)) { + for(int i = 0; i< getListSize(areaCodes); i++) { + map.put("area_codes[" + i + "]", getFromList(areaCodes, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("area_codes", JSON.getDefault().getMapper().writeValueAsString(areaCodes)); } - FaxLineAreaCodeGetResponse faxLineAreaCodeGetResponse = (FaxLineAreaCodeGetResponse) o; - return Objects.equals(this.areaCodes, faxLineAreaCodeGetResponse.areaCodes); - } - - @Override - public int hashCode() { - return Objects.hash(areaCodes); } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxLineAreaCodeGetResponse {\n"); - sb.append(" areaCodes: ").append(toIndentedString(areaCodes)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (areaCodes != null) { - if (isFileTypeOrListOfFiles(areaCodes)) { - fileTypeFound = true; - } - - if (areaCodes.getClass().equals(java.io.File.class) - || areaCodes.getClass().equals(Integer.class) - || areaCodes.getClass().equals(String.class) - || areaCodes.getClass().isEnum()) { - map.put("area_codes", areaCodes); - } else if (isListOfFile(areaCodes)) { - for (int i = 0; i < getListSize(areaCodes); i++) { - map.put("area_codes[" + i + "]", getFromList(areaCodes, i)); - } - } else { - map.put( - "area_codes", - JSON.getDefault().getMapper().writeValueAsString(areaCodes)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java index 2e9da9f6b..c0e5ae4d7 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java @@ -10,138 +10,152 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets FaxLineAreaCodeGetStateEnum */ +/** + * Gets or Sets FaxLineAreaCodeGetStateEnum + */ public enum FaxLineAreaCodeGetStateEnum { - AK("AK"), - - AL("AL"), - - AR("AR"), - - AZ("AZ"), - - CA("CA"), - - CO("CO"), - - CT("CT"), - - DC("DC"), - - DE("DE"), - - FL("FL"), - - GA("GA"), - - HI("HI"), - - IA("IA"), - - ID("ID"), - - IL("IL"), - - IN("IN"), - - KS("KS"), - - KY("KY"), - - LA("LA"), - - MA("MA"), - - MD("MD"), - - ME("ME"), - - MI("MI"), - - MN("MN"), - - MO("MO"), - - MS("MS"), - - MT("MT"), - - NC("NC"), - - ND("ND"), - - NE("NE"), - - NH("NH"), - - NJ("NJ"), - - NM("NM"), - - NV("NV"), - - NY("NY"), - - OH("OH"), - - OK("OK"), - - OR("OR"), - - PA("PA"), - - RI("RI"), - - SC("SC"), - - SD("SD"), - - TN("TN"), - - TX("TX"), - - UT("UT"), - - VA("VA"), - - VT("VT"), - - WA("WA"), - - WI("WI"), - - WV("WV"), - - WY("WY"); - - private String value; - - FaxLineAreaCodeGetStateEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static FaxLineAreaCodeGetStateEnum fromValue(String value) { - for (FaxLineAreaCodeGetStateEnum b : FaxLineAreaCodeGetStateEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + + AK("AK"), + + AL("AL"), + + AR("AR"), + + AZ("AZ"), + + CA("CA"), + + CO("CO"), + + CT("CT"), + + DC("DC"), + + DE("DE"), + + FL("FL"), + + GA("GA"), + + HI("HI"), + + IA("IA"), + + ID("ID"), + + IL("IL"), + + IN("IN"), + + KS("KS"), + + KY("KY"), + + LA("LA"), + + MA("MA"), + + MD("MD"), + + ME("ME"), + + MI("MI"), + + MN("MN"), + + MO("MO"), + + MS("MS"), + + MT("MT"), + + NC("NC"), + + ND("ND"), + + NE("NE"), + + NH("NH"), + + NJ("NJ"), + + NM("NM"), + + NV("NV"), + + NY("NY"), + + OH("OH"), + + OK("OK"), + + OR("OR"), + + PA("PA"), + + RI("RI"), + + SC("SC"), + + SD("SD"), + + TN("TN"), + + TX("TX"), + + UT("UT"), + + VA("VA"), + + VT("VT"), + + WA("WA"), + + WI("WI"), + + WV("WV"), + + WY("WY"); + + private String value; + + FaxLineAreaCodeGetStateEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FaxLineAreaCodeGetStateEnum fromValue(String value) { + for (FaxLineAreaCodeGetStateEnum b : FaxLineAreaCodeGetStateEnum.values()) { + if (b.value.equals(value)) { + return b; + } } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java index 66c469623..370234405 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java @@ -10,339 +10,360 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** FaxLineCreateRequest */ + +import com.dropbox.sign.ApiException; +/** + * FaxLineCreateRequest + */ @JsonPropertyOrder({ - FaxLineCreateRequest.JSON_PROPERTY_AREA_CODE, - FaxLineCreateRequest.JSON_PROPERTY_COUNTRY, - FaxLineCreateRequest.JSON_PROPERTY_CITY, - FaxLineCreateRequest.JSON_PROPERTY_ACCOUNT_ID + FaxLineCreateRequest.JSON_PROPERTY_AREA_CODE, + FaxLineCreateRequest.JSON_PROPERTY_COUNTRY, + FaxLineCreateRequest.JSON_PROPERTY_CITY, + FaxLineCreateRequest.JSON_PROPERTY_ACCOUNT_ID }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class FaxLineCreateRequest { - public static final String JSON_PROPERTY_AREA_CODE = "area_code"; - @javax.annotation.Nonnull private Integer areaCode; - - /** Country of the area code */ - public enum CountryEnum { - CA(String.valueOf("CA")), - - US(String.valueOf("US")), - - UK(String.valueOf("UK")); - - private String value; - - CountryEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static CountryEnum fromValue(String value) { - for (CountryEnum b : CountryEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_COUNTRY = "country"; - @javax.annotation.Nonnull private CountryEnum country; - - public static final String JSON_PROPERTY_CITY = "city"; - @javax.annotation.Nullable private String city; - - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - @javax.annotation.Nullable private String accountId; - - public FaxLineCreateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxLineCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxLineCreateRequest.class); - } - - public static FaxLineCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), FaxLineCreateRequest.class); - } - - public FaxLineCreateRequest areaCode(@javax.annotation.Nonnull Integer areaCode) { - this.areaCode = areaCode; - return this; - } - - /** - * Area code of the new Fax Line - * - * @return areaCode - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_AREA_CODE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getAreaCode() { - return areaCode; + public static final String JSON_PROPERTY_AREA_CODE = "area_code"; + @javax.annotation.Nonnull + private Integer areaCode; + + /** + * Country of the area code + */ + public enum CountryEnum { + CA(String.valueOf("CA")), + + US(String.valueOf("US")), + + UK(String.valueOf("UK")); + + private String value; + + CountryEnum(String value) { + this.value = value; } - @JsonProperty(JSON_PROPERTY_AREA_CODE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setAreaCode(@javax.annotation.Nonnull Integer areaCode) { - this.areaCode = areaCode; + @JsonValue + public String getValue() { + return value; } - public FaxLineCreateRequest country(@javax.annotation.Nonnull CountryEnum country) { - this.country = country; - return this; - } - - /** - * Country of the area code - * - * @return country - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_COUNTRY) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public CountryEnum getCountry() { - return country; - } - - @JsonProperty(JSON_PROPERTY_COUNTRY) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setCountry(@javax.annotation.Nonnull CountryEnum country) { - this.country = country; - } - - public FaxLineCreateRequest city(@javax.annotation.Nullable String city) { - this.city = city; - return this; + @Override + public String toString() { + return String.valueOf(value); } - /** - * City of the area code - * - * @return city - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCity() { - return city; + @JsonCreator + public static CountryEnum fromValue(String value) { + for (CountryEnum b : CountryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - @JsonProperty(JSON_PROPERTY_CITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCity(@javax.annotation.Nullable String city) { - this.city = city; + } + + public static final String JSON_PROPERTY_COUNTRY = "country"; + @javax.annotation.Nonnull + private CountryEnum country; + + public static final String JSON_PROPERTY_CITY = "city"; + @javax.annotation.Nullable + private String city; + + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + @javax.annotation.Nullable + private String accountId; + + public FaxLineCreateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineCreateRequest.class); + } + + static public FaxLineCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineCreateRequest.class + ); + } + + public FaxLineCreateRequest areaCode(@javax.annotation.Nonnull Integer areaCode) { + this.areaCode = areaCode; + return this; + } + + /** + * Area code of the new Fax Line + * @return areaCode + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AREA_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getAreaCode() { + return areaCode; + } + + + @JsonProperty(JSON_PROPERTY_AREA_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAreaCode(@javax.annotation.Nonnull Integer areaCode) { + this.areaCode = areaCode; + } + + + public FaxLineCreateRequest country(@javax.annotation.Nonnull CountryEnum country) { + this.country = country; + return this; + } + + /** + * Country of the area code + * @return country + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CountryEnum getCountry() { + return country; + } + + + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCountry(@javax.annotation.Nonnull CountryEnum country) { + this.country = country; + } + + + public FaxLineCreateRequest city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * City of the area code + * @return city + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCity() { + return city; + } + + + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public FaxLineCreateRequest accountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Account ID of the account that will be assigned this new Fax Line + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + } + + + /** + * Return true if this FaxLineCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public FaxLineCreateRequest accountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + FaxLineCreateRequest faxLineCreateRequest = (FaxLineCreateRequest) o; + return Objects.equals(this.areaCode, faxLineCreateRequest.areaCode) && + Objects.equals(this.country, faxLineCreateRequest.country) && + Objects.equals(this.city, faxLineCreateRequest.city) && + Objects.equals(this.accountId, faxLineCreateRequest.accountId); + } + + @Override + public int hashCode() { + return Objects.hash(areaCode, country, city, accountId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineCreateRequest {\n"); + sb.append(" areaCode: ").append(toIndentedString(areaCode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (areaCode != null) { + if (isFileTypeOrListOfFiles(areaCode)) { + fileTypeFound = true; + } - /** - * Account ID of the account that will be assigned this new Fax Line - * - * @return accountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccountId() { - return accountId; + if (areaCode.getClass().equals(java.io.File.class) || + areaCode.getClass().equals(Integer.class) || + areaCode.getClass().equals(String.class) || + areaCode.getClass().isEnum()) { + map.put("area_code", areaCode); + } else if (isListOfFile(areaCode)) { + for(int i = 0; i< getListSize(areaCode); i++) { + map.put("area_code[" + i + "]", getFromList(areaCode, i)); + } + } + else { + map.put("area_code", JSON.getDefault().getMapper().writeValueAsString(areaCode)); + } } + if (country != null) { + if (isFileTypeOrListOfFiles(country)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; + if (country.getClass().equals(java.io.File.class) || + country.getClass().equals(Integer.class) || + country.getClass().equals(String.class) || + country.getClass().isEnum()) { + map.put("country", country); + } else if (isListOfFile(country)) { + for(int i = 0; i< getListSize(country); i++) { + map.put("country[" + i + "]", getFromList(country, i)); + } + } + else { + map.put("country", JSON.getDefault().getMapper().writeValueAsString(country)); + } } + if (city != null) { + if (isFileTypeOrListOfFiles(city)) { + fileTypeFound = true; + } - /** Return true if this FaxLineCreateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (city.getClass().equals(java.io.File.class) || + city.getClass().equals(Integer.class) || + city.getClass().equals(String.class) || + city.getClass().isEnum()) { + map.put("city", city); + } else if (isListOfFile(city)) { + for(int i = 0; i< getListSize(city); i++) { + map.put("city[" + i + "]", getFromList(city, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("city", JSON.getDefault().getMapper().writeValueAsString(city)); } - FaxLineCreateRequest faxLineCreateRequest = (FaxLineCreateRequest) o; - return Objects.equals(this.areaCode, faxLineCreateRequest.areaCode) - && Objects.equals(this.country, faxLineCreateRequest.country) - && Objects.equals(this.city, faxLineCreateRequest.city) - && Objects.equals(this.accountId, faxLineCreateRequest.accountId); } + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(areaCode, country, city, accountId); + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxLineCreateRequest {\n"); - sb.append(" areaCode: ").append(toIndentedString(areaCode)).append("\n"); - sb.append(" country: ").append(toIndentedString(country)).append("\n"); - sb.append(" city: ").append(toIndentedString(city)).append("\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (areaCode != null) { - if (isFileTypeOrListOfFiles(areaCode)) { - fileTypeFound = true; - } - - if (areaCode.getClass().equals(java.io.File.class) - || areaCode.getClass().equals(Integer.class) - || areaCode.getClass().equals(String.class) - || areaCode.getClass().isEnum()) { - map.put("area_code", areaCode); - } else if (isListOfFile(areaCode)) { - for (int i = 0; i < getListSize(areaCode); i++) { - map.put("area_code[" + i + "]", getFromList(areaCode, i)); - } - } else { - map.put( - "area_code", - JSON.getDefault().getMapper().writeValueAsString(areaCode)); - } - } - if (country != null) { - if (isFileTypeOrListOfFiles(country)) { - fileTypeFound = true; - } - - if (country.getClass().equals(java.io.File.class) - || country.getClass().equals(Integer.class) - || country.getClass().equals(String.class) - || country.getClass().isEnum()) { - map.put("country", country); - } else if (isListOfFile(country)) { - for (int i = 0; i < getListSize(country); i++) { - map.put("country[" + i + "]", getFromList(country, i)); - } - } else { - map.put("country", JSON.getDefault().getMapper().writeValueAsString(country)); - } - } - if (city != null) { - if (isFileTypeOrListOfFiles(city)) { - fileTypeFound = true; - } - - if (city.getClass().equals(java.io.File.class) - || city.getClass().equals(Integer.class) - || city.getClass().equals(String.class) - || city.getClass().isEnum()) { - map.put("city", city); - } else if (isListOfFile(city)) { - for (int i = 0; i < getListSize(city); i++) { - map.put("city[" + i + "]", getFromList(city, i)); - } - } else { - map.put("city", JSON.getDefault().getMapper().writeValueAsString(city)); - } - } - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } - - if (accountId.getClass().equals(java.io.File.class) - || accountId.getClass().equals(Integer.class) - || accountId.getClass().equals(String.class) - || accountId.getClass().isEnum()) { - map.put("account_id", accountId); - } else if (isListOfFile(accountId)) { - for (int i = 0; i < getListSize(accountId); i++) { - map.put("account_id[" + i + "]", getFromList(accountId, i)); - } - } else { - map.put( - "account_id", - JSON.getDefault().getMapper().writeValueAsString(accountId)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java index 37873d146..27f1604df 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java @@ -10,157 +10,170 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** FaxLineDeleteRequest */ -@JsonPropertyOrder({FaxLineDeleteRequest.JSON_PROPERTY_NUMBER}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class FaxLineDeleteRequest { - public static final String JSON_PROPERTY_NUMBER = "number"; - @javax.annotation.Nonnull private String number; - - public FaxLineDeleteRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxLineDeleteRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxLineDeleteRequest.class); - } - public static FaxLineDeleteRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), FaxLineDeleteRequest.class); - } - - public FaxLineDeleteRequest number(@javax.annotation.Nonnull String number) { - this.number = number; - return this; - } - - /** - * The Fax Line number - * - * @return number - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getNumber() { - return number; +import com.dropbox.sign.ApiException; +/** + * FaxLineDeleteRequest + */ +@JsonPropertyOrder({ + FaxLineDeleteRequest.JSON_PROPERTY_NUMBER +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineDeleteRequest { + public static final String JSON_PROPERTY_NUMBER = "number"; + @javax.annotation.Nonnull + private String number; + + public FaxLineDeleteRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineDeleteRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineDeleteRequest.class); + } + + static public FaxLineDeleteRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineDeleteRequest.class + ); + } + + public FaxLineDeleteRequest number(@javax.annotation.Nonnull String number) { + this.number = number; + return this; + } + + /** + * The Fax Line number + * @return number + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(@javax.annotation.Nonnull String number) { + this.number = number; + } + + + /** + * Return true if this FaxLineDeleteRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setNumber(@javax.annotation.Nonnull String number) { - this.number = number; + if (o == null || getClass() != o.getClass()) { + return false; } + FaxLineDeleteRequest faxLineDeleteRequest = (FaxLineDeleteRequest) o; + return Objects.equals(this.number, faxLineDeleteRequest.number); + } + + @Override + public int hashCode() { + return Objects.hash(number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineDeleteRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } - /** Return true if this FaxLineDeleteRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); } - FaxLineDeleteRequest faxLineDeleteRequest = (FaxLineDeleteRequest) o; - return Objects.equals(this.number, faxLineDeleteRequest.number); } - - @Override - public int hashCode() { - return Objects.hash(number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxLineDeleteRequest {\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (number != null) { - if (isFileTypeOrListOfFiles(number)) { - fileTypeFound = true; - } - - if (number.getClass().equals(java.io.File.class) - || number.getClass().equals(Integer.class) - || number.getClass().equals(String.class) - || number.getClass().isEnum()) { - map.put("number", number); - } else if (isListOfFile(number)) { - for (int i = 0; i < getListSize(number); i++) { - map.put("number[" + i + "]", getFromList(number, i)); - } - } else { - map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java index 9aaf96bdb..97b205712 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java @@ -10,267 +10,285 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.FaxLineResponseFaxLine; +import com.dropbox.sign.model.ListInfoResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** FaxLineListResponse */ + +import com.dropbox.sign.ApiException; +/** + * FaxLineListResponse + */ @JsonPropertyOrder({ - FaxLineListResponse.JSON_PROPERTY_LIST_INFO, - FaxLineListResponse.JSON_PROPERTY_FAX_LINES, - FaxLineListResponse.JSON_PROPERTY_WARNINGS + FaxLineListResponse.JSON_PROPERTY_LIST_INFO, + FaxLineListResponse.JSON_PROPERTY_FAX_LINES, + FaxLineListResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class FaxLineListResponse { - public static final String JSON_PROPERTY_LIST_INFO = "list_info"; - @javax.annotation.Nonnull private ListInfoResponse listInfo; - - public static final String JSON_PROPERTY_FAX_LINES = "fax_lines"; - @javax.annotation.Nonnull private List faxLines = new ArrayList<>(); - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private WarningResponse warnings; - - public FaxLineListResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxLineListResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxLineListResponse.class); - } - - public static FaxLineListResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), FaxLineListResponse.class); - } - - public FaxLineListResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - return this; - } - - /** - * Get listInfo - * - * @return listInfo - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ListInfoResponse getListInfo() { - return listInfo; + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + @javax.annotation.Nonnull + private ListInfoResponse listInfo; + + public static final String JSON_PROPERTY_FAX_LINES = "fax_lines"; + @javax.annotation.Nonnull + private List faxLines = new ArrayList<>(); + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private WarningResponse warnings; + + public FaxLineListResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineListResponse.class); + } + + static public FaxLineListResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineListResponse.class + ); + } + + public FaxLineListResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; + } + + /** + * Get listInfo + * @return listInfo + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ListInfoResponse getListInfo() { + return listInfo; + } + + + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + } + + + public FaxLineListResponse faxLines(@javax.annotation.Nonnull List faxLines) { + this.faxLines = faxLines; + return this; + } + + public FaxLineListResponse addFaxLinesItem(FaxLineResponseFaxLine faxLinesItem) { + if (this.faxLines == null) { + this.faxLines = new ArrayList<>(); } - - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; + this.faxLines.add(faxLinesItem); + return this; + } + + /** + * Get faxLines + * @return faxLines + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_LINES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getFaxLines() { + return faxLines; + } + + + @JsonProperty(JSON_PROPERTY_FAX_LINES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxLines(@javax.annotation.Nonnull List faxLines) { + this.faxLines = faxLines; + } + + + public FaxLineListResponse warnings(@javax.annotation.Nullable WarningResponse warnings) { + this.warnings = warnings; + return this; + } + + /** + * Get warnings + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WarningResponse getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable WarningResponse warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this FaxLineListResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public FaxLineListResponse faxLines( - @javax.annotation.Nonnull List faxLines) { - this.faxLines = faxLines; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - public FaxLineListResponse addFaxLinesItem(FaxLineResponseFaxLine faxLinesItem) { - if (this.faxLines == null) { - this.faxLines = new ArrayList<>(); + FaxLineListResponse faxLineListResponse = (FaxLineListResponse) o; + return Objects.equals(this.listInfo, faxLineListResponse.listInfo) && + Objects.equals(this.faxLines, faxLineListResponse.faxLines) && + Objects.equals(this.warnings, faxLineListResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(listInfo, faxLines, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineListResponse {\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" faxLines: ").append(toIndentedString(faxLines)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (listInfo != null) { + if (isFileTypeOrListOfFiles(listInfo)) { + fileTypeFound = true; } - this.faxLines.add(faxLinesItem); - return this; - } - - /** - * Get faxLines - * - * @return faxLines - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FAX_LINES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getFaxLines() { - return faxLines; - } - - @JsonProperty(JSON_PROPERTY_FAX_LINES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFaxLines(@javax.annotation.Nonnull List faxLines) { - this.faxLines = faxLines; - } - - public FaxLineListResponse warnings(@javax.annotation.Nullable WarningResponse warnings) { - this.warnings = warnings; - return this; - } - - /** - * Get warnings - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public WarningResponse getWarnings() { - return warnings; - } - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable WarningResponse warnings) { - this.warnings = warnings; + if (listInfo.getClass().equals(java.io.File.class) || + listInfo.getClass().equals(Integer.class) || + listInfo.getClass().equals(String.class) || + listInfo.getClass().isEnum()) { + map.put("list_info", listInfo); + } else if (isListOfFile(listInfo)) { + for(int i = 0; i< getListSize(listInfo); i++) { + map.put("list_info[" + i + "]", getFromList(listInfo, i)); + } + } + else { + map.put("list_info", JSON.getDefault().getMapper().writeValueAsString(listInfo)); + } } + if (faxLines != null) { + if (isFileTypeOrListOfFiles(faxLines)) { + fileTypeFound = true; + } - /** Return true if this FaxLineListResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (faxLines.getClass().equals(java.io.File.class) || + faxLines.getClass().equals(Integer.class) || + faxLines.getClass().equals(String.class) || + faxLines.getClass().isEnum()) { + map.put("fax_lines", faxLines); + } else if (isListOfFile(faxLines)) { + for(int i = 0; i< getListSize(faxLines); i++) { + map.put("fax_lines[" + i + "]", getFromList(faxLines, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("fax_lines", JSON.getDefault().getMapper().writeValueAsString(faxLines)); } - FaxLineListResponse faxLineListResponse = (FaxLineListResponse) o; - return Objects.equals(this.listInfo, faxLineListResponse.listInfo) - && Objects.equals(this.faxLines, faxLineListResponse.faxLines) - && Objects.equals(this.warnings, faxLineListResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(listInfo, faxLines, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxLineListResponse {\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); - sb.append(" faxLines: ").append(toIndentedString(faxLines)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (listInfo != null) { - if (isFileTypeOrListOfFiles(listInfo)) { - fileTypeFound = true; - } - - if (listInfo.getClass().equals(java.io.File.class) - || listInfo.getClass().equals(Integer.class) - || listInfo.getClass().equals(String.class) - || listInfo.getClass().isEnum()) { - map.put("list_info", listInfo); - } else if (isListOfFile(listInfo)) { - for (int i = 0; i < getListSize(listInfo); i++) { - map.put("list_info[" + i + "]", getFromList(listInfo, i)); - } - } else { - map.put( - "list_info", - JSON.getDefault().getMapper().writeValueAsString(listInfo)); - } - } - if (faxLines != null) { - if (isFileTypeOrListOfFiles(faxLines)) { - fileTypeFound = true; - } - - if (faxLines.getClass().equals(java.io.File.class) - || faxLines.getClass().equals(Integer.class) - || faxLines.getClass().equals(String.class) - || faxLines.getClass().isEnum()) { - map.put("fax_lines", faxLines); - } else if (isListOfFile(faxLines)) { - for (int i = 0; i < getListSize(faxLines); i++) { - map.put("fax_lines[" + i + "]", getFromList(faxLines, i)); - } - } else { - map.put( - "fax_lines", - JSON.getDefault().getMapper().writeValueAsString(faxLines)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java index 9faabb1bf..f625de071 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java @@ -10,257 +10,272 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** FaxLineRemoveUserRequest */ + +import com.dropbox.sign.ApiException; +/** + * FaxLineRemoveUserRequest + */ @JsonPropertyOrder({ - FaxLineRemoveUserRequest.JSON_PROPERTY_NUMBER, - FaxLineRemoveUserRequest.JSON_PROPERTY_ACCOUNT_ID, - FaxLineRemoveUserRequest.JSON_PROPERTY_EMAIL_ADDRESS + FaxLineRemoveUserRequest.JSON_PROPERTY_NUMBER, + FaxLineRemoveUserRequest.JSON_PROPERTY_ACCOUNT_ID, + FaxLineRemoveUserRequest.JSON_PROPERTY_EMAIL_ADDRESS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class FaxLineRemoveUserRequest { - public static final String JSON_PROPERTY_NUMBER = "number"; - @javax.annotation.Nonnull private String number; + public static final String JSON_PROPERTY_NUMBER = "number"; + @javax.annotation.Nonnull + private String number; - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - @javax.annotation.Nullable private String accountId; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + @javax.annotation.Nullable + private String accountId; - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; - public FaxLineRemoveUserRequest() {} + public FaxLineRemoveUserRequest() { + } - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxLineRemoveUserRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxLineRemoveUserRequest.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineRemoveUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineRemoveUserRequest.class); + } - public static FaxLineRemoveUserRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - FaxLineRemoveUserRequest.class); - } + static public FaxLineRemoveUserRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineRemoveUserRequest.class + ); + } - public FaxLineRemoveUserRequest number(@javax.annotation.Nonnull String number) { - this.number = number; - return this; - } + public FaxLineRemoveUserRequest number(@javax.annotation.Nonnull String number) { + this.number = number; + return this; + } - /** - * The Fax Line number - * - * @return number - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getNumber() { - return number; - } + /** + * The Fax Line number + * @return number + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setNumber(@javax.annotation.Nonnull String number) { - this.number = number; - } + public String getNumber() { + return number; + } - public FaxLineRemoveUserRequest accountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; - } - /** - * Account ID of the user to remove access - * - * @return accountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccountId() { - return accountId; - } + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(@javax.annotation.Nonnull String number) { + this.number = number; + } - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - } - public FaxLineRemoveUserRequest emailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } + public FaxLineRemoveUserRequest accountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + return this; + } - /** - * Email address of the user to remove access - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; - } + /** + * Account ID of the user to remove access + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + } + + + public FaxLineRemoveUserRequest emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Email address of the user to remove access + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this FaxLineRemoveUserRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineRemoveUserRequest faxLineRemoveUserRequest = (FaxLineRemoveUserRequest) o; + return Objects.equals(this.number, faxLineRemoveUserRequest.number) && + Objects.equals(this.accountId, faxLineRemoveUserRequest.accountId) && + Objects.equals(this.emailAddress, faxLineRemoveUserRequest.emailAddress); + } - /** Return true if this FaxLineRemoveUserRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; + @Override + public int hashCode() { + return Objects.hash(number, accountId, emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineRemoveUserRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; } - FaxLineRemoveUserRequest faxLineRemoveUserRequest = (FaxLineRemoveUserRequest) o; - return Objects.equals(this.number, faxLineRemoveUserRequest.number) - && Objects.equals(this.accountId, faxLineRemoveUserRequest.accountId) - && Objects.equals(this.emailAddress, faxLineRemoveUserRequest.emailAddress); - } - @Override - public int hashCode() { - return Objects.hash(number, accountId, emailAddress); + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } } + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxLineRemoveUserRequest {\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append("}"); - return sb.toString(); + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (number != null) { - if (isFileTypeOrListOfFiles(number)) { - fileTypeFound = true; - } - - if (number.getClass().equals(java.io.File.class) - || number.getClass().equals(Integer.class) - || number.getClass().equals(String.class) - || number.getClass().isEnum()) { - map.put("number", number); - } else if (isListOfFile(number)) { - for (int i = 0; i < getListSize(number); i++) { - map.put("number[" + i + "]", getFromList(number, i)); - } - } else { - map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); - } - } - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } - - if (accountId.getClass().equals(java.io.File.class) - || accountId.getClass().equals(Integer.class) - || accountId.getClass().equals(String.class) - || accountId.getClass().isEnum()) { - map.put("account_id", accountId); - } else if (isListOfFile(accountId)) { - for (int i = 0; i < getListSize(accountId); i++) { - map.put("account_id[" + i + "]", getFromList(accountId, i)); - } - } else { - map.put( - "account_id", - JSON.getDefault().getMapper().writeValueAsString(accountId)); - } + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineResponse.java index c982b16ec..1bfa22579 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineResponse.java @@ -10,202 +10,223 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.FaxLineResponseFaxLine; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** FaxLineResponse */ -@JsonPropertyOrder({FaxLineResponse.JSON_PROPERTY_FAX_LINE, FaxLineResponse.JSON_PROPERTY_WARNINGS}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class FaxLineResponse { - public static final String JSON_PROPERTY_FAX_LINE = "fax_line"; - @javax.annotation.Nonnull private FaxLineResponseFaxLine faxLine; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private WarningResponse warnings; - public FaxLineResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxLineResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxLineResponse.class); - } - public static FaxLineResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), FaxLineResponse.class); - } - - public FaxLineResponse faxLine(@javax.annotation.Nonnull FaxLineResponseFaxLine faxLine) { - this.faxLine = faxLine; - return this; - } - - /** - * Get faxLine - * - * @return faxLine - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FAX_LINE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public FaxLineResponseFaxLine getFaxLine() { - return faxLine; - } - - @JsonProperty(JSON_PROPERTY_FAX_LINE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFaxLine(@javax.annotation.Nonnull FaxLineResponseFaxLine faxLine) { - this.faxLine = faxLine; - } - - public FaxLineResponse warnings(@javax.annotation.Nullable WarningResponse warnings) { - this.warnings = warnings; - return this; - } - - /** - * Get warnings - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public WarningResponse getWarnings() { - return warnings; - } +import com.dropbox.sign.ApiException; +/** + * FaxLineResponse + */ +@JsonPropertyOrder({ + FaxLineResponse.JSON_PROPERTY_FAX_LINE, + FaxLineResponse.JSON_PROPERTY_WARNINGS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineResponse { + public static final String JSON_PROPERTY_FAX_LINE = "fax_line"; + @javax.annotation.Nonnull + private FaxLineResponseFaxLine faxLine; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private WarningResponse warnings; + + public FaxLineResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineResponse.class); + } + + static public FaxLineResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineResponse.class + ); + } + + public FaxLineResponse faxLine(@javax.annotation.Nonnull FaxLineResponseFaxLine faxLine) { + this.faxLine = faxLine; + return this; + } + + /** + * Get faxLine + * @return faxLine + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public FaxLineResponseFaxLine getFaxLine() { + return faxLine; + } + + + @JsonProperty(JSON_PROPERTY_FAX_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxLine(@javax.annotation.Nonnull FaxLineResponseFaxLine faxLine) { + this.faxLine = faxLine; + } + + + public FaxLineResponse warnings(@javax.annotation.Nullable WarningResponse warnings) { + this.warnings = warnings; + return this; + } + + /** + * Get warnings + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WarningResponse getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable WarningResponse warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this FaxLineResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineResponse faxLineResponse = (FaxLineResponse) o; + return Objects.equals(this.faxLine, faxLineResponse.faxLine) && + Objects.equals(this.warnings, faxLineResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(faxLine, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineResponse {\n"); + sb.append(" faxLine: ").append(toIndentedString(faxLine)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (faxLine != null) { + if (isFileTypeOrListOfFiles(faxLine)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable WarningResponse warnings) { - this.warnings = warnings; + if (faxLine.getClass().equals(java.io.File.class) || + faxLine.getClass().equals(Integer.class) || + faxLine.getClass().equals(String.class) || + faxLine.getClass().isEnum()) { + map.put("fax_line", faxLine); + } else if (isListOfFile(faxLine)) { + for(int i = 0; i< getListSize(faxLine); i++) { + map.put("fax_line[" + i + "]", getFromList(faxLine, i)); + } + } + else { + map.put("fax_line", JSON.getDefault().getMapper().writeValueAsString(faxLine)); + } } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - /** Return true if this FaxLineResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); } - FaxLineResponse faxLineResponse = (FaxLineResponse) o; - return Objects.equals(this.faxLine, faxLineResponse.faxLine) - && Objects.equals(this.warnings, faxLineResponse.warnings); } - - @Override - public int hashCode() { - return Objects.hash(faxLine, warnings); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxLineResponse {\n"); - sb.append(" faxLine: ").append(toIndentedString(faxLine)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (faxLine != null) { - if (isFileTypeOrListOfFiles(faxLine)) { - fileTypeFound = true; - } - - if (faxLine.getClass().equals(java.io.File.class) - || faxLine.getClass().equals(Integer.class) - || faxLine.getClass().equals(String.class) - || faxLine.getClass().isEnum()) { - map.put("fax_line", faxLine); - } else if (isListOfFile(faxLine)) { - for (int i = 0; i < getListSize(faxLine); i++) { - map.put("fax_line[" + i + "]", getFromList(faxLine, i)); - } - } else { - map.put("fax_line", JSON.getDefault().getMapper().writeValueAsString(faxLine)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java index 79e0d943e..3eda0a8db 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java @@ -10,312 +10,334 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.AccountResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** FaxLineResponseFaxLine */ +import com.dropbox.sign.ApiException; +/** + * FaxLineResponseFaxLine + */ @JsonPropertyOrder({ - FaxLineResponseFaxLine.JSON_PROPERTY_NUMBER, - FaxLineResponseFaxLine.JSON_PROPERTY_CREATED_AT, - FaxLineResponseFaxLine.JSON_PROPERTY_UPDATED_AT, - FaxLineResponseFaxLine.JSON_PROPERTY_ACCOUNTS + FaxLineResponseFaxLine.JSON_PROPERTY_NUMBER, + FaxLineResponseFaxLine.JSON_PROPERTY_CREATED_AT, + FaxLineResponseFaxLine.JSON_PROPERTY_UPDATED_AT, + FaxLineResponseFaxLine.JSON_PROPERTY_ACCOUNTS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class FaxLineResponseFaxLine { - public static final String JSON_PROPERTY_NUMBER = "number"; - @javax.annotation.Nullable private String number; - - public static final String JSON_PROPERTY_CREATED_AT = "created_at"; - @javax.annotation.Nullable private Integer createdAt; - - public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; - @javax.annotation.Nullable private Integer updatedAt; - - public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; - @javax.annotation.Nullable private List accounts = null; - - public FaxLineResponseFaxLine() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxLineResponseFaxLine init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxLineResponseFaxLine.class); - } - - public static FaxLineResponseFaxLine init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), FaxLineResponseFaxLine.class); - } - - public FaxLineResponseFaxLine number(@javax.annotation.Nullable String number) { - this.number = number; - return this; + public static final String JSON_PROPERTY_NUMBER = "number"; + @javax.annotation.Nullable + private String number; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @javax.annotation.Nullable + private Integer createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @javax.annotation.Nullable + private Integer updatedAt; + + public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; + @javax.annotation.Nullable + private List accounts = null; + + public FaxLineResponseFaxLine() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineResponseFaxLine init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineResponseFaxLine.class); + } + + static public FaxLineResponseFaxLine init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineResponseFaxLine.class + ); + } + + public FaxLineResponseFaxLine number(@javax.annotation.Nullable String number) { + this.number = number; + return this; + } + + /** + * Number + * @return number + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(@javax.annotation.Nullable String number) { + this.number = number; + } + + + public FaxLineResponseFaxLine createdAt(@javax.annotation.Nullable Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Created at + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@javax.annotation.Nullable Integer createdAt) { + this.createdAt = createdAt; + } + + + public FaxLineResponseFaxLine updatedAt(@javax.annotation.Nullable Integer updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Updated at + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@javax.annotation.Nullable Integer updatedAt) { + this.updatedAt = updatedAt; + } + + + public FaxLineResponseFaxLine accounts(@javax.annotation.Nullable List accounts) { + this.accounts = accounts; + return this; + } + + public FaxLineResponseFaxLine addAccountsItem(AccountResponse accountsItem) { + if (this.accounts == null) { + this.accounts = new ArrayList<>(); } - - /** - * Number - * - * @return number - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getNumber() { - return number; + this.accounts.add(accountsItem); + return this; + } + + /** + * Get accounts + * @return accounts + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAccounts() { + return accounts; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccounts(@javax.annotation.Nullable List accounts) { + this.accounts = accounts; + } + + + /** + * Return true if this FaxLineResponseFaxLine object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumber(@javax.annotation.Nullable String number) { - this.number = number; + if (o == null || getClass() != o.getClass()) { + return false; } - - public FaxLineResponseFaxLine createdAt(@javax.annotation.Nullable Integer createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Created at - * - * @return createdAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getCreatedAt() { - return createdAt; - } - - @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCreatedAt(@javax.annotation.Nullable Integer createdAt) { - this.createdAt = createdAt; - } - - public FaxLineResponseFaxLine updatedAt(@javax.annotation.Nullable Integer updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Updated at - * - * @return updatedAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UPDATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getUpdatedAt() { - return updatedAt; - } - - @JsonProperty(JSON_PROPERTY_UPDATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUpdatedAt(@javax.annotation.Nullable Integer updatedAt) { - this.updatedAt = updatedAt; - } - - public FaxLineResponseFaxLine accounts( - @javax.annotation.Nullable List accounts) { - this.accounts = accounts; - return this; - } - - public FaxLineResponseFaxLine addAccountsItem(AccountResponse accountsItem) { - if (this.accounts == null) { - this.accounts = new ArrayList<>(); + FaxLineResponseFaxLine faxLineResponseFaxLine = (FaxLineResponseFaxLine) o; + return Objects.equals(this.number, faxLineResponseFaxLine.number) && + Objects.equals(this.createdAt, faxLineResponseFaxLine.createdAt) && + Objects.equals(this.updatedAt, faxLineResponseFaxLine.updatedAt) && + Objects.equals(this.accounts, faxLineResponseFaxLine.accounts); + } + + @Override + public int hashCode() { + return Objects.hash(number, createdAt, updatedAt, accounts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineResponseFaxLine {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; } - this.accounts.add(accountsItem); - return this; - } - /** - * Get accounts - * - * @return accounts - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAccounts() { - return accounts; + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } } + if (createdAt != null) { + if (isFileTypeOrListOfFiles(createdAt)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ACCOUNTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccounts(@javax.annotation.Nullable List accounts) { - this.accounts = accounts; + if (createdAt.getClass().equals(java.io.File.class) || + createdAt.getClass().equals(Integer.class) || + createdAt.getClass().equals(String.class) || + createdAt.getClass().isEnum()) { + map.put("created_at", createdAt); + } else if (isListOfFile(createdAt)) { + for(int i = 0; i< getListSize(createdAt); i++) { + map.put("created_at[" + i + "]", getFromList(createdAt, i)); + } + } + else { + map.put("created_at", JSON.getDefault().getMapper().writeValueAsString(createdAt)); + } } + if (updatedAt != null) { + if (isFileTypeOrListOfFiles(updatedAt)) { + fileTypeFound = true; + } - /** Return true if this FaxLineResponseFaxLine object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (updatedAt.getClass().equals(java.io.File.class) || + updatedAt.getClass().equals(Integer.class) || + updatedAt.getClass().equals(String.class) || + updatedAt.getClass().isEnum()) { + map.put("updated_at", updatedAt); + } else if (isListOfFile(updatedAt)) { + for(int i = 0; i< getListSize(updatedAt); i++) { + map.put("updated_at[" + i + "]", getFromList(updatedAt, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("updated_at", JSON.getDefault().getMapper().writeValueAsString(updatedAt)); } - FaxLineResponseFaxLine faxLineResponseFaxLine = (FaxLineResponseFaxLine) o; - return Objects.equals(this.number, faxLineResponseFaxLine.number) - && Objects.equals(this.createdAt, faxLineResponseFaxLine.createdAt) - && Objects.equals(this.updatedAt, faxLineResponseFaxLine.updatedAt) - && Objects.equals(this.accounts, faxLineResponseFaxLine.accounts); } + if (accounts != null) { + if (isFileTypeOrListOfFiles(accounts)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(number, createdAt, updatedAt, accounts); + if (accounts.getClass().equals(java.io.File.class) || + accounts.getClass().equals(Integer.class) || + accounts.getClass().equals(String.class) || + accounts.getClass().isEnum()) { + map.put("accounts", accounts); + } else if (isListOfFile(accounts)) { + for(int i = 0; i< getListSize(accounts); i++) { + map.put("accounts[" + i + "]", getFromList(accounts, i)); + } + } + else { + map.put("accounts", JSON.getDefault().getMapper().writeValueAsString(accounts)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxLineResponseFaxLine {\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (number != null) { - if (isFileTypeOrListOfFiles(number)) { - fileTypeFound = true; - } - - if (number.getClass().equals(java.io.File.class) - || number.getClass().equals(Integer.class) - || number.getClass().equals(String.class) - || number.getClass().isEnum()) { - map.put("number", number); - } else if (isListOfFile(number)) { - for (int i = 0; i < getListSize(number); i++) { - map.put("number[" + i + "]", getFromList(number, i)); - } - } else { - map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); - } - } - if (createdAt != null) { - if (isFileTypeOrListOfFiles(createdAt)) { - fileTypeFound = true; - } - - if (createdAt.getClass().equals(java.io.File.class) - || createdAt.getClass().equals(Integer.class) - || createdAt.getClass().equals(String.class) - || createdAt.getClass().isEnum()) { - map.put("created_at", createdAt); - } else if (isListOfFile(createdAt)) { - for (int i = 0; i < getListSize(createdAt); i++) { - map.put("created_at[" + i + "]", getFromList(createdAt, i)); - } - } else { - map.put( - "created_at", - JSON.getDefault().getMapper().writeValueAsString(createdAt)); - } - } - if (updatedAt != null) { - if (isFileTypeOrListOfFiles(updatedAt)) { - fileTypeFound = true; - } - - if (updatedAt.getClass().equals(java.io.File.class) - || updatedAt.getClass().equals(Integer.class) - || updatedAt.getClass().equals(String.class) - || updatedAt.getClass().isEnum()) { - map.put("updated_at", updatedAt); - } else if (isListOfFile(updatedAt)) { - for (int i = 0; i < getListSize(updatedAt); i++) { - map.put("updated_at[" + i + "]", getFromList(updatedAt, i)); - } - } else { - map.put( - "updated_at", - JSON.getDefault().getMapper().writeValueAsString(updatedAt)); - } - } - if (accounts != null) { - if (isFileTypeOrListOfFiles(accounts)) { - fileTypeFound = true; - } - - if (accounts.getClass().equals(java.io.File.class) - || accounts.getClass().equals(Integer.class) - || accounts.getClass().equals(String.class) - || accounts.getClass().isEnum()) { - map.put("accounts", accounts); - } else if (isListOfFile(accounts)) { - for (int i = 0; i < getListSize(accounts); i++) { - map.put("accounts[" + i + "]", getFromList(accounts, i)); - } - } else { - map.put("accounts", JSON.getDefault().getMapper().writeValueAsString(accounts)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxListResponse.java index a8f6296b9..e1ff9d342 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxListResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxListResponse.java @@ -10,215 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.FaxResponse; +import com.dropbox.sign.model.ListInfoResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** FaxListResponse */ -@JsonPropertyOrder({FaxListResponse.JSON_PROPERTY_FAXES, FaxListResponse.JSON_PROPERTY_LIST_INFO}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class FaxListResponse { - public static final String JSON_PROPERTY_FAXES = "faxes"; - @javax.annotation.Nonnull private List faxes = new ArrayList<>(); - - public static final String JSON_PROPERTY_LIST_INFO = "list_info"; - @javax.annotation.Nonnull private ListInfoResponse listInfo; - - public FaxListResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxListResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxListResponse.class); - } - - public static FaxListResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), FaxListResponse.class); - } +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; - public FaxListResponse faxes(@javax.annotation.Nonnull List faxes) { - this.faxes = faxes; - return this; - } - public FaxListResponse addFaxesItem(FaxResponse faxesItem) { - if (this.faxes == null) { - this.faxes = new ArrayList<>(); +import com.dropbox.sign.ApiException; +/** + * FaxListResponse + */ +@JsonPropertyOrder({ + FaxListResponse.JSON_PROPERTY_FAXES, + FaxListResponse.JSON_PROPERTY_LIST_INFO +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxListResponse { + public static final String JSON_PROPERTY_FAXES = "faxes"; + @javax.annotation.Nonnull + private List faxes = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + @javax.annotation.Nonnull + private ListInfoResponse listInfo; + + public FaxListResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxListResponse.class); + } + + static public FaxListResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxListResponse.class + ); + } + + public FaxListResponse faxes(@javax.annotation.Nonnull List faxes) { + this.faxes = faxes; + return this; + } + + public FaxListResponse addFaxesItem(FaxResponse faxesItem) { + if (this.faxes == null) { + this.faxes = new ArrayList<>(); + } + this.faxes.add(faxesItem); + return this; + } + + /** + * Get faxes + * @return faxes + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAXES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getFaxes() { + return faxes; + } + + + @JsonProperty(JSON_PROPERTY_FAXES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxes(@javax.annotation.Nonnull List faxes) { + this.faxes = faxes; + } + + + public FaxListResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; + } + + /** + * Get listInfo + * @return listInfo + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ListInfoResponse getListInfo() { + return listInfo; + } + + + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + } + + + /** + * Return true if this FaxListResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxListResponse faxListResponse = (FaxListResponse) o; + return Objects.equals(this.faxes, faxListResponse.faxes) && + Objects.equals(this.listInfo, faxListResponse.listInfo); + } + + @Override + public int hashCode() { + return Objects.hash(faxes, listInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxListResponse {\n"); + sb.append(" faxes: ").append(toIndentedString(faxes)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (faxes != null) { + if (isFileTypeOrListOfFiles(faxes)) { + fileTypeFound = true; } - this.faxes.add(faxesItem); - return this; - } - - /** - * Get faxes - * - * @return faxes - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FAXES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getFaxes() { - return faxes; - } - - @JsonProperty(JSON_PROPERTY_FAXES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFaxes(@javax.annotation.Nonnull List faxes) { - this.faxes = faxes; - } - - public FaxListResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - return this; - } - /** - * Get listInfo - * - * @return listInfo - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ListInfoResponse getListInfo() { - return listInfo; - } - - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - } - - /** Return true if this FaxListResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (faxes.getClass().equals(java.io.File.class) || + faxes.getClass().equals(Integer.class) || + faxes.getClass().equals(String.class) || + faxes.getClass().isEnum()) { + map.put("faxes", faxes); + } else if (isListOfFile(faxes)) { + for(int i = 0; i< getListSize(faxes); i++) { + map.put("faxes[" + i + "]", getFromList(faxes, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("faxes", JSON.getDefault().getMapper().writeValueAsString(faxes)); } - FaxListResponse faxListResponse = (FaxListResponse) o; - return Objects.equals(this.faxes, faxListResponse.faxes) - && Objects.equals(this.listInfo, faxListResponse.listInfo); } + if (listInfo != null) { + if (isFileTypeOrListOfFiles(listInfo)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(faxes, listInfo); + if (listInfo.getClass().equals(java.io.File.class) || + listInfo.getClass().equals(Integer.class) || + listInfo.getClass().equals(String.class) || + listInfo.getClass().isEnum()) { + map.put("list_info", listInfo); + } else if (isListOfFile(listInfo)) { + for(int i = 0; i< getListSize(listInfo); i++) { + map.put("list_info[" + i + "]", getFromList(listInfo, i)); + } + } + else { + map.put("list_info", JSON.getDefault().getMapper().writeValueAsString(listInfo)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxListResponse {\n"); - sb.append(" faxes: ").append(toIndentedString(faxes)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (faxes != null) { - if (isFileTypeOrListOfFiles(faxes)) { - fileTypeFound = true; - } - - if (faxes.getClass().equals(java.io.File.class) - || faxes.getClass().equals(Integer.class) - || faxes.getClass().equals(String.class) - || faxes.getClass().isEnum()) { - map.put("faxes", faxes); - } else if (isListOfFile(faxes)) { - for (int i = 0; i < getListSize(faxes); i++) { - map.put("faxes[" + i + "]", getFromList(faxes, i)); - } - } else { - map.put("faxes", JSON.getDefault().getMapper().writeValueAsString(faxes)); - } - } - if (listInfo != null) { - if (isFileTypeOrListOfFiles(listInfo)) { - fileTypeFound = true; - } - - if (listInfo.getClass().equals(java.io.File.class) - || listInfo.getClass().equals(Integer.class) - || listInfo.getClass().equals(String.class) - || listInfo.getClass().isEnum()) { - map.put("list_info", listInfo); - } else if (isListOfFile(listInfo)) { - for (int i = 0; i < getListSize(listInfo); i++) { - map.put("list_info[" + i + "]", getFromList(listInfo, i)); - } - } else { - map.put( - "list_info", - JSON.getDefault().getMapper().writeValueAsString(listInfo)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java index 7ef24b5cc..bb5241571 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponse.java @@ -10,669 +10,701 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.FaxResponseTransmission; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** FaxResponse */ +import com.dropbox.sign.ApiException; +/** + * FaxResponse + */ @JsonPropertyOrder({ - FaxResponse.JSON_PROPERTY_FAX_ID, - FaxResponse.JSON_PROPERTY_TITLE, - FaxResponse.JSON_PROPERTY_ORIGINAL_TITLE, - FaxResponse.JSON_PROPERTY_METADATA, - FaxResponse.JSON_PROPERTY_CREATED_AT, - FaxResponse.JSON_PROPERTY_SENDER, - FaxResponse.JSON_PROPERTY_FILES_URL, - FaxResponse.JSON_PROPERTY_TRANSMISSIONS, - FaxResponse.JSON_PROPERTY_SUBJECT, - FaxResponse.JSON_PROPERTY_MESSAGE, - FaxResponse.JSON_PROPERTY_FINAL_COPY_URI + FaxResponse.JSON_PROPERTY_FAX_ID, + FaxResponse.JSON_PROPERTY_TITLE, + FaxResponse.JSON_PROPERTY_ORIGINAL_TITLE, + FaxResponse.JSON_PROPERTY_METADATA, + FaxResponse.JSON_PROPERTY_CREATED_AT, + FaxResponse.JSON_PROPERTY_SENDER, + FaxResponse.JSON_PROPERTY_FILES_URL, + FaxResponse.JSON_PROPERTY_TRANSMISSIONS, + FaxResponse.JSON_PROPERTY_SUBJECT, + FaxResponse.JSON_PROPERTY_MESSAGE, + FaxResponse.JSON_PROPERTY_FINAL_COPY_URI }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class FaxResponse { - public static final String JSON_PROPERTY_FAX_ID = "fax_id"; - @javax.annotation.Nonnull private String faxId; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nonnull private String title; - - public static final String JSON_PROPERTY_ORIGINAL_TITLE = "original_title"; - @javax.annotation.Nonnull private String originalTitle; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nonnull private Map metadata = new HashMap<>(); - - public static final String JSON_PROPERTY_CREATED_AT = "created_at"; - @javax.annotation.Nonnull private Integer createdAt; - - public static final String JSON_PROPERTY_SENDER = "sender"; - @javax.annotation.Nonnull private String sender; - - public static final String JSON_PROPERTY_FILES_URL = "files_url"; - @javax.annotation.Nonnull private String filesUrl; - - public static final String JSON_PROPERTY_TRANSMISSIONS = "transmissions"; - - @javax.annotation.Nonnull - private List transmissions = new ArrayList<>(); - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_FINAL_COPY_URI = "final_copy_uri"; - @javax.annotation.Nullable private String finalCopyUri; - - public FaxResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxResponse.class); - } - - public static FaxResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), FaxResponse.class); - } - - public FaxResponse faxId(@javax.annotation.Nonnull String faxId) { - this.faxId = faxId; - return this; - } - - /** - * Fax ID - * - * @return faxId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FAX_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getFaxId() { - return faxId; - } - - @JsonProperty(JSON_PROPERTY_FAX_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFaxId(@javax.annotation.Nonnull String faxId) { - this.faxId = faxId; - } - - public FaxResponse title(@javax.annotation.Nonnull String title) { - this.title = title; - return this; - } - - /** - * Fax Title - * - * @return title - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTitle() { - return title; - } - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTitle(@javax.annotation.Nonnull String title) { - this.title = title; - } - - public FaxResponse originalTitle(@javax.annotation.Nonnull String originalTitle) { - this.originalTitle = originalTitle; - return this; - } - - /** - * Fax Original Title - * - * @return originalTitle - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getOriginalTitle() { - return originalTitle; - } - - @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setOriginalTitle(@javax.annotation.Nonnull String originalTitle) { - this.originalTitle = originalTitle; - } - - public FaxResponse metadata(@javax.annotation.Nonnull Map metadata) { - this.metadata = metadata; - return this; - } - - public FaxResponse putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + public static final String JSON_PROPERTY_FAX_ID = "fax_id"; + @javax.annotation.Nonnull + private String faxId; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nonnull + private String title; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "original_title"; + @javax.annotation.Nonnull + private String originalTitle; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nonnull + private Map metadata = new HashMap<>(); + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @javax.annotation.Nonnull + private Integer createdAt; + + public static final String JSON_PROPERTY_SENDER = "sender"; + @javax.annotation.Nonnull + private String sender; + + public static final String JSON_PROPERTY_FILES_URL = "files_url"; + @javax.annotation.Nonnull + private String filesUrl; + + public static final String JSON_PROPERTY_TRANSMISSIONS = "transmissions"; + @javax.annotation.Nonnull + private List transmissions = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_FINAL_COPY_URI = "final_copy_uri"; + @javax.annotation.Nullable + private String finalCopyUri; + + public FaxResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxResponse.class); + } + + static public FaxResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxResponse.class + ); + } + + public FaxResponse faxId(@javax.annotation.Nonnull String faxId) { + this.faxId = faxId; + return this; + } + + /** + * Fax ID + * @return faxId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFaxId() { + return faxId; + } + + + @JsonProperty(JSON_PROPERTY_FAX_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxId(@javax.annotation.Nonnull String faxId) { + this.faxId = faxId; + } + + + public FaxResponse title(@javax.annotation.Nonnull String title) { + this.title = title; + return this; + } + + /** + * Fax Title + * @return title + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTitle(@javax.annotation.Nonnull String title) { + this.title = title; + } + + + public FaxResponse originalTitle(@javax.annotation.Nonnull String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Fax Original Title + * @return originalTitle + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getOriginalTitle() { + return originalTitle; + } + + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOriginalTitle(@javax.annotation.Nonnull String originalTitle) { + this.originalTitle = originalTitle; + } + + + public FaxResponse metadata(@javax.annotation.Nonnull Map metadata) { + this.metadata = metadata; + return this; + } + + public FaxResponse putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Fax Metadata + * @return metadata + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public void setMetadata(@javax.annotation.Nonnull Map metadata) { + this.metadata = metadata; + } + + + public FaxResponse createdAt(@javax.annotation.Nonnull Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Fax Created At Timestamp + * @return createdAt + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(@javax.annotation.Nonnull Integer createdAt) { + this.createdAt = createdAt; + } + + + public FaxResponse sender(@javax.annotation.Nonnull String sender) { + this.sender = sender; + return this; + } + + /** + * Fax Sender Email + * @return sender + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSender(@javax.annotation.Nonnull String sender) { + this.sender = sender; + } + + + public FaxResponse filesUrl(@javax.annotation.Nonnull String filesUrl) { + this.filesUrl = filesUrl; + return this; + } + + /** + * Fax Files URL + * @return filesUrl + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFilesUrl() { + return filesUrl; + } + + + @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFilesUrl(@javax.annotation.Nonnull String filesUrl) { + this.filesUrl = filesUrl; + } + + + public FaxResponse transmissions(@javax.annotation.Nonnull List transmissions) { + this.transmissions = transmissions; + return this; + } + + public FaxResponse addTransmissionsItem(FaxResponseTransmission transmissionsItem) { + if (this.transmissions == null) { + this.transmissions = new ArrayList<>(); + } + this.transmissions.add(transmissionsItem); + return this; + } + + /** + * Fax Transmissions List + * @return transmissions + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTransmissions() { + return transmissions; + } + + + @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTransmissions(@javax.annotation.Nonnull List transmissions) { + this.transmissions = transmissions; + } + + + public FaxResponse subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * Fax Subject + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public FaxResponse message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Fax Message + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public FaxResponse finalCopyUri(@javax.annotation.Nullable String finalCopyUri) { + this.finalCopyUri = finalCopyUri; + return this; + } + + /** + * The path where the completed document can be downloaded + * @return finalCopyUri + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFinalCopyUri() { + return finalCopyUri; + } + + + @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFinalCopyUri(@javax.annotation.Nullable String finalCopyUri) { + this.finalCopyUri = finalCopyUri; + } + + + /** + * Return true if this FaxResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxResponse faxResponse = (FaxResponse) o; + return Objects.equals(this.faxId, faxResponse.faxId) && + Objects.equals(this.title, faxResponse.title) && + Objects.equals(this.originalTitle, faxResponse.originalTitle) && + Objects.equals(this.metadata, faxResponse.metadata) && + Objects.equals(this.createdAt, faxResponse.createdAt) && + Objects.equals(this.sender, faxResponse.sender) && + Objects.equals(this.filesUrl, faxResponse.filesUrl) && + Objects.equals(this.transmissions, faxResponse.transmissions) && + Objects.equals(this.subject, faxResponse.subject) && + Objects.equals(this.message, faxResponse.message) && + Objects.equals(this.finalCopyUri, faxResponse.finalCopyUri); + } + + @Override + public int hashCode() { + return Objects.hash(faxId, title, originalTitle, metadata, createdAt, sender, filesUrl, transmissions, subject, message, finalCopyUri); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxResponse {\n"); + sb.append(" faxId: ").append(toIndentedString(faxId)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); + sb.append(" transmissions: ").append(toIndentedString(transmissions)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" finalCopyUri: ").append(toIndentedString(finalCopyUri)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (faxId != null) { + if (isFileTypeOrListOfFiles(faxId)) { + fileTypeFound = true; } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Fax Metadata - * - * @return metadata - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) - public void setMetadata(@javax.annotation.Nonnull Map metadata) { - this.metadata = metadata; - } - - public FaxResponse createdAt(@javax.annotation.Nonnull Integer createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Fax Created At Timestamp - * - * @return createdAt - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getCreatedAt() { - return createdAt; - } - - @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setCreatedAt(@javax.annotation.Nonnull Integer createdAt) { - this.createdAt = createdAt; - } - - public FaxResponse sender(@javax.annotation.Nonnull String sender) { - this.sender = sender; - return this; - } - - /** - * Fax Sender Email - * - * @return sender - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SENDER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getSender() { - return sender; - } - - @JsonProperty(JSON_PROPERTY_SENDER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSender(@javax.annotation.Nonnull String sender) { - this.sender = sender; - } - - public FaxResponse filesUrl(@javax.annotation.Nonnull String filesUrl) { - this.filesUrl = filesUrl; - return this; - } - - /** - * Fax Files URL - * - * @return filesUrl - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getFilesUrl() { - return filesUrl; - } - - @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFilesUrl(@javax.annotation.Nonnull String filesUrl) { - this.filesUrl = filesUrl; - } - - public FaxResponse transmissions( - @javax.annotation.Nonnull List transmissions) { - this.transmissions = transmissions; - return this; - } - public FaxResponse addTransmissionsItem(FaxResponseTransmission transmissionsItem) { - if (this.transmissions == null) { - this.transmissions = new ArrayList<>(); + if (faxId.getClass().equals(java.io.File.class) || + faxId.getClass().equals(Integer.class) || + faxId.getClass().equals(String.class) || + faxId.getClass().isEnum()) { + map.put("fax_id", faxId); + } else if (isListOfFile(faxId)) { + for(int i = 0; i< getListSize(faxId); i++) { + map.put("fax_id[" + i + "]", getFromList(faxId, i)); + } + } + else { + map.put("fax_id", JSON.getDefault().getMapper().writeValueAsString(faxId)); } - this.transmissions.add(transmissionsItem); - return this; - } - - /** - * Fax Transmissions List - * - * @return transmissions - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getTransmissions() { - return transmissions; - } - - @JsonProperty(JSON_PROPERTY_TRANSMISSIONS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTransmissions( - @javax.annotation.Nonnull List transmissions) { - this.transmissions = transmissions; - } - - public FaxResponse subject(@javax.annotation.Nullable String subject) { - this.subject = subject; - return this; } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - /** - * Fax Subject - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } + if (originalTitle != null) { + if (isFileTypeOrListOfFiles(originalTitle)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (originalTitle.getClass().equals(java.io.File.class) || + originalTitle.getClass().equals(Integer.class) || + originalTitle.getClass().equals(String.class) || + originalTitle.getClass().isEnum()) { + map.put("original_title", originalTitle); + } else if (isListOfFile(originalTitle)) { + for(int i = 0; i< getListSize(originalTitle); i++) { + map.put("original_title[" + i + "]", getFromList(originalTitle, i)); + } + } + else { + map.put("original_title", JSON.getDefault().getMapper().writeValueAsString(originalTitle)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - public FaxResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (createdAt != null) { + if (isFileTypeOrListOfFiles(createdAt)) { + fileTypeFound = true; + } - /** - * Fax Message - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; + if (createdAt.getClass().equals(java.io.File.class) || + createdAt.getClass().equals(Integer.class) || + createdAt.getClass().equals(String.class) || + createdAt.getClass().isEnum()) { + map.put("created_at", createdAt); + } else if (isListOfFile(createdAt)) { + for(int i = 0; i< getListSize(createdAt); i++) { + map.put("created_at[" + i + "]", getFromList(createdAt, i)); + } + } + else { + map.put("created_at", JSON.getDefault().getMapper().writeValueAsString(createdAt)); + } } + if (sender != null) { + if (isFileTypeOrListOfFiles(sender)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; + if (sender.getClass().equals(java.io.File.class) || + sender.getClass().equals(Integer.class) || + sender.getClass().equals(String.class) || + sender.getClass().isEnum()) { + map.put("sender", sender); + } else if (isListOfFile(sender)) { + for(int i = 0; i< getListSize(sender); i++) { + map.put("sender[" + i + "]", getFromList(sender, i)); + } + } + else { + map.put("sender", JSON.getDefault().getMapper().writeValueAsString(sender)); + } } + if (filesUrl != null) { + if (isFileTypeOrListOfFiles(filesUrl)) { + fileTypeFound = true; + } - public FaxResponse finalCopyUri(@javax.annotation.Nullable String finalCopyUri) { - this.finalCopyUri = finalCopyUri; - return this; + if (filesUrl.getClass().equals(java.io.File.class) || + filesUrl.getClass().equals(Integer.class) || + filesUrl.getClass().equals(String.class) || + filesUrl.getClass().isEnum()) { + map.put("files_url", filesUrl); + } else if (isListOfFile(filesUrl)) { + for(int i = 0; i< getListSize(filesUrl); i++) { + map.put("files_url[" + i + "]", getFromList(filesUrl, i)); + } + } + else { + map.put("files_url", JSON.getDefault().getMapper().writeValueAsString(filesUrl)); + } } + if (transmissions != null) { + if (isFileTypeOrListOfFiles(transmissions)) { + fileTypeFound = true; + } - /** - * The path where the completed document can be downloaded - * - * @return finalCopyUri - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFinalCopyUri() { - return finalCopyUri; + if (transmissions.getClass().equals(java.io.File.class) || + transmissions.getClass().equals(Integer.class) || + transmissions.getClass().equals(String.class) || + transmissions.getClass().isEnum()) { + map.put("transmissions", transmissions); + } else if (isListOfFile(transmissions)) { + for(int i = 0; i< getListSize(transmissions); i++) { + map.put("transmissions[" + i + "]", getFromList(transmissions, i)); + } + } + else { + map.put("transmissions", JSON.getDefault().getMapper().writeValueAsString(transmissions)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFinalCopyUri(@javax.annotation.Nullable String finalCopyUri) { - this.finalCopyUri = finalCopyUri; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - /** Return true if this FaxResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FaxResponse faxResponse = (FaxResponse) o; - return Objects.equals(this.faxId, faxResponse.faxId) - && Objects.equals(this.title, faxResponse.title) - && Objects.equals(this.originalTitle, faxResponse.originalTitle) - && Objects.equals(this.metadata, faxResponse.metadata) - && Objects.equals(this.createdAt, faxResponse.createdAt) - && Objects.equals(this.sender, faxResponse.sender) - && Objects.equals(this.filesUrl, faxResponse.filesUrl) - && Objects.equals(this.transmissions, faxResponse.transmissions) - && Objects.equals(this.subject, faxResponse.subject) - && Objects.equals(this.message, faxResponse.message) - && Objects.equals(this.finalCopyUri, faxResponse.finalCopyUri); + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (finalCopyUri != null) { + if (isFileTypeOrListOfFiles(finalCopyUri)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - faxId, - title, - originalTitle, - metadata, - createdAt, - sender, - filesUrl, - transmissions, - subject, - message, - finalCopyUri); + if (finalCopyUri.getClass().equals(java.io.File.class) || + finalCopyUri.getClass().equals(Integer.class) || + finalCopyUri.getClass().equals(String.class) || + finalCopyUri.getClass().isEnum()) { + map.put("final_copy_uri", finalCopyUri); + } else if (isListOfFile(finalCopyUri)) { + for(int i = 0; i< getListSize(finalCopyUri); i++) { + map.put("final_copy_uri[" + i + "]", getFromList(finalCopyUri, i)); + } + } + else { + map.put("final_copy_uri", JSON.getDefault().getMapper().writeValueAsString(finalCopyUri)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxResponse {\n"); - sb.append(" faxId: ").append(toIndentedString(faxId)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); - sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); - sb.append(" transmissions: ").append(toIndentedString(transmissions)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" finalCopyUri: ").append(toIndentedString(finalCopyUri)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (faxId != null) { - if (isFileTypeOrListOfFiles(faxId)) { - fileTypeFound = true; - } - - if (faxId.getClass().equals(java.io.File.class) - || faxId.getClass().equals(Integer.class) - || faxId.getClass().equals(String.class) - || faxId.getClass().isEnum()) { - map.put("fax_id", faxId); - } else if (isListOfFile(faxId)) { - for (int i = 0; i < getListSize(faxId); i++) { - map.put("fax_id[" + i + "]", getFromList(faxId, i)); - } - } else { - map.put("fax_id", JSON.getDefault().getMapper().writeValueAsString(faxId)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (originalTitle != null) { - if (isFileTypeOrListOfFiles(originalTitle)) { - fileTypeFound = true; - } - - if (originalTitle.getClass().equals(java.io.File.class) - || originalTitle.getClass().equals(Integer.class) - || originalTitle.getClass().equals(String.class) - || originalTitle.getClass().isEnum()) { - map.put("original_title", originalTitle); - } else if (isListOfFile(originalTitle)) { - for (int i = 0; i < getListSize(originalTitle); i++) { - map.put("original_title[" + i + "]", getFromList(originalTitle, i)); - } - } else { - map.put( - "original_title", - JSON.getDefault().getMapper().writeValueAsString(originalTitle)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (createdAt != null) { - if (isFileTypeOrListOfFiles(createdAt)) { - fileTypeFound = true; - } - - if (createdAt.getClass().equals(java.io.File.class) - || createdAt.getClass().equals(Integer.class) - || createdAt.getClass().equals(String.class) - || createdAt.getClass().isEnum()) { - map.put("created_at", createdAt); - } else if (isListOfFile(createdAt)) { - for (int i = 0; i < getListSize(createdAt); i++) { - map.put("created_at[" + i + "]", getFromList(createdAt, i)); - } - } else { - map.put( - "created_at", - JSON.getDefault().getMapper().writeValueAsString(createdAt)); - } - } - if (sender != null) { - if (isFileTypeOrListOfFiles(sender)) { - fileTypeFound = true; - } - - if (sender.getClass().equals(java.io.File.class) - || sender.getClass().equals(Integer.class) - || sender.getClass().equals(String.class) - || sender.getClass().isEnum()) { - map.put("sender", sender); - } else if (isListOfFile(sender)) { - for (int i = 0; i < getListSize(sender); i++) { - map.put("sender[" + i + "]", getFromList(sender, i)); - } - } else { - map.put("sender", JSON.getDefault().getMapper().writeValueAsString(sender)); - } - } - if (filesUrl != null) { - if (isFileTypeOrListOfFiles(filesUrl)) { - fileTypeFound = true; - } - - if (filesUrl.getClass().equals(java.io.File.class) - || filesUrl.getClass().equals(Integer.class) - || filesUrl.getClass().equals(String.class) - || filesUrl.getClass().isEnum()) { - map.put("files_url", filesUrl); - } else if (isListOfFile(filesUrl)) { - for (int i = 0; i < getListSize(filesUrl); i++) { - map.put("files_url[" + i + "]", getFromList(filesUrl, i)); - } - } else { - map.put( - "files_url", - JSON.getDefault().getMapper().writeValueAsString(filesUrl)); - } - } - if (transmissions != null) { - if (isFileTypeOrListOfFiles(transmissions)) { - fileTypeFound = true; - } - - if (transmissions.getClass().equals(java.io.File.class) - || transmissions.getClass().equals(Integer.class) - || transmissions.getClass().equals(String.class) - || transmissions.getClass().isEnum()) { - map.put("transmissions", transmissions); - } else if (isListOfFile(transmissions)) { - for (int i = 0; i < getListSize(transmissions); i++) { - map.put("transmissions[" + i + "]", getFromList(transmissions, i)); - } - } else { - map.put( - "transmissions", - JSON.getDefault().getMapper().writeValueAsString(transmissions)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (finalCopyUri != null) { - if (isFileTypeOrListOfFiles(finalCopyUri)) { - fileTypeFound = true; - } - - if (finalCopyUri.getClass().equals(java.io.File.class) - || finalCopyUri.getClass().equals(Integer.class) - || finalCopyUri.getClass().equals(String.class) - || finalCopyUri.getClass().isEnum()) { - map.put("final_copy_uri", finalCopyUri); - } else if (isListOfFile(finalCopyUri)) { - for (int i = 0; i < getListSize(finalCopyUri); i++) { - map.put("final_copy_uri[" + i + "]", getFromList(finalCopyUri, i)); - } - } else { - map.put( - "final_copy_uri", - JSON.getDefault().getMapper().writeValueAsString(finalCopyUri)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java index 133bde289..3d2693225 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxResponseTransmission.java @@ -10,304 +10,319 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** FaxResponseTransmission */ + +import com.dropbox.sign.ApiException; +/** + * FaxResponseTransmission + */ @JsonPropertyOrder({ - FaxResponseTransmission.JSON_PROPERTY_RECIPIENT, - FaxResponseTransmission.JSON_PROPERTY_STATUS_CODE, - FaxResponseTransmission.JSON_PROPERTY_SENT_AT + FaxResponseTransmission.JSON_PROPERTY_RECIPIENT, + FaxResponseTransmission.JSON_PROPERTY_STATUS_CODE, + FaxResponseTransmission.JSON_PROPERTY_SENT_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class FaxResponseTransmission { - public static final String JSON_PROPERTY_RECIPIENT = "recipient"; - @javax.annotation.Nonnull private String recipient; - - /** Fax Transmission Status Code */ - public enum StatusCodeEnum { - SUCCESS(String.valueOf("success")), - - TRANSMITTING(String.valueOf("transmitting")), - - ERROR_COULD_NOT_FAX(String.valueOf("error_could_not_fax")), - - ERROR_UNKNOWN(String.valueOf("error_unknown")), - - ERROR_BUSY(String.valueOf("error_busy")), - - ERROR_NO_ANSWER(String.valueOf("error_no_answer")), - - ERROR_DISCONNECTED(String.valueOf("error_disconnected")), - - ERROR_BAD_DESTINATION(String.valueOf("error_bad_destination")); - - private String value; - - StatusCodeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusCodeEnum fromValue(String value) { - for (StatusCodeEnum b : StatusCodeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_STATUS_CODE = "status_code"; - @javax.annotation.Nonnull private StatusCodeEnum statusCode; - - public static final String JSON_PROPERTY_SENT_AT = "sent_at"; - @javax.annotation.Nullable private Integer sentAt; - - public FaxResponseTransmission() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxResponseTransmission init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxResponseTransmission.class); - } - - public static FaxResponseTransmission init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), FaxResponseTransmission.class); + public static final String JSON_PROPERTY_RECIPIENT = "recipient"; + @javax.annotation.Nonnull + private String recipient; + + /** + * Fax Transmission Status Code + */ + public enum StatusCodeEnum { + SUCCESS(String.valueOf("success")), + + TRANSMITTING(String.valueOf("transmitting")), + + ERROR_COULD_NOT_FAX(String.valueOf("error_could_not_fax")), + + ERROR_UNKNOWN(String.valueOf("error_unknown")), + + ERROR_BUSY(String.valueOf("error_busy")), + + ERROR_NO_ANSWER(String.valueOf("error_no_answer")), + + ERROR_DISCONNECTED(String.valueOf("error_disconnected")), + + ERROR_BAD_DESTINATION(String.valueOf("error_bad_destination")); + + private String value; + + StatusCodeEnum(String value) { + this.value = value; } - public FaxResponseTransmission recipient(@javax.annotation.Nonnull String recipient) { - this.recipient = recipient; - return this; + @JsonValue + public String getValue() { + return value; } - /** - * Fax Transmission Recipient - * - * @return recipient - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_RECIPIENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRecipient() { - return recipient; - } - - @JsonProperty(JSON_PROPERTY_RECIPIENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRecipient(@javax.annotation.Nonnull String recipient) { - this.recipient = recipient; - } - - public FaxResponseTransmission statusCode(@javax.annotation.Nonnull StatusCodeEnum statusCode) { - this.statusCode = statusCode; - return this; - } - - /** - * Fax Transmission Status Code - * - * @return statusCode - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_STATUS_CODE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public StatusCodeEnum getStatusCode() { - return statusCode; + @Override + public String toString() { + return String.valueOf(value); } - @JsonProperty(JSON_PROPERTY_STATUS_CODE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setStatusCode(@javax.annotation.Nonnull StatusCodeEnum statusCode) { - this.statusCode = statusCode; + @JsonCreator + public static StatusCodeEnum fromValue(String value) { + for (StatusCodeEnum b : StatusCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - public FaxResponseTransmission sentAt(@javax.annotation.Nullable Integer sentAt) { - this.sentAt = sentAt; - return this; + } + + public static final String JSON_PROPERTY_STATUS_CODE = "status_code"; + @javax.annotation.Nonnull + private StatusCodeEnum statusCode; + + public static final String JSON_PROPERTY_SENT_AT = "sent_at"; + @javax.annotation.Nullable + private Integer sentAt; + + public FaxResponseTransmission() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxResponseTransmission init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxResponseTransmission.class); + } + + static public FaxResponseTransmission init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxResponseTransmission.class + ); + } + + public FaxResponseTransmission recipient(@javax.annotation.Nonnull String recipient) { + this.recipient = recipient; + return this; + } + + /** + * Fax Transmission Recipient + * @return recipient + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRecipient() { + return recipient; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipient(@javax.annotation.Nonnull String recipient) { + this.recipient = recipient; + } + + + public FaxResponseTransmission statusCode(@javax.annotation.Nonnull StatusCodeEnum statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Fax Transmission Status Code + * @return statusCode + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StatusCodeEnum getStatusCode() { + return statusCode; + } + + + @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStatusCode(@javax.annotation.Nonnull StatusCodeEnum statusCode) { + this.statusCode = statusCode; + } + + + public FaxResponseTransmission sentAt(@javax.annotation.Nullable Integer sentAt) { + this.sentAt = sentAt; + return this; + } + + /** + * Fax Transmission Sent Timestamp + * @return sentAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENT_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSentAt() { + return sentAt; + } + + + @JsonProperty(JSON_PROPERTY_SENT_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSentAt(@javax.annotation.Nullable Integer sentAt) { + this.sentAt = sentAt; + } + + + /** + * Return true if this FaxResponseTransmission object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * Fax Transmission Sent Timestamp - * - * @return sentAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SENT_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getSentAt() { - return sentAt; + if (o == null || getClass() != o.getClass()) { + return false; } + FaxResponseTransmission faxResponseTransmission = (FaxResponseTransmission) o; + return Objects.equals(this.recipient, faxResponseTransmission.recipient) && + Objects.equals(this.statusCode, faxResponseTransmission.statusCode) && + Objects.equals(this.sentAt, faxResponseTransmission.sentAt); + } + + @Override + public int hashCode() { + return Objects.hash(recipient, statusCode, sentAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxResponseTransmission {\n"); + sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" sentAt: ").append(toIndentedString(sentAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (recipient != null) { + if (isFileTypeOrListOfFiles(recipient)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SENT_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSentAt(@javax.annotation.Nullable Integer sentAt) { - this.sentAt = sentAt; + if (recipient.getClass().equals(java.io.File.class) || + recipient.getClass().equals(Integer.class) || + recipient.getClass().equals(String.class) || + recipient.getClass().isEnum()) { + map.put("recipient", recipient); + } else if (isListOfFile(recipient)) { + for(int i = 0; i< getListSize(recipient); i++) { + map.put("recipient[" + i + "]", getFromList(recipient, i)); + } + } + else { + map.put("recipient", JSON.getDefault().getMapper().writeValueAsString(recipient)); + } } + if (statusCode != null) { + if (isFileTypeOrListOfFiles(statusCode)) { + fileTypeFound = true; + } - /** Return true if this FaxResponseTransmission object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (statusCode.getClass().equals(java.io.File.class) || + statusCode.getClass().equals(Integer.class) || + statusCode.getClass().equals(String.class) || + statusCode.getClass().isEnum()) { + map.put("status_code", statusCode); + } else if (isListOfFile(statusCode)) { + for(int i = 0; i< getListSize(statusCode); i++) { + map.put("status_code[" + i + "]", getFromList(statusCode, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("status_code", JSON.getDefault().getMapper().writeValueAsString(statusCode)); } - FaxResponseTransmission faxResponseTransmission = (FaxResponseTransmission) o; - return Objects.equals(this.recipient, faxResponseTransmission.recipient) - && Objects.equals(this.statusCode, faxResponseTransmission.statusCode) - && Objects.equals(this.sentAt, faxResponseTransmission.sentAt); } + if (sentAt != null) { + if (isFileTypeOrListOfFiles(sentAt)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(recipient, statusCode, sentAt); + if (sentAt.getClass().equals(java.io.File.class) || + sentAt.getClass().equals(Integer.class) || + sentAt.getClass().equals(String.class) || + sentAt.getClass().isEnum()) { + map.put("sent_at", sentAt); + } else if (isListOfFile(sentAt)) { + for(int i = 0; i< getListSize(sentAt); i++) { + map.put("sent_at[" + i + "]", getFromList(sentAt, i)); + } + } + else { + map.put("sent_at", JSON.getDefault().getMapper().writeValueAsString(sentAt)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxResponseTransmission {\n"); - sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n"); - sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); - sb.append(" sentAt: ").append(toIndentedString(sentAt)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (recipient != null) { - if (isFileTypeOrListOfFiles(recipient)) { - fileTypeFound = true; - } - - if (recipient.getClass().equals(java.io.File.class) - || recipient.getClass().equals(Integer.class) - || recipient.getClass().equals(String.class) - || recipient.getClass().isEnum()) { - map.put("recipient", recipient); - } else if (isListOfFile(recipient)) { - for (int i = 0; i < getListSize(recipient); i++) { - map.put("recipient[" + i + "]", getFromList(recipient, i)); - } - } else { - map.put( - "recipient", - JSON.getDefault().getMapper().writeValueAsString(recipient)); - } - } - if (statusCode != null) { - if (isFileTypeOrListOfFiles(statusCode)) { - fileTypeFound = true; - } - - if (statusCode.getClass().equals(java.io.File.class) - || statusCode.getClass().equals(Integer.class) - || statusCode.getClass().equals(String.class) - || statusCode.getClass().isEnum()) { - map.put("status_code", statusCode); - } else if (isListOfFile(statusCode)) { - for (int i = 0; i < getListSize(statusCode); i++) { - map.put("status_code[" + i + "]", getFromList(statusCode, i)); - } - } else { - map.put( - "status_code", - JSON.getDefault().getMapper().writeValueAsString(statusCode)); - } - } - if (sentAt != null) { - if (isFileTypeOrListOfFiles(sentAt)) { - fileTypeFound = true; - } - - if (sentAt.getClass().equals(java.io.File.class) - || sentAt.getClass().equals(Integer.class) - || sentAt.getClass().equals(String.class) - || sentAt.getClass().isEnum()) { - map.put("sent_at", sentAt); - } else if (isListOfFile(sentAt)) { - for (int i = 0; i < getListSize(sentAt); i++) { - map.put("sent_at[" + i + "]", getFromList(sentAt, i)); - } - } else { - map.put("sent_at", JSON.getDefault().getMapper().writeValueAsString(sentAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxSendRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxSendRequest.java index 27975b0d3..fb1beb143 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxSendRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxSendRequest.java @@ -10,569 +10,597 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** FaxSendRequest */ + +import com.dropbox.sign.ApiException; +/** + * FaxSendRequest + */ @JsonPropertyOrder({ - FaxSendRequest.JSON_PROPERTY_RECIPIENT, - FaxSendRequest.JSON_PROPERTY_SENDER, - FaxSendRequest.JSON_PROPERTY_FILES, - FaxSendRequest.JSON_PROPERTY_FILE_URLS, - FaxSendRequest.JSON_PROPERTY_TEST_MODE, - FaxSendRequest.JSON_PROPERTY_COVER_PAGE_TO, - FaxSendRequest.JSON_PROPERTY_COVER_PAGE_FROM, - FaxSendRequest.JSON_PROPERTY_COVER_PAGE_MESSAGE, - FaxSendRequest.JSON_PROPERTY_TITLE + FaxSendRequest.JSON_PROPERTY_RECIPIENT, + FaxSendRequest.JSON_PROPERTY_SENDER, + FaxSendRequest.JSON_PROPERTY_FILES, + FaxSendRequest.JSON_PROPERTY_FILE_URLS, + FaxSendRequest.JSON_PROPERTY_TEST_MODE, + FaxSendRequest.JSON_PROPERTY_COVER_PAGE_TO, + FaxSendRequest.JSON_PROPERTY_COVER_PAGE_FROM, + FaxSendRequest.JSON_PROPERTY_COVER_PAGE_MESSAGE, + FaxSendRequest.JSON_PROPERTY_TITLE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class FaxSendRequest { - public static final String JSON_PROPERTY_RECIPIENT = "recipient"; - @javax.annotation.Nonnull private String recipient; - - public static final String JSON_PROPERTY_SENDER = "sender"; - @javax.annotation.Nullable private String sender; - - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; - - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_COVER_PAGE_TO = "cover_page_to"; - @javax.annotation.Nullable private String coverPageTo; + public static final String JSON_PROPERTY_RECIPIENT = "recipient"; + @javax.annotation.Nonnull + private String recipient; + + public static final String JSON_PROPERTY_SENDER = "sender"; + @javax.annotation.Nullable + private String sender; + + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_COVER_PAGE_TO = "cover_page_to"; + @javax.annotation.Nullable + private String coverPageTo; + + public static final String JSON_PROPERTY_COVER_PAGE_FROM = "cover_page_from"; + @javax.annotation.Nullable + private String coverPageFrom; + + public static final String JSON_PROPERTY_COVER_PAGE_MESSAGE = "cover_page_message"; + @javax.annotation.Nullable + private String coverPageMessage; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public FaxSendRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxSendRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxSendRequest.class); + } + + static public FaxSendRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxSendRequest.class + ); + } + + public FaxSendRequest recipient(@javax.annotation.Nonnull String recipient) { + this.recipient = recipient; + return this; + } + + /** + * Recipient of the fax Can be a phone number in E.164 format or email address + * @return recipient + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRecipient() { + return recipient; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRecipient(@javax.annotation.Nonnull String recipient) { + this.recipient = recipient; + } + + + public FaxSendRequest sender(@javax.annotation.Nullable String sender) { + this.sender = sender; + return this; + } + + /** + * Fax Send From Sender (used only with fax number) + * @return sender + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSender() { + return sender; + } + + + @JsonProperty(JSON_PROPERTY_SENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSender(@javax.annotation.Nullable String sender) { + this.sender = sender; + } + + + public FaxSendRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public FaxSendRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public FaxSendRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public FaxSendRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Fax download the file(s) to fax This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public FaxSendRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * API Test Mode Setting + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } - public static final String JSON_PROPERTY_COVER_PAGE_FROM = "cover_page_from"; - @javax.annotation.Nullable private String coverPageFrom; - public static final String JSON_PROPERTY_COVER_PAGE_MESSAGE = "cover_page_message"; - @javax.annotation.Nullable private String coverPageMessage; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public FaxSendRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FaxSendRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FaxSendRequest.class); - } - - public static FaxSendRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), FaxSendRequest.class); - } - - public FaxSendRequest recipient(@javax.annotation.Nonnull String recipient) { - this.recipient = recipient; - return this; - } - - /** - * Recipient of the fax Can be a phone number in E.164 format or email address - * - * @return recipient - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_RECIPIENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRecipient() { - return recipient; - } - - @JsonProperty(JSON_PROPERTY_RECIPIENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRecipient(@javax.annotation.Nonnull String recipient) { - this.recipient = recipient; - } - - public FaxSendRequest sender(@javax.annotation.Nullable String sender) { - this.sender = sender; - return this; - } - - /** - * Fax Send From Sender (used only with fax number) - * - * @return sender - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SENDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSender() { - return sender; - } - - @JsonProperty(JSON_PROPERTY_SENDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSender(@javax.annotation.Nullable String sender) { - this.sender = sender; - } - - public FaxSendRequest files(@javax.annotation.Nullable List files) { - this.files = files; - return this; - } - - public FaxSendRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + public FaxSendRequest coverPageTo(@javax.annotation.Nullable String coverPageTo) { + this.coverPageTo = coverPageTo; + return this; + } + + /** + * Fax cover page recipient information + * @return coverPageTo + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COVER_PAGE_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCoverPageTo() { + return coverPageTo; + } + + + @JsonProperty(JSON_PROPERTY_COVER_PAGE_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCoverPageTo(@javax.annotation.Nullable String coverPageTo) { + this.coverPageTo = coverPageTo; + } + + + public FaxSendRequest coverPageFrom(@javax.annotation.Nullable String coverPageFrom) { + this.coverPageFrom = coverPageFrom; + return this; + } + + /** + * Fax cover page sender information + * @return coverPageFrom + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COVER_PAGE_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCoverPageFrom() { + return coverPageFrom; + } + + + @JsonProperty(JSON_PROPERTY_COVER_PAGE_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCoverPageFrom(@javax.annotation.Nullable String coverPageFrom) { + this.coverPageFrom = coverPageFrom; + } + + + public FaxSendRequest coverPageMessage(@javax.annotation.Nullable String coverPageMessage) { + this.coverPageMessage = coverPageMessage; + return this; + } + + /** + * Fax Cover Page Message + * @return coverPageMessage + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COVER_PAGE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCoverPageMessage() { + return coverPageMessage; + } + + + @JsonProperty(JSON_PROPERTY_COVER_PAGE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCoverPageMessage(@javax.annotation.Nullable String coverPageMessage) { + this.coverPageMessage = coverPageMessage; + } + + + public FaxSendRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Fax Title + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + /** + * Return true if this FaxSendRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxSendRequest faxSendRequest = (FaxSendRequest) o; + return Objects.equals(this.recipient, faxSendRequest.recipient) && + Objects.equals(this.sender, faxSendRequest.sender) && + Objects.equals(this.files, faxSendRequest.files) && + Objects.equals(this.fileUrls, faxSendRequest.fileUrls) && + Objects.equals(this.testMode, faxSendRequest.testMode) && + Objects.equals(this.coverPageTo, faxSendRequest.coverPageTo) && + Objects.equals(this.coverPageFrom, faxSendRequest.coverPageFrom) && + Objects.equals(this.coverPageMessage, faxSendRequest.coverPageMessage) && + Objects.equals(this.title, faxSendRequest.title); + } + + @Override + public int hashCode() { + return Objects.hash(recipient, sender, files, fileUrls, testMode, coverPageTo, coverPageFrom, coverPageMessage, title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxSendRequest {\n"); + sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n"); + sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" coverPageTo: ").append(toIndentedString(coverPageTo)).append("\n"); + sb.append(" coverPageFrom: ").append(toIndentedString(coverPageFrom)).append("\n"); + sb.append(" coverPageMessage: ").append(toIndentedString(coverPageMessage)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (recipient != null) { + if (isFileTypeOrListOfFiles(recipient)) { + fileTypeFound = true; } - this.files.add(filesItem); - return this; - } - - /** - * Use `files[]` to indicate the uploaded file(s) to fax This endpoint requires either - * **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } - - public FaxSendRequest fileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public FaxSendRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + if (recipient.getClass().equals(java.io.File.class) || + recipient.getClass().equals(Integer.class) || + recipient.getClass().equals(String.class) || + recipient.getClass().isEnum()) { + map.put("recipient", recipient); + } else if (isListOfFile(recipient)) { + for(int i = 0; i< getListSize(recipient); i++) { + map.put("recipient[" + i + "]", getFromList(recipient, i)); + } + } + else { + map.put("recipient", JSON.getDefault().getMapper().writeValueAsString(recipient)); } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use `file_urls[]` to have Dropbox Fax download the file(s) to fax This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - public FaxSendRequest testMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; - } - - /** - * API Test Mode Setting - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; - } - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - } - - public FaxSendRequest coverPageTo(@javax.annotation.Nullable String coverPageTo) { - this.coverPageTo = coverPageTo; - return this; - } - - /** - * Fax cover page recipient information - * - * @return coverPageTo - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COVER_PAGE_TO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCoverPageTo() { - return coverPageTo; - } - - @JsonProperty(JSON_PROPERTY_COVER_PAGE_TO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCoverPageTo(@javax.annotation.Nullable String coverPageTo) { - this.coverPageTo = coverPageTo; - } - - public FaxSendRequest coverPageFrom(@javax.annotation.Nullable String coverPageFrom) { - this.coverPageFrom = coverPageFrom; - return this; - } - - /** - * Fax cover page sender information - * - * @return coverPageFrom - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COVER_PAGE_FROM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCoverPageFrom() { - return coverPageFrom; - } - - @JsonProperty(JSON_PROPERTY_COVER_PAGE_FROM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCoverPageFrom(@javax.annotation.Nullable String coverPageFrom) { - this.coverPageFrom = coverPageFrom; } + if (sender != null) { + if (isFileTypeOrListOfFiles(sender)) { + fileTypeFound = true; + } - public FaxSendRequest coverPageMessage(@javax.annotation.Nullable String coverPageMessage) { - this.coverPageMessage = coverPageMessage; - return this; + if (sender.getClass().equals(java.io.File.class) || + sender.getClass().equals(Integer.class) || + sender.getClass().equals(String.class) || + sender.getClass().isEnum()) { + map.put("sender", sender); + } else if (isListOfFile(sender)) { + for(int i = 0; i< getListSize(sender); i++) { + map.put("sender[" + i + "]", getFromList(sender, i)); + } + } + else { + map.put("sender", JSON.getDefault().getMapper().writeValueAsString(sender)); + } } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } - /** - * Fax Cover Page Message - * - * @return coverPageMessage - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_COVER_PAGE_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCoverPageMessage() { - return coverPageMessage; + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_COVER_PAGE_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCoverPageMessage(@javax.annotation.Nullable String coverPageMessage) { - this.coverPageMessage = coverPageMessage; + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - public FaxSendRequest title(@javax.annotation.Nullable String title) { - this.title = title; - return this; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (coverPageTo != null) { + if (isFileTypeOrListOfFiles(coverPageTo)) { + fileTypeFound = true; + } - /** - * Fax Title - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (coverPageTo.getClass().equals(java.io.File.class) || + coverPageTo.getClass().equals(Integer.class) || + coverPageTo.getClass().equals(String.class) || + coverPageTo.getClass().isEnum()) { + map.put("cover_page_to", coverPageTo); + } else if (isListOfFile(coverPageTo)) { + for(int i = 0; i< getListSize(coverPageTo); i++) { + map.put("cover_page_to[" + i + "]", getFromList(coverPageTo, i)); + } + } + else { + map.put("cover_page_to", JSON.getDefault().getMapper().writeValueAsString(coverPageTo)); + } } + if (coverPageFrom != null) { + if (isFileTypeOrListOfFiles(coverPageFrom)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (coverPageFrom.getClass().equals(java.io.File.class) || + coverPageFrom.getClass().equals(Integer.class) || + coverPageFrom.getClass().equals(String.class) || + coverPageFrom.getClass().isEnum()) { + map.put("cover_page_from", coverPageFrom); + } else if (isListOfFile(coverPageFrom)) { + for(int i = 0; i< getListSize(coverPageFrom); i++) { + map.put("cover_page_from[" + i + "]", getFromList(coverPageFrom, i)); + } + } + else { + map.put("cover_page_from", JSON.getDefault().getMapper().writeValueAsString(coverPageFrom)); + } } + if (coverPageMessage != null) { + if (isFileTypeOrListOfFiles(coverPageMessage)) { + fileTypeFound = true; + } - /** Return true if this FaxSendRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (coverPageMessage.getClass().equals(java.io.File.class) || + coverPageMessage.getClass().equals(Integer.class) || + coverPageMessage.getClass().equals(String.class) || + coverPageMessage.getClass().isEnum()) { + map.put("cover_page_message", coverPageMessage); + } else if (isListOfFile(coverPageMessage)) { + for(int i = 0; i< getListSize(coverPageMessage); i++) { + map.put("cover_page_message[" + i + "]", getFromList(coverPageMessage, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("cover_page_message", JSON.getDefault().getMapper().writeValueAsString(coverPageMessage)); } - FaxSendRequest faxSendRequest = (FaxSendRequest) o; - return Objects.equals(this.recipient, faxSendRequest.recipient) - && Objects.equals(this.sender, faxSendRequest.sender) - && Objects.equals(this.files, faxSendRequest.files) - && Objects.equals(this.fileUrls, faxSendRequest.fileUrls) - && Objects.equals(this.testMode, faxSendRequest.testMode) - && Objects.equals(this.coverPageTo, faxSendRequest.coverPageTo) - && Objects.equals(this.coverPageFrom, faxSendRequest.coverPageFrom) - && Objects.equals(this.coverPageMessage, faxSendRequest.coverPageMessage) - && Objects.equals(this.title, faxSendRequest.title); } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - recipient, - sender, - files, - fileUrls, - testMode, - coverPageTo, - coverPageFrom, - coverPageMessage, - title); + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FaxSendRequest {\n"); - sb.append(" recipient: ").append(toIndentedString(recipient)).append("\n"); - sb.append(" sender: ").append(toIndentedString(sender)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" coverPageTo: ").append(toIndentedString(coverPageTo)).append("\n"); - sb.append(" coverPageFrom: ").append(toIndentedString(coverPageFrom)).append("\n"); - sb.append(" coverPageMessage: ").append(toIndentedString(coverPageMessage)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (recipient != null) { - if (isFileTypeOrListOfFiles(recipient)) { - fileTypeFound = true; - } - - if (recipient.getClass().equals(java.io.File.class) - || recipient.getClass().equals(Integer.class) - || recipient.getClass().equals(String.class) - || recipient.getClass().isEnum()) { - map.put("recipient", recipient); - } else if (isListOfFile(recipient)) { - for (int i = 0; i < getListSize(recipient); i++) { - map.put("recipient[" + i + "]", getFromList(recipient, i)); - } - } else { - map.put( - "recipient", - JSON.getDefault().getMapper().writeValueAsString(recipient)); - } - } - if (sender != null) { - if (isFileTypeOrListOfFiles(sender)) { - fileTypeFound = true; - } - - if (sender.getClass().equals(java.io.File.class) - || sender.getClass().equals(Integer.class) - || sender.getClass().equals(String.class) - || sender.getClass().isEnum()) { - map.put("sender", sender); - } else if (isListOfFile(sender)) { - for (int i = 0; i < getListSize(sender); i++) { - map.put("sender[" + i + "]", getFromList(sender, i)); - } - } else { - map.put("sender", JSON.getDefault().getMapper().writeValueAsString(sender)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (coverPageTo != null) { - if (isFileTypeOrListOfFiles(coverPageTo)) { - fileTypeFound = true; - } - - if (coverPageTo.getClass().equals(java.io.File.class) - || coverPageTo.getClass().equals(Integer.class) - || coverPageTo.getClass().equals(String.class) - || coverPageTo.getClass().isEnum()) { - map.put("cover_page_to", coverPageTo); - } else if (isListOfFile(coverPageTo)) { - for (int i = 0; i < getListSize(coverPageTo); i++) { - map.put("cover_page_to[" + i + "]", getFromList(coverPageTo, i)); - } - } else { - map.put( - "cover_page_to", - JSON.getDefault().getMapper().writeValueAsString(coverPageTo)); - } - } - if (coverPageFrom != null) { - if (isFileTypeOrListOfFiles(coverPageFrom)) { - fileTypeFound = true; - } - - if (coverPageFrom.getClass().equals(java.io.File.class) - || coverPageFrom.getClass().equals(Integer.class) - || coverPageFrom.getClass().equals(String.class) - || coverPageFrom.getClass().isEnum()) { - map.put("cover_page_from", coverPageFrom); - } else if (isListOfFile(coverPageFrom)) { - for (int i = 0; i < getListSize(coverPageFrom); i++) { - map.put("cover_page_from[" + i + "]", getFromList(coverPageFrom, i)); - } - } else { - map.put( - "cover_page_from", - JSON.getDefault().getMapper().writeValueAsString(coverPageFrom)); - } - } - if (coverPageMessage != null) { - if (isFileTypeOrListOfFiles(coverPageMessage)) { - fileTypeFound = true; - } - - if (coverPageMessage.getClass().equals(java.io.File.class) - || coverPageMessage.getClass().equals(Integer.class) - || coverPageMessage.getClass().equals(String.class) - || coverPageMessage.getClass().isEnum()) { - map.put("cover_page_message", coverPageMessage); - } else if (isListOfFile(coverPageMessage)) { - for (int i = 0; i < getListSize(coverPageMessage); i++) { - map.put("cover_page_message[" + i + "]", getFromList(coverPageMessage, i)); - } - } else { - map.put( - "cover_page_message", - JSON.getDefault().getMapper().writeValueAsString(coverPageMessage)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponse.java index c03740895..3edbb8f38 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponse.java @@ -10,205 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** FileResponse */ -@JsonPropertyOrder({FileResponse.JSON_PROPERTY_FILE_URL, FileResponse.JSON_PROPERTY_EXPIRES_AT}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class FileResponse { - public static final String JSON_PROPERTY_FILE_URL = "file_url"; - @javax.annotation.Nonnull private String fileUrl; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nonnull private Integer expiresAt; - public FileResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FileResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FileResponse.class); - } - public static FileResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), FileResponse.class); - } - - public FileResponse fileUrl(@javax.annotation.Nonnull String fileUrl) { - this.fileUrl = fileUrl; - return this; - } - - /** - * URL to the file. - * - * @return fileUrl - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FILE_URL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getFileUrl() { - return fileUrl; - } - - @JsonProperty(JSON_PROPERTY_FILE_URL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFileUrl(@javax.annotation.Nonnull String fileUrl) { - this.fileUrl = fileUrl; - } - - public FileResponse expiresAt(@javax.annotation.Nonnull Integer expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * When the link expires. - * - * @return expiresAt - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getExpiresAt() { - return expiresAt; - } +import com.dropbox.sign.ApiException; +/** + * FileResponse + */ +@JsonPropertyOrder({ + FileResponse.JSON_PROPERTY_FILE_URL, + FileResponse.JSON_PROPERTY_EXPIRES_AT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FileResponse { + public static final String JSON_PROPERTY_FILE_URL = "file_url"; + @javax.annotation.Nonnull + private String fileUrl; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nonnull + private Integer expiresAt; + + public FileResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FileResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FileResponse.class); + } + + static public FileResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FileResponse.class + ); + } + + public FileResponse fileUrl(@javax.annotation.Nonnull String fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + /** + * URL to the file. + * @return fileUrl + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFileUrl() { + return fileUrl; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFileUrl(@javax.annotation.Nonnull String fileUrl) { + this.fileUrl = fileUrl; + } + + + public FileResponse expiresAt(@javax.annotation.Nonnull Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the link expires. + * @return expiresAt + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setExpiresAt(@javax.annotation.Nonnull Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this FileResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileResponse fileResponse = (FileResponse) o; + return Objects.equals(this.fileUrl, fileResponse.fileUrl) && + Objects.equals(this.expiresAt, fileResponse.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(fileUrl, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileResponse {\n"); + sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (fileUrl != null) { + if (isFileTypeOrListOfFiles(fileUrl)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setExpiresAt(@javax.annotation.Nonnull Integer expiresAt) { - this.expiresAt = expiresAt; + if (fileUrl.getClass().equals(java.io.File.class) || + fileUrl.getClass().equals(Integer.class) || + fileUrl.getClass().equals(String.class) || + fileUrl.getClass().isEnum()) { + map.put("file_url", fileUrl); + } else if (isListOfFile(fileUrl)) { + for(int i = 0; i< getListSize(fileUrl); i++) { + map.put("file_url[" + i + "]", getFromList(fileUrl, i)); + } + } + else { + map.put("file_url", JSON.getDefault().getMapper().writeValueAsString(fileUrl)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - /** Return true if this FileResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); } - FileResponse fileResponse = (FileResponse) o; - return Objects.equals(this.fileUrl, fileResponse.fileUrl) - && Objects.equals(this.expiresAt, fileResponse.expiresAt); } - - @Override - public int hashCode() { - return Objects.hash(fileUrl, expiresAt); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileResponse {\n"); - sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (fileUrl != null) { - if (isFileTypeOrListOfFiles(fileUrl)) { - fileTypeFound = true; - } - - if (fileUrl.getClass().equals(java.io.File.class) - || fileUrl.getClass().equals(Integer.class) - || fileUrl.getClass().equals(String.class) - || fileUrl.getClass().isEnum()) { - map.put("file_url", fileUrl); - } else if (isListOfFile(fileUrl)) { - for (int i = 0; i < getListSize(fileUrl); i++) { - map.put("file_url[" + i + "]", getFromList(fileUrl, i)); - } - } else { - map.put("file_url", JSON.getDefault().getMapper().writeValueAsString(fileUrl)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java index 2a27822eb..9a52fdc72 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java @@ -10,157 +10,170 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** FileResponseDataUri */ -@JsonPropertyOrder({FileResponseDataUri.JSON_PROPERTY_DATA_URI}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class FileResponseDataUri { - public static final String JSON_PROPERTY_DATA_URI = "data_uri"; - @javax.annotation.Nonnull private String dataUri; - - public FileResponseDataUri() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static FileResponseDataUri init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FileResponseDataUri.class); - } - public static FileResponseDataUri init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), FileResponseDataUri.class); - } - - public FileResponseDataUri dataUri(@javax.annotation.Nonnull String dataUri) { - this.dataUri = dataUri; - return this; - } - - /** - * File as base64 encoded string. - * - * @return dataUri - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_DATA_URI) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getDataUri() { - return dataUri; +import com.dropbox.sign.ApiException; +/** + * FileResponseDataUri + */ +@JsonPropertyOrder({ + FileResponseDataUri.JSON_PROPERTY_DATA_URI +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FileResponseDataUri { + public static final String JSON_PROPERTY_DATA_URI = "data_uri"; + @javax.annotation.Nonnull + private String dataUri; + + public FileResponseDataUri() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FileResponseDataUri init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FileResponseDataUri.class); + } + + static public FileResponseDataUri init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FileResponseDataUri.class + ); + } + + public FileResponseDataUri dataUri(@javax.annotation.Nonnull String dataUri) { + this.dataUri = dataUri; + return this; + } + + /** + * File as base64 encoded string. + * @return dataUri + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATA_URI) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getDataUri() { + return dataUri; + } + + + @JsonProperty(JSON_PROPERTY_DATA_URI) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDataUri(@javax.annotation.Nonnull String dataUri) { + this.dataUri = dataUri; + } + + + /** + * Return true if this FileResponseDataUri object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_DATA_URI) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDataUri(@javax.annotation.Nonnull String dataUri) { - this.dataUri = dataUri; + if (o == null || getClass() != o.getClass()) { + return false; } + FileResponseDataUri fileResponseDataUri = (FileResponseDataUri) o; + return Objects.equals(this.dataUri, fileResponseDataUri.dataUri); + } + + @Override + public int hashCode() { + return Objects.hash(dataUri); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileResponseDataUri {\n"); + sb.append(" dataUri: ").append(toIndentedString(dataUri)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (dataUri != null) { + if (isFileTypeOrListOfFiles(dataUri)) { + fileTypeFound = true; + } - /** Return true if this FileResponseDataUri object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (dataUri.getClass().equals(java.io.File.class) || + dataUri.getClass().equals(Integer.class) || + dataUri.getClass().equals(String.class) || + dataUri.getClass().isEnum()) { + map.put("data_uri", dataUri); + } else if (isListOfFile(dataUri)) { + for(int i = 0; i< getListSize(dataUri); i++) { + map.put("data_uri[" + i + "]", getFromList(dataUri, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("data_uri", JSON.getDefault().getMapper().writeValueAsString(dataUri)); } - FileResponseDataUri fileResponseDataUri = (FileResponseDataUri) o; - return Objects.equals(this.dataUri, fileResponseDataUri.dataUri); } - - @Override - public int hashCode() { - return Objects.hash(dataUri); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileResponseDataUri {\n"); - sb.append(" dataUri: ").append(toIndentedString(dataUri)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (dataUri != null) { - if (isFileTypeOrListOfFiles(dataUri)) { - fileTypeFound = true; - } - - if (dataUri.getClass().equals(java.io.File.class) - || dataUri.getClass().equals(Integer.class) - || dataUri.getClass().equals(String.class) - || dataUri.getClass().isEnum()) { - map.put("data_uri", dataUri); - } else if (isListOfFile(dataUri)) { - for (int i = 0; i < getListSize(dataUri); i++) { - map.put("data_uri[" + i + "]", getFromList(dataUri, i)); - } - } else { - map.put("data_uri", JSON.getDefault().getMapper().writeValueAsString(dataUri)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ListInfoResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ListInfoResponse.java index 3ed8ddfe5..9dbe846bd 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ListInfoResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ListInfoResponse.java @@ -10,302 +10,323 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** Contains pagination information about the data returned. */ + +import com.dropbox.sign.ApiException; +/** + * Contains pagination information about the data returned. + */ @JsonPropertyOrder({ - ListInfoResponse.JSON_PROPERTY_NUM_PAGES, - ListInfoResponse.JSON_PROPERTY_NUM_RESULTS, - ListInfoResponse.JSON_PROPERTY_PAGE, - ListInfoResponse.JSON_PROPERTY_PAGE_SIZE + ListInfoResponse.JSON_PROPERTY_NUM_PAGES, + ListInfoResponse.JSON_PROPERTY_NUM_RESULTS, + ListInfoResponse.JSON_PROPERTY_PAGE, + ListInfoResponse.JSON_PROPERTY_PAGE_SIZE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ListInfoResponse { - public static final String JSON_PROPERTY_NUM_PAGES = "num_pages"; - @javax.annotation.Nullable private Integer numPages; - - public static final String JSON_PROPERTY_NUM_RESULTS = "num_results"; - @javax.annotation.Nullable private Integer numResults; - - public static final String JSON_PROPERTY_PAGE = "page"; - @javax.annotation.Nullable private Integer page; - - public static final String JSON_PROPERTY_PAGE_SIZE = "page_size"; - @javax.annotation.Nullable private Integer pageSize; - - public ListInfoResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ListInfoResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ListInfoResponse.class); + public static final String JSON_PROPERTY_NUM_PAGES = "num_pages"; + @javax.annotation.Nullable + private Integer numPages; + + public static final String JSON_PROPERTY_NUM_RESULTS = "num_results"; + @javax.annotation.Nullable + private Integer numResults; + + public static final String JSON_PROPERTY_PAGE = "page"; + @javax.annotation.Nullable + private Integer page; + + public static final String JSON_PROPERTY_PAGE_SIZE = "page_size"; + @javax.annotation.Nullable + private Integer pageSize; + + public ListInfoResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ListInfoResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ListInfoResponse.class); + } + + static public ListInfoResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ListInfoResponse.class + ); + } + + public ListInfoResponse numPages(@javax.annotation.Nullable Integer numPages) { + this.numPages = numPages; + return this; + } + + /** + * Total number of pages available. + * @return numPages + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_PAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getNumPages() { + return numPages; + } + + + @JsonProperty(JSON_PROPERTY_NUM_PAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumPages(@javax.annotation.Nullable Integer numPages) { + this.numPages = numPages; + } + + + public ListInfoResponse numResults(@javax.annotation.Nullable Integer numResults) { + this.numResults = numResults; + return this; + } + + /** + * Total number of objects available. + * @return numResults + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_RESULTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getNumResults() { + return numResults; + } + + + @JsonProperty(JSON_PROPERTY_NUM_RESULTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumResults(@javax.annotation.Nullable Integer numResults) { + this.numResults = numResults; + } + + + public ListInfoResponse page(@javax.annotation.Nullable Integer page) { + this.page = page; + return this; + } + + /** + * Number of the page being returned. + * @return page + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getPage() { + return page; + } + + + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPage(@javax.annotation.Nullable Integer page) { + this.page = page; + } + + + public ListInfoResponse pageSize(@javax.annotation.Nullable Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Objects returned per page. + * @return pageSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getPageSize() { + return pageSize; + } + + + @JsonProperty(JSON_PROPERTY_PAGE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageSize(@javax.annotation.Nullable Integer pageSize) { + this.pageSize = pageSize; + } + + + /** + * Return true if this ListInfoResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public static ListInfoResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), ListInfoResponse.class); - } - - public ListInfoResponse numPages(@javax.annotation.Nullable Integer numPages) { - this.numPages = numPages; - return this; - } - - /** - * Total number of pages available. - * - * @return numPages - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_PAGES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getNumPages() { - return numPages; - } - - @JsonProperty(JSON_PROPERTY_NUM_PAGES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumPages(@javax.annotation.Nullable Integer numPages) { - this.numPages = numPages; - } - - public ListInfoResponse numResults(@javax.annotation.Nullable Integer numResults) { - this.numResults = numResults; - return this; - } - - /** - * Total number of objects available. - * - * @return numResults - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_RESULTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getNumResults() { - return numResults; - } - - @JsonProperty(JSON_PROPERTY_NUM_RESULTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumResults(@javax.annotation.Nullable Integer numResults) { - this.numResults = numResults; - } - - public ListInfoResponse page(@javax.annotation.Nullable Integer page) { - this.page = page; - return this; - } - - /** - * Number of the page being returned. - * - * @return page - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getPage() { - return page; - } - - @JsonProperty(JSON_PROPERTY_PAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPage(@javax.annotation.Nullable Integer page) { - this.page = page; - } - - public ListInfoResponse pageSize(@javax.annotation.Nullable Integer pageSize) { - this.pageSize = pageSize; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + ListInfoResponse listInfoResponse = (ListInfoResponse) o; + return Objects.equals(this.numPages, listInfoResponse.numPages) && + Objects.equals(this.numResults, listInfoResponse.numResults) && + Objects.equals(this.page, listInfoResponse.page) && + Objects.equals(this.pageSize, listInfoResponse.pageSize); + } + + @Override + public int hashCode() { + return Objects.hash(numPages, numResults, page, pageSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInfoResponse {\n"); + sb.append(" numPages: ").append(toIndentedString(numPages)).append("\n"); + sb.append(" numResults: ").append(toIndentedString(numResults)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (numPages != null) { + if (isFileTypeOrListOfFiles(numPages)) { + fileTypeFound = true; + } - /** - * Objects returned per page. - * - * @return pageSize - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PAGE_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getPageSize() { - return pageSize; + if (numPages.getClass().equals(java.io.File.class) || + numPages.getClass().equals(Integer.class) || + numPages.getClass().equals(String.class) || + numPages.getClass().isEnum()) { + map.put("num_pages", numPages); + } else if (isListOfFile(numPages)) { + for(int i = 0; i< getListSize(numPages); i++) { + map.put("num_pages[" + i + "]", getFromList(numPages, i)); + } + } + else { + map.put("num_pages", JSON.getDefault().getMapper().writeValueAsString(numPages)); + } } + if (numResults != null) { + if (isFileTypeOrListOfFiles(numResults)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_PAGE_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPageSize(@javax.annotation.Nullable Integer pageSize) { - this.pageSize = pageSize; + if (numResults.getClass().equals(java.io.File.class) || + numResults.getClass().equals(Integer.class) || + numResults.getClass().equals(String.class) || + numResults.getClass().isEnum()) { + map.put("num_results", numResults); + } else if (isListOfFile(numResults)) { + for(int i = 0; i< getListSize(numResults); i++) { + map.put("num_results[" + i + "]", getFromList(numResults, i)); + } + } + else { + map.put("num_results", JSON.getDefault().getMapper().writeValueAsString(numResults)); + } } + if (page != null) { + if (isFileTypeOrListOfFiles(page)) { + fileTypeFound = true; + } - /** Return true if this ListInfoResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (page.getClass().equals(java.io.File.class) || + page.getClass().equals(Integer.class) || + page.getClass().equals(String.class) || + page.getClass().isEnum()) { + map.put("page", page); + } else if (isListOfFile(page)) { + for(int i = 0; i< getListSize(page); i++) { + map.put("page[" + i + "]", getFromList(page, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("page", JSON.getDefault().getMapper().writeValueAsString(page)); } - ListInfoResponse listInfoResponse = (ListInfoResponse) o; - return Objects.equals(this.numPages, listInfoResponse.numPages) - && Objects.equals(this.numResults, listInfoResponse.numResults) - && Objects.equals(this.page, listInfoResponse.page) - && Objects.equals(this.pageSize, listInfoResponse.pageSize); } + if (pageSize != null) { + if (isFileTypeOrListOfFiles(pageSize)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(numPages, numResults, page, pageSize); + if (pageSize.getClass().equals(java.io.File.class) || + pageSize.getClass().equals(Integer.class) || + pageSize.getClass().equals(String.class) || + pageSize.getClass().isEnum()) { + map.put("page_size", pageSize); + } else if (isListOfFile(pageSize)) { + for(int i = 0; i< getListSize(pageSize); i++) { + map.put("page_size[" + i + "]", getFromList(pageSize, i)); + } + } + else { + map.put("page_size", JSON.getDefault().getMapper().writeValueAsString(pageSize)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListInfoResponse {\n"); - sb.append(" numPages: ").append(toIndentedString(numPages)).append("\n"); - sb.append(" numResults: ").append(toIndentedString(numResults)).append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (numPages != null) { - if (isFileTypeOrListOfFiles(numPages)) { - fileTypeFound = true; - } - - if (numPages.getClass().equals(java.io.File.class) - || numPages.getClass().equals(Integer.class) - || numPages.getClass().equals(String.class) - || numPages.getClass().isEnum()) { - map.put("num_pages", numPages); - } else if (isListOfFile(numPages)) { - for (int i = 0; i < getListSize(numPages); i++) { - map.put("num_pages[" + i + "]", getFromList(numPages, i)); - } - } else { - map.put( - "num_pages", - JSON.getDefault().getMapper().writeValueAsString(numPages)); - } - } - if (numResults != null) { - if (isFileTypeOrListOfFiles(numResults)) { - fileTypeFound = true; - } - - if (numResults.getClass().equals(java.io.File.class) - || numResults.getClass().equals(Integer.class) - || numResults.getClass().equals(String.class) - || numResults.getClass().isEnum()) { - map.put("num_results", numResults); - } else if (isListOfFile(numResults)) { - for (int i = 0; i < getListSize(numResults); i++) { - map.put("num_results[" + i + "]", getFromList(numResults, i)); - } - } else { - map.put( - "num_results", - JSON.getDefault().getMapper().writeValueAsString(numResults)); - } - } - if (page != null) { - if (isFileTypeOrListOfFiles(page)) { - fileTypeFound = true; - } - - if (page.getClass().equals(java.io.File.class) - || page.getClass().equals(Integer.class) - || page.getClass().equals(String.class) - || page.getClass().isEnum()) { - map.put("page", page); - } else if (isListOfFile(page)) { - for (int i = 0; i < getListSize(page); i++) { - map.put("page[" + i + "]", getFromList(page, i)); - } - } else { - map.put("page", JSON.getDefault().getMapper().writeValueAsString(page)); - } - } - if (pageSize != null) { - if (isFileTypeOrListOfFiles(pageSize)) { - fileTypeFound = true; - } - - if (pageSize.getClass().equals(java.io.File.class) - || pageSize.getClass().equals(Integer.class) - || pageSize.getClass().equals(String.class) - || pageSize.getClass().isEnum()) { - map.put("page_size", pageSize); - } else if (isListOfFile(pageSize)) { - for (int i = 0; i < getListSize(pageSize); i++) { - map.put("page_size[" + i + "]", getFromList(pageSize, i)); - } - } else { - map.put( - "page_size", - JSON.getDefault().getMapper().writeValueAsString(pageSize)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java index 5ef1cb685..038e2dc6c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java @@ -10,355 +10,374 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** OAuthTokenGenerateRequest */ + +import com.dropbox.sign.ApiException; +/** + * OAuthTokenGenerateRequest + */ @JsonPropertyOrder({ - OAuthTokenGenerateRequest.JSON_PROPERTY_CLIENT_ID, - OAuthTokenGenerateRequest.JSON_PROPERTY_CLIENT_SECRET, - OAuthTokenGenerateRequest.JSON_PROPERTY_CODE, - OAuthTokenGenerateRequest.JSON_PROPERTY_GRANT_TYPE, - OAuthTokenGenerateRequest.JSON_PROPERTY_STATE + OAuthTokenGenerateRequest.JSON_PROPERTY_CLIENT_ID, + OAuthTokenGenerateRequest.JSON_PROPERTY_CLIENT_SECRET, + OAuthTokenGenerateRequest.JSON_PROPERTY_CODE, + OAuthTokenGenerateRequest.JSON_PROPERTY_GRANT_TYPE, + OAuthTokenGenerateRequest.JSON_PROPERTY_STATE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class OAuthTokenGenerateRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nonnull private String clientId; - - public static final String JSON_PROPERTY_CLIENT_SECRET = "client_secret"; - @javax.annotation.Nonnull private String clientSecret; - - public static final String JSON_PROPERTY_CODE = "code"; - @javax.annotation.Nonnull private String code; - - public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; - @javax.annotation.Nonnull private String grantType = "authorization_code"; - - public static final String JSON_PROPERTY_STATE = "state"; - @javax.annotation.Nonnull private String state; - - public OAuthTokenGenerateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static OAuthTokenGenerateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, OAuthTokenGenerateRequest.class); - } - - public static OAuthTokenGenerateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - OAuthTokenGenerateRequest.class); - } - - public OAuthTokenGenerateRequest clientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - return this; - } - - /** - * The client id of the app requesting authorization. - * - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - } - - public OAuthTokenGenerateRequest clientSecret(@javax.annotation.Nonnull String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** - * The secret token of your app. - * - * @return clientSecret - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientSecret() { - return clientSecret; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientSecret(@javax.annotation.Nonnull String clientSecret) { - this.clientSecret = clientSecret; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nonnull + private String clientId; + + public static final String JSON_PROPERTY_CLIENT_SECRET = "client_secret"; + @javax.annotation.Nonnull + private String clientSecret; + + public static final String JSON_PROPERTY_CODE = "code"; + @javax.annotation.Nonnull + private String code; + + public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; + @javax.annotation.Nonnull + private String grantType = "authorization_code"; + + public static final String JSON_PROPERTY_STATE = "state"; + @javax.annotation.Nonnull + private String state; + + public OAuthTokenGenerateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public OAuthTokenGenerateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, OAuthTokenGenerateRequest.class); + } + + static public OAuthTokenGenerateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + OAuthTokenGenerateRequest.class + ); + } + + public OAuthTokenGenerateRequest clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client id of the app requesting authorization. + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OAuthTokenGenerateRequest clientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * The secret token of your app. + * @return clientSecret + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientSecret() { + return clientSecret; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OAuthTokenGenerateRequest code(@javax.annotation.Nonnull String code) { + this.code = code; + return this; + } + + /** + * The code passed to your callback when the user granted access. + * @return code + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCode() { + return code; + } + + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCode(@javax.annotation.Nonnull String code) { + this.code = code; + } + + + public OAuthTokenGenerateRequest grantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + return this; + } + + /** + * When generating a new token use `authorization_code`. + * @return grantType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GRANT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getGrantType() { + return grantType; + } + + + @JsonProperty(JSON_PROPERTY_GRANT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGrantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + } + + + public OAuthTokenGenerateRequest state(@javax.annotation.Nonnull String state) { + this.state = state; + return this; + } + + /** + * Same as the state you specified earlier. + * @return state + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getState() { + return state; + } + + + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setState(@javax.annotation.Nonnull String state) { + this.state = state; + } + + + /** + * Return true if this OAuthTokenGenerateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public OAuthTokenGenerateRequest code(@javax.annotation.Nonnull String code) { - this.code = code; - return this; - } - - /** - * The code passed to your callback when the user granted access. - * - * @return code - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CODE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getCode() { - return code; - } - - @JsonProperty(JSON_PROPERTY_CODE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setCode(@javax.annotation.Nonnull String code) { - this.code = code; - } - - public OAuthTokenGenerateRequest grantType(@javax.annotation.Nonnull String grantType) { - this.grantType = grantType; - return this; - } - - /** - * When generating a new token use `authorization_code`. - * - * @return grantType - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_GRANT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getGrantType() { - return grantType; - } - - @JsonProperty(JSON_PROPERTY_GRANT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGrantType(@javax.annotation.Nonnull String grantType) { - this.grantType = grantType; + if (o == null || getClass() != o.getClass()) { + return false; } + OAuthTokenGenerateRequest oauthTokenGenerateRequest = (OAuthTokenGenerateRequest) o; + return Objects.equals(this.clientId, oauthTokenGenerateRequest.clientId) && + Objects.equals(this.clientSecret, oauthTokenGenerateRequest.clientSecret) && + Objects.equals(this.code, oauthTokenGenerateRequest.code) && + Objects.equals(this.grantType, oauthTokenGenerateRequest.grantType) && + Objects.equals(this.state, oauthTokenGenerateRequest.state); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, code, grantType, state); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthTokenGenerateRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } - public OAuthTokenGenerateRequest state(@javax.annotation.Nonnull String state) { - this.state = state; - return this; + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } } + if (clientSecret != null) { + if (isFileTypeOrListOfFiles(clientSecret)) { + fileTypeFound = true; + } - /** - * Same as the state you specified earlier. - * - * @return state - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_STATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getState() { - return state; + if (clientSecret.getClass().equals(java.io.File.class) || + clientSecret.getClass().equals(Integer.class) || + clientSecret.getClass().equals(String.class) || + clientSecret.getClass().isEnum()) { + map.put("client_secret", clientSecret); + } else if (isListOfFile(clientSecret)) { + for(int i = 0; i< getListSize(clientSecret); i++) { + map.put("client_secret[" + i + "]", getFromList(clientSecret, i)); + } + } + else { + map.put("client_secret", JSON.getDefault().getMapper().writeValueAsString(clientSecret)); + } } + if (code != null) { + if (isFileTypeOrListOfFiles(code)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_STATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setState(@javax.annotation.Nonnull String state) { - this.state = state; + if (code.getClass().equals(java.io.File.class) || + code.getClass().equals(Integer.class) || + code.getClass().equals(String.class) || + code.getClass().isEnum()) { + map.put("code", code); + } else if (isListOfFile(code)) { + for(int i = 0; i< getListSize(code); i++) { + map.put("code[" + i + "]", getFromList(code, i)); + } + } + else { + map.put("code", JSON.getDefault().getMapper().writeValueAsString(code)); + } } + if (grantType != null) { + if (isFileTypeOrListOfFiles(grantType)) { + fileTypeFound = true; + } - /** Return true if this OAuthTokenGenerateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (grantType.getClass().equals(java.io.File.class) || + grantType.getClass().equals(Integer.class) || + grantType.getClass().equals(String.class) || + grantType.getClass().isEnum()) { + map.put("grant_type", grantType); + } else if (isListOfFile(grantType)) { + for(int i = 0; i< getListSize(grantType); i++) { + map.put("grant_type[" + i + "]", getFromList(grantType, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("grant_type", JSON.getDefault().getMapper().writeValueAsString(grantType)); } - OAuthTokenGenerateRequest oauthTokenGenerateRequest = (OAuthTokenGenerateRequest) o; - return Objects.equals(this.clientId, oauthTokenGenerateRequest.clientId) - && Objects.equals(this.clientSecret, oauthTokenGenerateRequest.clientSecret) - && Objects.equals(this.code, oauthTokenGenerateRequest.code) - && Objects.equals(this.grantType, oauthTokenGenerateRequest.grantType) - && Objects.equals(this.state, oauthTokenGenerateRequest.state); } + if (state != null) { + if (isFileTypeOrListOfFiles(state)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(clientId, clientSecret, code, grantType, state); + if (state.getClass().equals(java.io.File.class) || + state.getClass().equals(Integer.class) || + state.getClass().equals(String.class) || + state.getClass().isEnum()) { + map.put("state", state); + } else if (isListOfFile(state)) { + for(int i = 0; i< getListSize(state); i++) { + map.put("state[" + i + "]", getFromList(state, i)); + } + } + else { + map.put("state", JSON.getDefault().getMapper().writeValueAsString(state)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthTokenGenerateRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (clientSecret != null) { - if (isFileTypeOrListOfFiles(clientSecret)) { - fileTypeFound = true; - } - - if (clientSecret.getClass().equals(java.io.File.class) - || clientSecret.getClass().equals(Integer.class) - || clientSecret.getClass().equals(String.class) - || clientSecret.getClass().isEnum()) { - map.put("client_secret", clientSecret); - } else if (isListOfFile(clientSecret)) { - for (int i = 0; i < getListSize(clientSecret); i++) { - map.put("client_secret[" + i + "]", getFromList(clientSecret, i)); - } - } else { - map.put( - "client_secret", - JSON.getDefault().getMapper().writeValueAsString(clientSecret)); - } - } - if (code != null) { - if (isFileTypeOrListOfFiles(code)) { - fileTypeFound = true; - } - - if (code.getClass().equals(java.io.File.class) - || code.getClass().equals(Integer.class) - || code.getClass().equals(String.class) - || code.getClass().isEnum()) { - map.put("code", code); - } else if (isListOfFile(code)) { - for (int i = 0; i < getListSize(code); i++) { - map.put("code[" + i + "]", getFromList(code, i)); - } - } else { - map.put("code", JSON.getDefault().getMapper().writeValueAsString(code)); - } - } - if (grantType != null) { - if (isFileTypeOrListOfFiles(grantType)) { - fileTypeFound = true; - } - - if (grantType.getClass().equals(java.io.File.class) - || grantType.getClass().equals(Integer.class) - || grantType.getClass().equals(String.class) - || grantType.getClass().isEnum()) { - map.put("grant_type", grantType); - } else if (isListOfFile(grantType)) { - for (int i = 0; i < getListSize(grantType); i++) { - map.put("grant_type[" + i + "]", getFromList(grantType, i)); - } - } else { - map.put( - "grant_type", - JSON.getDefault().getMapper().writeValueAsString(grantType)); - } - } - if (state != null) { - if (isFileTypeOrListOfFiles(state)) { - fileTypeFound = true; - } - - if (state.getClass().equals(java.io.File.class) - || state.getClass().equals(Integer.class) - || state.getClass().equals(String.class) - || state.getClass().isEnum()) { - map.put("state", state); - } else if (isListOfFile(state)) { - for (int i = 0; i < getListSize(state); i++) { - map.put("state[" + i + "]", getFromList(state, i)); - } - } else { - map.put("state", JSON.getDefault().getMapper().writeValueAsString(state)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java index d8226d6a7..c08757338 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java @@ -10,312 +10,323 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** OAuthTokenRefreshRequest */ + +import com.dropbox.sign.ApiException; +/** + * OAuthTokenRefreshRequest + */ @JsonPropertyOrder({ - OAuthTokenRefreshRequest.JSON_PROPERTY_GRANT_TYPE, - OAuthTokenRefreshRequest.JSON_PROPERTY_REFRESH_TOKEN, - OAuthTokenRefreshRequest.JSON_PROPERTY_CLIENT_ID, - OAuthTokenRefreshRequest.JSON_PROPERTY_CLIENT_SECRET + OAuthTokenRefreshRequest.JSON_PROPERTY_GRANT_TYPE, + OAuthTokenRefreshRequest.JSON_PROPERTY_REFRESH_TOKEN, + OAuthTokenRefreshRequest.JSON_PROPERTY_CLIENT_ID, + OAuthTokenRefreshRequest.JSON_PROPERTY_CLIENT_SECRET }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class OAuthTokenRefreshRequest { - public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; - @javax.annotation.Nonnull private String grantType = "refresh_token"; - - public static final String JSON_PROPERTY_REFRESH_TOKEN = "refresh_token"; - @javax.annotation.Nonnull private String refreshToken; - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nullable private String clientId; - - public static final String JSON_PROPERTY_CLIENT_SECRET = "client_secret"; - @javax.annotation.Nullable private String clientSecret; - - public OAuthTokenRefreshRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static OAuthTokenRefreshRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, OAuthTokenRefreshRequest.class); + public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; + @javax.annotation.Nonnull + private String grantType = "refresh_token"; + + public static final String JSON_PROPERTY_REFRESH_TOKEN = "refresh_token"; + @javax.annotation.Nonnull + private String refreshToken; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_CLIENT_SECRET = "client_secret"; + @javax.annotation.Nullable + private String clientSecret; + + public OAuthTokenRefreshRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public OAuthTokenRefreshRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, OAuthTokenRefreshRequest.class); + } + + static public OAuthTokenRefreshRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + OAuthTokenRefreshRequest.class + ); + } + + public OAuthTokenRefreshRequest grantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + return this; + } + + /** + * When refreshing an existing token use `refresh_token`. + * @return grantType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GRANT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getGrantType() { + return grantType; + } + + + @JsonProperty(JSON_PROPERTY_GRANT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGrantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + } + + + public OAuthTokenRefreshRequest refreshToken(@javax.annotation.Nonnull String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * The token provided when you got the expired access token. + * @return refreshToken + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRefreshToken() { + return refreshToken; + } + + + @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRefreshToken(@javax.annotation.Nonnull String refreshToken) { + this.refreshToken = refreshToken; + } + + + public OAuthTokenRefreshRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client ID for your API app. Mandatory from August 1st, 2025. Until then, required if the \"Client Credentials Required\" setting is enabled for token refresh; optional if disabled. + * @return clientId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OAuthTokenRefreshRequest clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * The client secret for your API app. Mandatory from August 1st, 2025. Until then, required if the \"Client Credentials Required\" setting is enabled for token refresh; optional if disabled. + * @return clientSecret + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientSecret() { + return clientSecret; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + /** + * Return true if this OAuthTokenRefreshRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public static OAuthTokenRefreshRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - OAuthTokenRefreshRequest.class); - } - - public OAuthTokenRefreshRequest grantType(@javax.annotation.Nonnull String grantType) { - this.grantType = grantType; - return this; - } - - /** - * When refreshing an existing token use `refresh_token`. - * - * @return grantType - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_GRANT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getGrantType() { - return grantType; - } - - @JsonProperty(JSON_PROPERTY_GRANT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGrantType(@javax.annotation.Nonnull String grantType) { - this.grantType = grantType; - } - - public OAuthTokenRefreshRequest refreshToken(@javax.annotation.Nonnull String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * The token provided when you got the expired access token. - * - * @return refreshToken - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRefreshToken() { - return refreshToken; - } - - @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRefreshToken(@javax.annotation.Nonnull String refreshToken) { - this.refreshToken = refreshToken; - } - - public OAuthTokenRefreshRequest clientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - return this; - } - - /** - * The client ID for your API app. Mandatory from August 1st, 2025. Until then, required if the - * \"Client Credentials Required\" setting is enabled for token refresh; optional if - * disabled. - * - * @return clientId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - } - - public OAuthTokenRefreshRequest clientSecret(@javax.annotation.Nullable String clientSecret) { - this.clientSecret = clientSecret; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + OAuthTokenRefreshRequest oauthTokenRefreshRequest = (OAuthTokenRefreshRequest) o; + return Objects.equals(this.grantType, oauthTokenRefreshRequest.grantType) && + Objects.equals(this.refreshToken, oauthTokenRefreshRequest.refreshToken) && + Objects.equals(this.clientId, oauthTokenRefreshRequest.clientId) && + Objects.equals(this.clientSecret, oauthTokenRefreshRequest.clientSecret); + } + + @Override + public int hashCode() { + return Objects.hash(grantType, refreshToken, clientId, clientSecret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthTokenRefreshRequest {\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (grantType != null) { + if (isFileTypeOrListOfFiles(grantType)) { + fileTypeFound = true; + } - /** - * The client secret for your API app. Mandatory from August 1st, 2025. Until then, required if - * the \"Client Credentials Required\" setting is enabled for token refresh; optional - * if disabled. - * - * @return clientSecret - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientSecret() { - return clientSecret; + if (grantType.getClass().equals(java.io.File.class) || + grantType.getClass().equals(Integer.class) || + grantType.getClass().equals(String.class) || + grantType.getClass().isEnum()) { + map.put("grant_type", grantType); + } else if (isListOfFile(grantType)) { + for(int i = 0; i< getListSize(grantType); i++) { + map.put("grant_type[" + i + "]", getFromList(grantType, i)); + } + } + else { + map.put("grant_type", JSON.getDefault().getMapper().writeValueAsString(grantType)); + } } + if (refreshToken != null) { + if (isFileTypeOrListOfFiles(refreshToken)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientSecret(@javax.annotation.Nullable String clientSecret) { - this.clientSecret = clientSecret; + if (refreshToken.getClass().equals(java.io.File.class) || + refreshToken.getClass().equals(Integer.class) || + refreshToken.getClass().equals(String.class) || + refreshToken.getClass().isEnum()) { + map.put("refresh_token", refreshToken); + } else if (isListOfFile(refreshToken)) { + for(int i = 0; i< getListSize(refreshToken); i++) { + map.put("refresh_token[" + i + "]", getFromList(refreshToken, i)); + } + } + else { + map.put("refresh_token", JSON.getDefault().getMapper().writeValueAsString(refreshToken)); + } } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } - /** Return true if this OAuthTokenRefreshRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); } - OAuthTokenRefreshRequest oauthTokenRefreshRequest = (OAuthTokenRefreshRequest) o; - return Objects.equals(this.grantType, oauthTokenRefreshRequest.grantType) - && Objects.equals(this.refreshToken, oauthTokenRefreshRequest.refreshToken) - && Objects.equals(this.clientId, oauthTokenRefreshRequest.clientId) - && Objects.equals(this.clientSecret, oauthTokenRefreshRequest.clientSecret); } + if (clientSecret != null) { + if (isFileTypeOrListOfFiles(clientSecret)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(grantType, refreshToken, clientId, clientSecret); + if (clientSecret.getClass().equals(java.io.File.class) || + clientSecret.getClass().equals(Integer.class) || + clientSecret.getClass().equals(String.class) || + clientSecret.getClass().isEnum()) { + map.put("client_secret", clientSecret); + } else if (isListOfFile(clientSecret)) { + for(int i = 0; i< getListSize(clientSecret); i++) { + map.put("client_secret[" + i + "]", getFromList(clientSecret, i)); + } + } + else { + map.put("client_secret", JSON.getDefault().getMapper().writeValueAsString(clientSecret)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthTokenRefreshRequest {\n"); - sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); - sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (grantType != null) { - if (isFileTypeOrListOfFiles(grantType)) { - fileTypeFound = true; - } - - if (grantType.getClass().equals(java.io.File.class) - || grantType.getClass().equals(Integer.class) - || grantType.getClass().equals(String.class) - || grantType.getClass().isEnum()) { - map.put("grant_type", grantType); - } else if (isListOfFile(grantType)) { - for (int i = 0; i < getListSize(grantType); i++) { - map.put("grant_type[" + i + "]", getFromList(grantType, i)); - } - } else { - map.put( - "grant_type", - JSON.getDefault().getMapper().writeValueAsString(grantType)); - } - } - if (refreshToken != null) { - if (isFileTypeOrListOfFiles(refreshToken)) { - fileTypeFound = true; - } - - if (refreshToken.getClass().equals(java.io.File.class) - || refreshToken.getClass().equals(Integer.class) - || refreshToken.getClass().equals(String.class) - || refreshToken.getClass().isEnum()) { - map.put("refresh_token", refreshToken); - } else if (isListOfFile(refreshToken)) { - for (int i = 0; i < getListSize(refreshToken); i++) { - map.put("refresh_token[" + i + "]", getFromList(refreshToken, i)); - } - } else { - map.put( - "refresh_token", - JSON.getDefault().getMapper().writeValueAsString(refreshToken)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (clientSecret != null) { - if (isFileTypeOrListOfFiles(clientSecret)) { - fileTypeFound = true; - } - - if (clientSecret.getClass().equals(java.io.File.class) - || clientSecret.getClass().equals(Integer.class) - || clientSecret.getClass().equals(String.class) - || clientSecret.getClass().isEnum()) { - map.put("client_secret", clientSecret); - } else if (isListOfFile(clientSecret)) { - for (int i = 0; i < getListSize(clientSecret); i++) { - map.put("client_secret[" + i + "]", getFromList(clientSecret, i)); - } - } else { - map.put( - "client_secret", - JSON.getDefault().getMapper().writeValueAsString(clientSecret)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java index 278d62579..e77177911 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java @@ -10,350 +10,374 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** OAuthTokenResponse */ + +import com.dropbox.sign.ApiException; +/** + * OAuthTokenResponse + */ @JsonPropertyOrder({ - OAuthTokenResponse.JSON_PROPERTY_ACCESS_TOKEN, - OAuthTokenResponse.JSON_PROPERTY_TOKEN_TYPE, - OAuthTokenResponse.JSON_PROPERTY_REFRESH_TOKEN, - OAuthTokenResponse.JSON_PROPERTY_EXPIRES_IN, - OAuthTokenResponse.JSON_PROPERTY_STATE + OAuthTokenResponse.JSON_PROPERTY_ACCESS_TOKEN, + OAuthTokenResponse.JSON_PROPERTY_TOKEN_TYPE, + OAuthTokenResponse.JSON_PROPERTY_REFRESH_TOKEN, + OAuthTokenResponse.JSON_PROPERTY_EXPIRES_IN, + OAuthTokenResponse.JSON_PROPERTY_STATE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class OAuthTokenResponse { - public static final String JSON_PROPERTY_ACCESS_TOKEN = "access_token"; - @javax.annotation.Nullable private String accessToken; - - public static final String JSON_PROPERTY_TOKEN_TYPE = "token_type"; - @javax.annotation.Nullable private String tokenType; - - public static final String JSON_PROPERTY_REFRESH_TOKEN = "refresh_token"; - @javax.annotation.Nullable private String refreshToken; - - public static final String JSON_PROPERTY_EXPIRES_IN = "expires_in"; - @javax.annotation.Nullable private Integer expiresIn; - - public static final String JSON_PROPERTY_STATE = "state"; - @javax.annotation.Nullable private String state; - - public OAuthTokenResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static OAuthTokenResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, OAuthTokenResponse.class); - } - - public static OAuthTokenResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), OAuthTokenResponse.class); - } - - public OAuthTokenResponse accessToken(@javax.annotation.Nullable String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Get accessToken - * - * @return accessToken - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccessToken() { - return accessToken; - } - - @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccessToken(@javax.annotation.Nullable String accessToken) { - this.accessToken = accessToken; - } - - public OAuthTokenResponse tokenType(@javax.annotation.Nullable String tokenType) { - this.tokenType = tokenType; - return this; - } - - /** - * Get tokenType - * - * @return tokenType - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TOKEN_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTokenType() { - return tokenType; - } - - @JsonProperty(JSON_PROPERTY_TOKEN_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTokenType(@javax.annotation.Nullable String tokenType) { - this.tokenType = tokenType; + public static final String JSON_PROPERTY_ACCESS_TOKEN = "access_token"; + @javax.annotation.Nullable + private String accessToken; + + public static final String JSON_PROPERTY_TOKEN_TYPE = "token_type"; + @javax.annotation.Nullable + private String tokenType; + + public static final String JSON_PROPERTY_REFRESH_TOKEN = "refresh_token"; + @javax.annotation.Nullable + private String refreshToken; + + public static final String JSON_PROPERTY_EXPIRES_IN = "expires_in"; + @javax.annotation.Nullable + private Integer expiresIn; + + public static final String JSON_PROPERTY_STATE = "state"; + @javax.annotation.Nullable + private String state; + + public OAuthTokenResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public OAuthTokenResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, OAuthTokenResponse.class); + } + + static public OAuthTokenResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + OAuthTokenResponse.class + ); + } + + public OAuthTokenResponse accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccessToken() { + return accessToken; + } + + + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public OAuthTokenResponse tokenType(@javax.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get tokenType + * @return tokenType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOKEN_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTokenType() { + return tokenType; + } + + + @JsonProperty(JSON_PROPERTY_TOKEN_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTokenType(@javax.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + } + + + public OAuthTokenResponse refreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get refreshToken + * @return refreshToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRefreshToken() { + return refreshToken; + } + + + @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + } + + + public OAuthTokenResponse expiresIn(@javax.annotation.Nullable Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Number of seconds until the `access_token` expires. Uses epoch time. + * @return expiresIn + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_IN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresIn() { + return expiresIn; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_IN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresIn(@javax.annotation.Nullable Integer expiresIn) { + this.expiresIn = expiresIn; + } + + + public OAuthTokenResponse state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getState() { + return state; + } + + + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + /** + * Return true if this OAuthTokenResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public OAuthTokenResponse refreshToken(@javax.annotation.Nullable String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * Get refreshToken - * - * @return refreshToken - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRefreshToken() { - return refreshToken; - } - - @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { - this.refreshToken = refreshToken; - } - - public OAuthTokenResponse expiresIn(@javax.annotation.Nullable Integer expiresIn) { - this.expiresIn = expiresIn; - return this; - } - - /** - * Number of seconds until the `access_token` expires. Uses epoch time. - * - * @return expiresIn - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_IN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresIn() { - return expiresIn; - } - - @JsonProperty(JSON_PROPERTY_EXPIRES_IN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresIn(@javax.annotation.Nullable Integer expiresIn) { - this.expiresIn = expiresIn; + if (o == null || getClass() != o.getClass()) { + return false; } + OAuthTokenResponse oauthTokenResponse = (OAuthTokenResponse) o; + return Objects.equals(this.accessToken, oauthTokenResponse.accessToken) && + Objects.equals(this.tokenType, oauthTokenResponse.tokenType) && + Objects.equals(this.refreshToken, oauthTokenResponse.refreshToken) && + Objects.equals(this.expiresIn, oauthTokenResponse.expiresIn) && + Objects.equals(this.state, oauthTokenResponse.state); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, tokenType, refreshToken, expiresIn, state); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthTokenResponse {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (accessToken != null) { + if (isFileTypeOrListOfFiles(accessToken)) { + fileTypeFound = true; + } - public OAuthTokenResponse state(@javax.annotation.Nullable String state) { - this.state = state; - return this; + if (accessToken.getClass().equals(java.io.File.class) || + accessToken.getClass().equals(Integer.class) || + accessToken.getClass().equals(String.class) || + accessToken.getClass().isEnum()) { + map.put("access_token", accessToken); + } else if (isListOfFile(accessToken)) { + for(int i = 0; i< getListSize(accessToken); i++) { + map.put("access_token[" + i + "]", getFromList(accessToken, i)); + } + } + else { + map.put("access_token", JSON.getDefault().getMapper().writeValueAsString(accessToken)); + } } + if (tokenType != null) { + if (isFileTypeOrListOfFiles(tokenType)) { + fileTypeFound = true; + } - /** - * Get state - * - * @return state - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getState() { - return state; + if (tokenType.getClass().equals(java.io.File.class) || + tokenType.getClass().equals(Integer.class) || + tokenType.getClass().equals(String.class) || + tokenType.getClass().isEnum()) { + map.put("token_type", tokenType); + } else if (isListOfFile(tokenType)) { + for(int i = 0; i< getListSize(tokenType); i++) { + map.put("token_type[" + i + "]", getFromList(tokenType, i)); + } + } + else { + map.put("token_type", JSON.getDefault().getMapper().writeValueAsString(tokenType)); + } } + if (refreshToken != null) { + if (isFileTypeOrListOfFiles(refreshToken)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_STATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setState(@javax.annotation.Nullable String state) { - this.state = state; + if (refreshToken.getClass().equals(java.io.File.class) || + refreshToken.getClass().equals(Integer.class) || + refreshToken.getClass().equals(String.class) || + refreshToken.getClass().isEnum()) { + map.put("refresh_token", refreshToken); + } else if (isListOfFile(refreshToken)) { + for(int i = 0; i< getListSize(refreshToken); i++) { + map.put("refresh_token[" + i + "]", getFromList(refreshToken, i)); + } + } + else { + map.put("refresh_token", JSON.getDefault().getMapper().writeValueAsString(refreshToken)); + } } + if (expiresIn != null) { + if (isFileTypeOrListOfFiles(expiresIn)) { + fileTypeFound = true; + } - /** Return true if this OAuthTokenResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (expiresIn.getClass().equals(java.io.File.class) || + expiresIn.getClass().equals(Integer.class) || + expiresIn.getClass().equals(String.class) || + expiresIn.getClass().isEnum()) { + map.put("expires_in", expiresIn); + } else if (isListOfFile(expiresIn)) { + for(int i = 0; i< getListSize(expiresIn); i++) { + map.put("expires_in[" + i + "]", getFromList(expiresIn, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("expires_in", JSON.getDefault().getMapper().writeValueAsString(expiresIn)); } - OAuthTokenResponse oauthTokenResponse = (OAuthTokenResponse) o; - return Objects.equals(this.accessToken, oauthTokenResponse.accessToken) - && Objects.equals(this.tokenType, oauthTokenResponse.tokenType) - && Objects.equals(this.refreshToken, oauthTokenResponse.refreshToken) - && Objects.equals(this.expiresIn, oauthTokenResponse.expiresIn) - && Objects.equals(this.state, oauthTokenResponse.state); } + if (state != null) { + if (isFileTypeOrListOfFiles(state)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(accessToken, tokenType, refreshToken, expiresIn, state); + if (state.getClass().equals(java.io.File.class) || + state.getClass().equals(Integer.class) || + state.getClass().equals(String.class) || + state.getClass().isEnum()) { + map.put("state", state); + } else if (isListOfFile(state)) { + for(int i = 0; i< getListSize(state); i++) { + map.put("state[" + i + "]", getFromList(state, i)); + } + } + else { + map.put("state", JSON.getDefault().getMapper().writeValueAsString(state)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthTokenResponse {\n"); - sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); - sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); - sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); - sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accessToken != null) { - if (isFileTypeOrListOfFiles(accessToken)) { - fileTypeFound = true; - } - - if (accessToken.getClass().equals(java.io.File.class) - || accessToken.getClass().equals(Integer.class) - || accessToken.getClass().equals(String.class) - || accessToken.getClass().isEnum()) { - map.put("access_token", accessToken); - } else if (isListOfFile(accessToken)) { - for (int i = 0; i < getListSize(accessToken); i++) { - map.put("access_token[" + i + "]", getFromList(accessToken, i)); - } - } else { - map.put( - "access_token", - JSON.getDefault().getMapper().writeValueAsString(accessToken)); - } - } - if (tokenType != null) { - if (isFileTypeOrListOfFiles(tokenType)) { - fileTypeFound = true; - } - - if (tokenType.getClass().equals(java.io.File.class) - || tokenType.getClass().equals(Integer.class) - || tokenType.getClass().equals(String.class) - || tokenType.getClass().isEnum()) { - map.put("token_type", tokenType); - } else if (isListOfFile(tokenType)) { - for (int i = 0; i < getListSize(tokenType); i++) { - map.put("token_type[" + i + "]", getFromList(tokenType, i)); - } - } else { - map.put( - "token_type", - JSON.getDefault().getMapper().writeValueAsString(tokenType)); - } - } - if (refreshToken != null) { - if (isFileTypeOrListOfFiles(refreshToken)) { - fileTypeFound = true; - } - - if (refreshToken.getClass().equals(java.io.File.class) - || refreshToken.getClass().equals(Integer.class) - || refreshToken.getClass().equals(String.class) - || refreshToken.getClass().isEnum()) { - map.put("refresh_token", refreshToken); - } else if (isListOfFile(refreshToken)) { - for (int i = 0; i < getListSize(refreshToken); i++) { - map.put("refresh_token[" + i + "]", getFromList(refreshToken, i)); - } - } else { - map.put( - "refresh_token", - JSON.getDefault().getMapper().writeValueAsString(refreshToken)); - } - } - if (expiresIn != null) { - if (isFileTypeOrListOfFiles(expiresIn)) { - fileTypeFound = true; - } - - if (expiresIn.getClass().equals(java.io.File.class) - || expiresIn.getClass().equals(Integer.class) - || expiresIn.getClass().equals(String.class) - || expiresIn.getClass().isEnum()) { - map.put("expires_in", expiresIn); - } else if (isListOfFile(expiresIn)) { - for (int i = 0; i < getListSize(expiresIn); i++) { - map.put("expires_in[" + i + "]", getFromList(expiresIn, i)); - } - } else { - map.put( - "expires_in", - JSON.getDefault().getMapper().writeValueAsString(expiresIn)); - } - } - if (state != null) { - if (isFileTypeOrListOfFiles(state)) { - fileTypeFound = true; - } - - if (state.getClass().equals(java.io.File.class) - || state.getClass().equals(Integer.class) - || state.getClass().equals(String.class) - || state.getClass().isEnum()) { - map.put("state", state); - } else if (isListOfFile(state)) { - for (int i = 0; i < getListSize(state); i++) { - map.put("state[" + i + "]", getFromList(state, i)); - } - } else { - map.put("state", JSON.getDefault().getMapper().writeValueAsString(state)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java index 38e625dc3..3671a380b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java @@ -10,308 +10,319 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** ReportCreateRequest */ + +import com.dropbox.sign.ApiException; +/** + * ReportCreateRequest + */ @JsonPropertyOrder({ - ReportCreateRequest.JSON_PROPERTY_END_DATE, - ReportCreateRequest.JSON_PROPERTY_REPORT_TYPE, - ReportCreateRequest.JSON_PROPERTY_START_DATE + ReportCreateRequest.JSON_PROPERTY_END_DATE, + ReportCreateRequest.JSON_PROPERTY_REPORT_TYPE, + ReportCreateRequest.JSON_PROPERTY_START_DATE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ReportCreateRequest { - public static final String JSON_PROPERTY_END_DATE = "end_date"; - @javax.annotation.Nonnull private String endDate; - - /** Gets or Sets reportType */ - public enum ReportTypeEnum { - USER_ACTIVITY(String.valueOf("user_activity")), - - DOCUMENT_STATUS(String.valueOf("document_status")), - - SMS_ACTIVITY(String.valueOf("sms_activity")); - - private String value; - - ReportTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ReportTypeEnum fromValue(String value) { - for (ReportTypeEnum b : ReportTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_REPORT_TYPE = "report_type"; - @javax.annotation.Nonnull private List reportType = new ArrayList<>(); - - public static final String JSON_PROPERTY_START_DATE = "start_date"; - @javax.annotation.Nonnull private String startDate; - - public ReportCreateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ReportCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ReportCreateRequest.class); + public static final String JSON_PROPERTY_END_DATE = "end_date"; + @javax.annotation.Nonnull + private String endDate; + + /** + * Gets or Sets reportType + */ + public enum ReportTypeEnum { + USER_ACTIVITY(String.valueOf("user_activity")), + + DOCUMENT_STATUS(String.valueOf("document_status")), + + SMS_ACTIVITY(String.valueOf("sms_activity")); + + private String value; + + ReportTypeEnum(String value) { + this.value = value; } - public static ReportCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), ReportCreateRequest.class); + @JsonValue + public String getValue() { + return value; } - public ReportCreateRequest endDate(@javax.annotation.Nonnull String endDate) { - this.endDate = endDate; - return this; - } - - /** - * The (inclusive) end date for the report data in `MM/DD/YYYY` format. - * - * @return endDate - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_END_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getEndDate() { - return endDate; - } - - @JsonProperty(JSON_PROPERTY_END_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEndDate(@javax.annotation.Nonnull String endDate) { - this.endDate = endDate; - } - - public ReportCreateRequest reportType( - @javax.annotation.Nonnull List reportType) { - this.reportType = reportType; - return this; + @Override + public String toString() { + return String.valueOf(value); } - public ReportCreateRequest addReportTypeItem(ReportTypeEnum reportTypeItem) { - if (this.reportType == null) { - this.reportType = new ArrayList<>(); + @JsonCreator + public static ReportTypeEnum fromValue(String value) { + for (ReportTypeEnum b : ReportTypeEnum.values()) { + if (b.value.equals(value)) { + return b; } - this.reportType.add(reportTypeItem); - return this; + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - /** - * The type(s) of the report you are requesting. Allowed values are `user_activity` - * and `document_status`. User activity reports contain list of all users and their - * activity during the specified date range. Document status report contain a list of signature - * requests created in the specified time range (and their status). - * - * @return reportType - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REPORT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getReportType() { - return reportType; - } - - @JsonProperty(JSON_PROPERTY_REPORT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setReportType(@javax.annotation.Nonnull List reportType) { - this.reportType = reportType; + } + + public static final String JSON_PROPERTY_REPORT_TYPE = "report_type"; + @javax.annotation.Nonnull + private List reportType = new ArrayList<>(); + + public static final String JSON_PROPERTY_START_DATE = "start_date"; + @javax.annotation.Nonnull + private String startDate; + + public ReportCreateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ReportCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ReportCreateRequest.class); + } + + static public ReportCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ReportCreateRequest.class + ); + } + + public ReportCreateRequest endDate(@javax.annotation.Nonnull String endDate) { + this.endDate = endDate; + return this; + } + + /** + * The (inclusive) end date for the report data in `MM/DD/YYYY` format. + * @return endDate + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEndDate() { + return endDate; + } + + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEndDate(@javax.annotation.Nonnull String endDate) { + this.endDate = endDate; + } + + + public ReportCreateRequest reportType(@javax.annotation.Nonnull List reportType) { + this.reportType = reportType; + return this; + } + + public ReportCreateRequest addReportTypeItem(ReportTypeEnum reportTypeItem) { + if (this.reportType == null) { + this.reportType = new ArrayList<>(); } - - public ReportCreateRequest startDate(@javax.annotation.Nonnull String startDate) { - this.startDate = startDate; - return this; + this.reportType.add(reportTypeItem); + return this; + } + + /** + * The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). + * @return reportType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REPORT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getReportType() { + return reportType; + } + + + @JsonProperty(JSON_PROPERTY_REPORT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setReportType(@javax.annotation.Nonnull List reportType) { + this.reportType = reportType; + } + + + public ReportCreateRequest startDate(@javax.annotation.Nonnull String startDate) { + this.startDate = startDate; + return this; + } + + /** + * The (inclusive) start date for the report data in `MM/DD/YYYY` format. + * @return startDate + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStartDate() { + return startDate; + } + + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStartDate(@javax.annotation.Nonnull String startDate) { + this.startDate = startDate; + } + + + /** + * Return true if this ReportCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * The (inclusive) start date for the report data in `MM/DD/YYYY` format. - * - * @return startDate - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_START_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getStartDate() { - return startDate; + if (o == null || getClass() != o.getClass()) { + return false; } + ReportCreateRequest reportCreateRequest = (ReportCreateRequest) o; + return Objects.equals(this.endDate, reportCreateRequest.endDate) && + Objects.equals(this.reportType, reportCreateRequest.reportType) && + Objects.equals(this.startDate, reportCreateRequest.startDate); + } + + @Override + public int hashCode() { + return Objects.hash(endDate, reportType, startDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportCreateRequest {\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" reportType: ").append(toIndentedString(reportType)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (endDate != null) { + if (isFileTypeOrListOfFiles(endDate)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_START_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setStartDate(@javax.annotation.Nonnull String startDate) { - this.startDate = startDate; + if (endDate.getClass().equals(java.io.File.class) || + endDate.getClass().equals(Integer.class) || + endDate.getClass().equals(String.class) || + endDate.getClass().isEnum()) { + map.put("end_date", endDate); + } else if (isListOfFile(endDate)) { + for(int i = 0; i< getListSize(endDate); i++) { + map.put("end_date[" + i + "]", getFromList(endDate, i)); + } + } + else { + map.put("end_date", JSON.getDefault().getMapper().writeValueAsString(endDate)); + } } + if (reportType != null) { + if (isFileTypeOrListOfFiles(reportType)) { + fileTypeFound = true; + } - /** Return true if this ReportCreateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (reportType.getClass().equals(java.io.File.class) || + reportType.getClass().equals(Integer.class) || + reportType.getClass().equals(String.class) || + reportType.getClass().isEnum()) { + map.put("report_type", reportType); + } else if (isListOfFile(reportType)) { + for(int i = 0; i< getListSize(reportType); i++) { + map.put("report_type[" + i + "]", getFromList(reportType, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("report_type", JSON.getDefault().getMapper().writeValueAsString(reportType)); } - ReportCreateRequest reportCreateRequest = (ReportCreateRequest) o; - return Objects.equals(this.endDate, reportCreateRequest.endDate) - && Objects.equals(this.reportType, reportCreateRequest.reportType) - && Objects.equals(this.startDate, reportCreateRequest.startDate); } + if (startDate != null) { + if (isFileTypeOrListOfFiles(startDate)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(endDate, reportType, startDate); + if (startDate.getClass().equals(java.io.File.class) || + startDate.getClass().equals(Integer.class) || + startDate.getClass().equals(String.class) || + startDate.getClass().isEnum()) { + map.put("start_date", startDate); + } else if (isListOfFile(startDate)) { + for(int i = 0; i< getListSize(startDate); i++) { + map.put("start_date[" + i + "]", getFromList(startDate, i)); + } + } + else { + map.put("start_date", JSON.getDefault().getMapper().writeValueAsString(startDate)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReportCreateRequest {\n"); - sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); - sb.append(" reportType: ").append(toIndentedString(reportType)).append("\n"); - sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (endDate != null) { - if (isFileTypeOrListOfFiles(endDate)) { - fileTypeFound = true; - } - - if (endDate.getClass().equals(java.io.File.class) - || endDate.getClass().equals(Integer.class) - || endDate.getClass().equals(String.class) - || endDate.getClass().isEnum()) { - map.put("end_date", endDate); - } else if (isListOfFile(endDate)) { - for (int i = 0; i < getListSize(endDate); i++) { - map.put("end_date[" + i + "]", getFromList(endDate, i)); - } - } else { - map.put("end_date", JSON.getDefault().getMapper().writeValueAsString(endDate)); - } - } - if (reportType != null) { - if (isFileTypeOrListOfFiles(reportType)) { - fileTypeFound = true; - } - - if (reportType.getClass().equals(java.io.File.class) - || reportType.getClass().equals(Integer.class) - || reportType.getClass().equals(String.class) - || reportType.getClass().isEnum()) { - map.put("report_type", reportType); - } else if (isListOfFile(reportType)) { - for (int i = 0; i < getListSize(reportType); i++) { - map.put("report_type[" + i + "]", getFromList(reportType, i)); - } - } else { - map.put( - "report_type", - JSON.getDefault().getMapper().writeValueAsString(reportType)); - } - } - if (startDate != null) { - if (isFileTypeOrListOfFiles(startDate)) { - fileTypeFound = true; - } - - if (startDate.getClass().equals(java.io.File.class) - || startDate.getClass().equals(Integer.class) - || startDate.getClass().equals(String.class) - || startDate.getClass().isEnum()) { - map.put("start_date", startDate); - } else if (isListOfFile(startDate)) { - for (int i = 0; i < getListSize(startDate); i++) { - map.put("start_date[" + i + "]", getFromList(startDate, i)); - } - } else { - map.put( - "start_date", - JSON.getDefault().getMapper().writeValueAsString(startDate)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java index 70af485a1..ce6251d85 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java @@ -10,216 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.ReportResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** ReportCreateResponse */ + +import com.dropbox.sign.ApiException; +/** + * ReportCreateResponse + */ @JsonPropertyOrder({ - ReportCreateResponse.JSON_PROPERTY_REPORT, - ReportCreateResponse.JSON_PROPERTY_WARNINGS + ReportCreateResponse.JSON_PROPERTY_REPORT, + ReportCreateResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ReportCreateResponse { - public static final String JSON_PROPERTY_REPORT = "report"; - @javax.annotation.Nonnull private ReportResponse report; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public ReportCreateResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ReportCreateResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ReportCreateResponse.class); - } - - public static ReportCreateResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), ReportCreateResponse.class); - } - - public ReportCreateResponse report(@javax.annotation.Nonnull ReportResponse report) { - this.report = report; - return this; - } - - /** - * Get report - * - * @return report - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REPORT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ReportResponse getReport() { - return report; - } - - @JsonProperty(JSON_PROPERTY_REPORT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setReport(@javax.annotation.Nonnull ReportResponse report) { - this.report = report; - } - - public ReportCreateResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public ReportCreateResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_REPORT = "report"; + @javax.annotation.Nonnull + private ReportResponse report; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public ReportCreateResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ReportCreateResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ReportCreateResponse.class); + } + + static public ReportCreateResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ReportCreateResponse.class + ); + } + + public ReportCreateResponse report(@javax.annotation.Nonnull ReportResponse report) { + this.report = report; + return this; + } + + /** + * Get report + * @return report + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REPORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ReportResponse getReport() { + return report; + } + + + @JsonProperty(JSON_PROPERTY_REPORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setReport(@javax.annotation.Nonnull ReportResponse report) { + this.report = report; + } + + + public ReportCreateResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public ReportCreateResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this ReportCreateResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportCreateResponse reportCreateResponse = (ReportCreateResponse) o; + return Objects.equals(this.report, reportCreateResponse.report) && + Objects.equals(this.warnings, reportCreateResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(report, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportCreateResponse {\n"); + sb.append(" report: ").append(toIndentedString(report)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (report != null) { + if (isFileTypeOrListOfFiles(report)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this ReportCreateResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (report.getClass().equals(java.io.File.class) || + report.getClass().equals(Integer.class) || + report.getClass().equals(String.class) || + report.getClass().isEnum()) { + map.put("report", report); + } else if (isListOfFile(report)) { + for(int i = 0; i< getListSize(report); i++) { + map.put("report[" + i + "]", getFromList(report, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("report", JSON.getDefault().getMapper().writeValueAsString(report)); } - ReportCreateResponse reportCreateResponse = (ReportCreateResponse) o; - return Objects.equals(this.report, reportCreateResponse.report) - && Objects.equals(this.warnings, reportCreateResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(report, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReportCreateResponse {\n"); - sb.append(" report: ").append(toIndentedString(report)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (report != null) { - if (isFileTypeOrListOfFiles(report)) { - fileTypeFound = true; - } - - if (report.getClass().equals(java.io.File.class) - || report.getClass().equals(Integer.class) - || report.getClass().equals(String.class) - || report.getClass().isEnum()) { - map.put("report", report); - } else if (isListOfFile(report)) { - for (int i = 0; i < getListSize(report); i++) { - map.put("report[" + i + "]", getFromList(report, i)); - } - } else { - map.put("report", JSON.getDefault().getMapper().writeValueAsString(report)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportResponse.java index 6d5079f54..dff91b5d2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportResponse.java @@ -10,350 +10,370 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** Contains information about the report request. */ + +import com.dropbox.sign.ApiException; +/** + * Contains information about the report request. + */ @JsonPropertyOrder({ - ReportResponse.JSON_PROPERTY_SUCCESS, - ReportResponse.JSON_PROPERTY_START_DATE, - ReportResponse.JSON_PROPERTY_END_DATE, - ReportResponse.JSON_PROPERTY_REPORT_TYPE + ReportResponse.JSON_PROPERTY_SUCCESS, + ReportResponse.JSON_PROPERTY_START_DATE, + ReportResponse.JSON_PROPERTY_END_DATE, + ReportResponse.JSON_PROPERTY_REPORT_TYPE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class ReportResponse { - public static final String JSON_PROPERTY_SUCCESS = "success"; - @javax.annotation.Nullable private String success; - - public static final String JSON_PROPERTY_START_DATE = "start_date"; - @javax.annotation.Nullable private String startDate; - - public static final String JSON_PROPERTY_END_DATE = "end_date"; - @javax.annotation.Nullable private String endDate; - - /** Gets or Sets reportType */ - public enum ReportTypeEnum { - USER_ACTIVITY(String.valueOf("user_activity")), - - DOCUMENT_STATUS(String.valueOf("document_status")), - - SMS_ACTIVITY(String.valueOf("sms_activity")); - - private String value; - - ReportTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ReportTypeEnum fromValue(String value) { - for (ReportTypeEnum b : ReportTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_REPORT_TYPE = "report_type"; - @javax.annotation.Nullable private List reportType = null; - - public ReportResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static ReportResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ReportResponse.class); + public static final String JSON_PROPERTY_SUCCESS = "success"; + @javax.annotation.Nullable + private String success; + + public static final String JSON_PROPERTY_START_DATE = "start_date"; + @javax.annotation.Nullable + private String startDate; + + public static final String JSON_PROPERTY_END_DATE = "end_date"; + @javax.annotation.Nullable + private String endDate; + + /** + * Gets or Sets reportType + */ + public enum ReportTypeEnum { + USER_ACTIVITY(String.valueOf("user_activity")), + + DOCUMENT_STATUS(String.valueOf("document_status")), + + SMS_ACTIVITY(String.valueOf("sms_activity")); + + private String value; + + ReportTypeEnum(String value) { + this.value = value; } - public static ReportResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), ReportResponse.class); + @JsonValue + public String getValue() { + return value; } - public ReportResponse success(@javax.annotation.Nullable String success) { - this.success = success; - return this; - } - - /** - * A message indicating the requested operation's success - * - * @return success - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUCCESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSuccess() { - return success; - } - - @JsonProperty(JSON_PROPERTY_SUCCESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSuccess(@javax.annotation.Nullable String success) { - this.success = success; - } - - public ReportResponse startDate(@javax.annotation.Nullable String startDate) { - this.startDate = startDate; - return this; - } - - /** - * The (inclusive) start date for the report data in MM/DD/YYYY format. - * - * @return startDate - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_START_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getStartDate() { - return startDate; - } - - @JsonProperty(JSON_PROPERTY_START_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStartDate(@javax.annotation.Nullable String startDate) { - this.startDate = startDate; + @Override + public String toString() { + return String.valueOf(value); } - public ReportResponse endDate(@javax.annotation.Nullable String endDate) { - this.endDate = endDate; - return this; + @JsonCreator + public static ReportTypeEnum fromValue(String value) { + for (ReportTypeEnum b : ReportTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - /** - * The (inclusive) end date for the report data in MM/DD/YYYY format. - * - * @return endDate - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_END_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEndDate() { - return endDate; + } + + public static final String JSON_PROPERTY_REPORT_TYPE = "report_type"; + @javax.annotation.Nullable + private List reportType = null; + + public ReportResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public ReportResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ReportResponse.class); + } + + static public ReportResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + ReportResponse.class + ); + } + + public ReportResponse success(@javax.annotation.Nullable String success) { + this.success = success; + return this; + } + + /** + * A message indicating the requested operation's success + * @return success + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUCCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSuccess() { + return success; + } + + + @JsonProperty(JSON_PROPERTY_SUCCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSuccess(@javax.annotation.Nullable String success) { + this.success = success; + } + + + public ReportResponse startDate(@javax.annotation.Nullable String startDate) { + this.startDate = startDate; + return this; + } + + /** + * The (inclusive) start date for the report data in MM/DD/YYYY format. + * @return startDate + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStartDate() { + return startDate; + } + + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(@javax.annotation.Nullable String startDate) { + this.startDate = startDate; + } + + + public ReportResponse endDate(@javax.annotation.Nullable String endDate) { + this.endDate = endDate; + return this; + } + + /** + * The (inclusive) end date for the report data in MM/DD/YYYY format. + * @return endDate + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEndDate() { + return endDate; + } + + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(@javax.annotation.Nullable String endDate) { + this.endDate = endDate; + } + + + public ReportResponse reportType(@javax.annotation.Nullable List reportType) { + this.reportType = reportType; + return this; + } + + public ReportResponse addReportTypeItem(ReportTypeEnum reportTypeItem) { + if (this.reportType == null) { + this.reportType = new ArrayList<>(); } - - @JsonProperty(JSON_PROPERTY_END_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEndDate(@javax.annotation.Nullable String endDate) { - this.endDate = endDate; + this.reportType.add(reportTypeItem); + return this; + } + + /** + * The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). + * @return reportType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPORT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getReportType() { + return reportType; + } + + + @JsonProperty(JSON_PROPERTY_REPORT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReportType(@javax.annotation.Nullable List reportType) { + this.reportType = reportType; + } + + + /** + * Return true if this ReportResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public ReportResponse reportType(@javax.annotation.Nullable List reportType) { - this.reportType = reportType; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - public ReportResponse addReportTypeItem(ReportTypeEnum reportTypeItem) { - if (this.reportType == null) { - this.reportType = new ArrayList<>(); + ReportResponse reportResponse = (ReportResponse) o; + return Objects.equals(this.success, reportResponse.success) && + Objects.equals(this.startDate, reportResponse.startDate) && + Objects.equals(this.endDate, reportResponse.endDate) && + Objects.equals(this.reportType, reportResponse.reportType); + } + + @Override + public int hashCode() { + return Objects.hash(success, startDate, endDate, reportType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportResponse {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" reportType: ").append(toIndentedString(reportType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (success != null) { + if (isFileTypeOrListOfFiles(success)) { + fileTypeFound = true; } - this.reportType.add(reportTypeItem); - return this; - } - /** - * The type(s) of the report you are requesting. Allowed values are \"user_activity\" - * and \"document_status\". User activity reports contain list of all users and their - * activity during the specified date range. Document status report contain a list of signature - * requests created in the specified time range (and their status). - * - * @return reportType - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REPORT_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getReportType() { - return reportType; + if (success.getClass().equals(java.io.File.class) || + success.getClass().equals(Integer.class) || + success.getClass().equals(String.class) || + success.getClass().isEnum()) { + map.put("success", success); + } else if (isListOfFile(success)) { + for(int i = 0; i< getListSize(success); i++) { + map.put("success[" + i + "]", getFromList(success, i)); + } + } + else { + map.put("success", JSON.getDefault().getMapper().writeValueAsString(success)); + } } + if (startDate != null) { + if (isFileTypeOrListOfFiles(startDate)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_REPORT_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReportType(@javax.annotation.Nullable List reportType) { - this.reportType = reportType; + if (startDate.getClass().equals(java.io.File.class) || + startDate.getClass().equals(Integer.class) || + startDate.getClass().equals(String.class) || + startDate.getClass().isEnum()) { + map.put("start_date", startDate); + } else if (isListOfFile(startDate)) { + for(int i = 0; i< getListSize(startDate); i++) { + map.put("start_date[" + i + "]", getFromList(startDate, i)); + } + } + else { + map.put("start_date", JSON.getDefault().getMapper().writeValueAsString(startDate)); + } } + if (endDate != null) { + if (isFileTypeOrListOfFiles(endDate)) { + fileTypeFound = true; + } - /** Return true if this ReportResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (endDate.getClass().equals(java.io.File.class) || + endDate.getClass().equals(Integer.class) || + endDate.getClass().equals(String.class) || + endDate.getClass().isEnum()) { + map.put("end_date", endDate); + } else if (isListOfFile(endDate)) { + for(int i = 0; i< getListSize(endDate); i++) { + map.put("end_date[" + i + "]", getFromList(endDate, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("end_date", JSON.getDefault().getMapper().writeValueAsString(endDate)); } - ReportResponse reportResponse = (ReportResponse) o; - return Objects.equals(this.success, reportResponse.success) - && Objects.equals(this.startDate, reportResponse.startDate) - && Objects.equals(this.endDate, reportResponse.endDate) - && Objects.equals(this.reportType, reportResponse.reportType); } + if (reportType != null) { + if (isFileTypeOrListOfFiles(reportType)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(success, startDate, endDate, reportType); + if (reportType.getClass().equals(java.io.File.class) || + reportType.getClass().equals(Integer.class) || + reportType.getClass().equals(String.class) || + reportType.getClass().isEnum()) { + map.put("report_type", reportType); + } else if (isListOfFile(reportType)) { + for(int i = 0; i< getListSize(reportType); i++) { + map.put("report_type[" + i + "]", getFromList(reportType, i)); + } + } + else { + map.put("report_type", JSON.getDefault().getMapper().writeValueAsString(reportType)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReportResponse {\n"); - sb.append(" success: ").append(toIndentedString(success)).append("\n"); - sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); - sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); - sb.append(" reportType: ").append(toIndentedString(reportType)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (success != null) { - if (isFileTypeOrListOfFiles(success)) { - fileTypeFound = true; - } - - if (success.getClass().equals(java.io.File.class) - || success.getClass().equals(Integer.class) - || success.getClass().equals(String.class) - || success.getClass().isEnum()) { - map.put("success", success); - } else if (isListOfFile(success)) { - for (int i = 0; i < getListSize(success); i++) { - map.put("success[" + i + "]", getFromList(success, i)); - } - } else { - map.put("success", JSON.getDefault().getMapper().writeValueAsString(success)); - } - } - if (startDate != null) { - if (isFileTypeOrListOfFiles(startDate)) { - fileTypeFound = true; - } - - if (startDate.getClass().equals(java.io.File.class) - || startDate.getClass().equals(Integer.class) - || startDate.getClass().equals(String.class) - || startDate.getClass().isEnum()) { - map.put("start_date", startDate); - } else if (isListOfFile(startDate)) { - for (int i = 0; i < getListSize(startDate); i++) { - map.put("start_date[" + i + "]", getFromList(startDate, i)); - } - } else { - map.put( - "start_date", - JSON.getDefault().getMapper().writeValueAsString(startDate)); - } - } - if (endDate != null) { - if (isFileTypeOrListOfFiles(endDate)) { - fileTypeFound = true; - } - - if (endDate.getClass().equals(java.io.File.class) - || endDate.getClass().equals(Integer.class) - || endDate.getClass().equals(String.class) - || endDate.getClass().isEnum()) { - map.put("end_date", endDate); - } else if (isListOfFile(endDate)) { - for (int i = 0; i < getListSize(endDate); i++) { - map.put("end_date[" + i + "]", getFromList(endDate, i)); - } - } else { - map.put("end_date", JSON.getDefault().getMapper().writeValueAsString(endDate)); - } - } - if (reportType != null) { - if (isFileTypeOrListOfFiles(reportType)) { - fileTypeFound = true; - } - - if (reportType.getClass().equals(java.io.File.class) - || reportType.getClass().equals(Integer.class) - || reportType.getClass().equals(String.class) - || reportType.getClass().isEnum()) { - map.put("report_type", reportType); - } else if (isListOfFile(reportType)) { - for (int i = 0; i < getListSize(reportType); i++) { - map.put("report_type[" + i + "]", getFromList(reportType, i)); - } - } else { - map.put( - "report_type", - JSON.getDefault().getMapper().writeValueAsString(reportType)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java index fda33d504..717929fb6 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java @@ -10,873 +10,830 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubBulkSignerList; +import com.dropbox.sign.model.SubCC; +import com.dropbox.sign.model.SubCustomField; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** SignatureRequestBulkCreateEmbeddedWithTemplateRequest */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestBulkCreateEmbeddedWithTemplateRequest + */ @JsonPropertyOrder({ - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNER_FILE, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNER_LIST, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNER_FILE, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNER_LIST, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - @javax.annotation.Nonnull private List templateIds = new ArrayList<>(); - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nonnull private String clientId; - - public static final String JSON_PROPERTY_SIGNER_FILE = "signer_file"; - @javax.annotation.Nullable private File signerFile; - - public static final String JSON_PROPERTY_SIGNER_LIST = "signer_list"; - @javax.annotation.Nullable private List signerList = null; - - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + @javax.annotation.Nonnull + private List templateIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nonnull + private String clientId; + + public static final String JSON_PROPERTY_SIGNER_FILE = "signer_file"; + @javax.annotation.Nullable + private File signerFile; + + public static final String JSON_PROPERTY_SIGNER_LIST = "signer_list"; + @javax.annotation.Nullable + private List signerList = null; + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_CCS = "ccs"; + @javax.annotation.Nullable + private List ccs = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestBulkCreateEmbeddedWithTemplateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestBulkCreateEmbeddedWithTemplateRequest.class); + } + + static public SignatureRequestBulkCreateEmbeddedWithTemplateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.class + ); + } + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest templateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + return this; + } + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @return templateIds + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTemplateIds() { + return templateIds; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + } + + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app you're using to create this embedded signature request. Used for security purposes. + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signerFile(@javax.annotation.Nullable File signerFile) { + this.signerFile = signerFile; + return this; + } + + /** + * `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` + * @return signerFile + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public File getSignerFile() { + return signerFile; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerFile(@javax.annotation.Nullable File signerFile) { + this.signerFile = signerFile; + } + + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signerList(@javax.annotation.Nullable List signerList) { + this.signerList = signerList; + return this; + } + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addSignerListItem(SubBulkSignerList signerListItem) { + if (this.signerList == null) { + this.signerList = new ArrayList<>(); + } + this.signerList.add(signerListItem); + return this; + } + + /** + * `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. + * @return signerList + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSignerList() { + return signerList; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerList(@javax.annotation.Nullable List signerList) { + this.signerList = signerList; + } + + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest ccs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + return this; + } + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); + } + this.ccs.add(ccsItem); + return this; + } + + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * @return ccs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcs() { + return ccs; + } + + + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + } + + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } - public static final String JSON_PROPERTY_CCS = "ccs"; - @javax.annotation.Nullable private List ccs = null; - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestBulkCreateEmbeddedWithTemplateRequest init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestBulkCreateEmbeddedWithTemplateRequest.class); - } - - public static SignatureRequestBulkCreateEmbeddedWithTemplateRequest init(HashMap data) - throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.class); - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest templateIds( - @javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - return this; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addTemplateIdsItem( - String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + /** + * Return true if this SignatureRequestBulkCreateEmbeddedWithTemplateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest = (SignatureRequestBulkCreateEmbeddedWithTemplateRequest) o; + return Objects.equals(this.templateIds, signatureRequestBulkCreateEmbeddedWithTemplateRequest.templateIds) && + Objects.equals(this.clientId, signatureRequestBulkCreateEmbeddedWithTemplateRequest.clientId) && + Objects.equals(this.signerFile, signatureRequestBulkCreateEmbeddedWithTemplateRequest.signerFile) && + Objects.equals(this.signerList, signatureRequestBulkCreateEmbeddedWithTemplateRequest.signerList) && + Objects.equals(this.allowDecline, signatureRequestBulkCreateEmbeddedWithTemplateRequest.allowDecline) && + Objects.equals(this.ccs, signatureRequestBulkCreateEmbeddedWithTemplateRequest.ccs) && + Objects.equals(this.customFields, signatureRequestBulkCreateEmbeddedWithTemplateRequest.customFields) && + Objects.equals(this.message, signatureRequestBulkCreateEmbeddedWithTemplateRequest.message) && + Objects.equals(this.metadata, signatureRequestBulkCreateEmbeddedWithTemplateRequest.metadata) && + Objects.equals(this.signingRedirectUrl, signatureRequestBulkCreateEmbeddedWithTemplateRequest.signingRedirectUrl) && + Objects.equals(this.subject, signatureRequestBulkCreateEmbeddedWithTemplateRequest.subject) && + Objects.equals(this.testMode, signatureRequestBulkCreateEmbeddedWithTemplateRequest.testMode) && + Objects.equals(this.title, signatureRequestBulkCreateEmbeddedWithTemplateRequest.title); + } + + @Override + public int hashCode() { + return Objects.hash(templateIds, clientId, signerFile, signerList, allowDecline, ccs, customFields, message, metadata, signingRedirectUrl, subject, testMode, title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestBulkCreateEmbeddedWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" signerFile: ").append(toIndentedString(signerFile)).append("\n"); + sb.append(" signerList: ").append(toIndentedString(signerList)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; } - this.templateIds.add(templateIdsItem); - return this; - } - - /** - * Use `template_ids` to create a SignatureRequest from one or more templates, in the - * order in which the template will be used. - * - * @return templateIds - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getTemplateIds() { - return templateIds; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest clientId( - @javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - return this; - } - /** - * Client id of the app you're using to create this embedded signature request. Used for - * security purposes. - * - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signerFile( - @javax.annotation.Nullable File signerFile) { - this.signerFile = signerFile; - return this; - } - - /** - * `signer_file` is a CSV file defining values and options for signer fields. Required - * unless a `signer_list` is used, you may not use both. The CSV can have the - * following columns: - `name`: the name of the signer filling the role of RoleName - - * `email_address`: email address of the signer filling the role of RoleName - - * `pin`: the 4- to 12-character access code that will secure this signer's - * signature page (optional) - `sms_phone_number`: An E.164 formatted phone number - * that will receive a code via SMS to access this signer's signature page. (optional) By - * using the feature, you agree you are responsible for obtaining a signer's consent to - * receive text messages from Dropbox Sign related to this signature request and confirm you - * have obtained such consent from all signers prior to enabling SMS delivery for this signature - * request. [Learn - * more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). - * **NOTE:** Not available in test mode and requires a Standard plan or higher. - - * `*_field`: any column with a _field\" suffix will be treated as a custom field - * (optional) You may only specify field values here, any other options should be set in the - * custom_fields request parameter. Example CSV: ``` name, email_address, pin, - * company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, - * 123 LLC ``` - * - * @return signerFile - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public File getSignerFile() { - return signerFile; - } - - @JsonProperty(JSON_PROPERTY_SIGNER_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerFile(@javax.annotation.Nullable File signerFile) { - this.signerFile = signerFile; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signerList( - @javax.annotation.Nullable List signerList) { - this.signerList = signerList; - return this; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addSignerListItem( - SubBulkSignerList signerListItem) { - if (this.signerList == null) { - this.signerList = new ArrayList<>(); + if (templateIds.getClass().equals(java.io.File.class) || + templateIds.getClass().equals(Integer.class) || + templateIds.getClass().equals(String.class) || + templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for(int i = 0; i< getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } } - this.signerList.add(signerListItem); - return this; - } - - /** - * `signer_list` is an array defining values and options for signer fields. Required - * unless a `signer_file` is used, you may not use both. - * - * @return signerList - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSignerList() { - return signerList; - } - - @JsonProperty(JSON_PROPERTY_SIGNER_LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerList(@javax.annotation.Nullable List signerList) { - this.signerList = signerList; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest ccs( - @javax.annotation.Nullable List ccs) { - this.ccs = ccs; - return this; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { - if (this.ccs == null) { - this.ccs = new ArrayList<>(); + else { + map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); } - this.ccs.add(ccsItem); - return this; } - - /** - * Add CC email recipients. Required when a CC role exists for the Template. - * - * @return ccs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcs() { - return ccs; - } - - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcs(@javax.annotation.Nullable List ccs) { - this.ccs = ccs; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCustomFieldsItem( - SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; } - this.customFields.add(customFieldsItem); - return this; - } - - /** - * When used together with merge fields, `custom_fields` allows users to add - * pre-filled data to their signature requests. Pre-filled data can be used with - * \"send-once\" signature requests by adding merge fields with - * `form_fields_per_document` or [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values - * back with `custom_fields` together in one API call. For using pre-filled on - * repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or - * by calling - * [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and - * then passing `custom_fields` on subsequent signature requests referencing that - * template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest message( - @javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest putMetadataItem( - String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; } + if (signerFile != null) { + if (isFileTypeOrListOfFiles(signerFile)) { + fileTypeFound = true; + } - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest subject( - @javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (signerFile.getClass().equals(java.io.File.class) || + signerFile.getClass().equals(Integer.class) || + signerFile.getClass().equals(String.class) || + signerFile.getClass().isEnum()) { + map.put("signer_file", signerFile); + } else if (isListOfFile(signerFile)) { + for(int i = 0; i< getListSize(signerFile); i++) { + map.put("signer_file[" + i + "]", getFromList(signerFile, i)); + } + } + else { + map.put("signer_file", JSON.getDefault().getMapper().writeValueAsString(signerFile)); + } } + if (signerList != null) { + if (isFileTypeOrListOfFiles(signerList)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (signerList.getClass().equals(java.io.File.class) || + signerList.getClass().equals(Integer.class) || + signerList.getClass().equals(String.class) || + signerList.getClass().isEnum()) { + map.put("signer_list", signerList); + } else if (isListOfFile(signerList)) { + for(int i = 0; i< getListSize(signerList); i++) { + map.put("signer_list[" + i + "]", getFromList(signerList, i)); + } + } + else { + map.put("signer_list", JSON.getDefault().getMapper().writeValueAsString(signerList)); + } } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (ccs.getClass().equals(java.io.File.class) || + ccs.getClass().equals(Integer.class) || + ccs.getClass().equals(String.class) || + ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for(int i = 0; i< getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } + else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request will not be legally binding if set to - * `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest title( - @javax.annotation.Nullable String title) { - this.title = title; - return this; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - /** - * Return true if this SignatureRequestBulkCreateEmbeddedWithTemplateRequest object is equal to - * o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestBulkCreateEmbeddedWithTemplateRequest - signatureRequestBulkCreateEmbeddedWithTemplateRequest = - (SignatureRequestBulkCreateEmbeddedWithTemplateRequest) o; - return Objects.equals( - this.templateIds, - signatureRequestBulkCreateEmbeddedWithTemplateRequest.templateIds) - && Objects.equals( - this.clientId, - signatureRequestBulkCreateEmbeddedWithTemplateRequest.clientId) - && Objects.equals( - this.signerFile, - signatureRequestBulkCreateEmbeddedWithTemplateRequest.signerFile) - && Objects.equals( - this.signerList, - signatureRequestBulkCreateEmbeddedWithTemplateRequest.signerList) - && Objects.equals( - this.allowDecline, - signatureRequestBulkCreateEmbeddedWithTemplateRequest.allowDecline) - && Objects.equals( - this.ccs, signatureRequestBulkCreateEmbeddedWithTemplateRequest.ccs) - && Objects.equals( - this.customFields, - signatureRequestBulkCreateEmbeddedWithTemplateRequest.customFields) - && Objects.equals( - this.message, signatureRequestBulkCreateEmbeddedWithTemplateRequest.message) - && Objects.equals( - this.metadata, - signatureRequestBulkCreateEmbeddedWithTemplateRequest.metadata) - && Objects.equals( - this.signingRedirectUrl, - signatureRequestBulkCreateEmbeddedWithTemplateRequest.signingRedirectUrl) - && Objects.equals( - this.subject, signatureRequestBulkCreateEmbeddedWithTemplateRequest.subject) - && Objects.equals( - this.testMode, - signatureRequestBulkCreateEmbeddedWithTemplateRequest.testMode) - && Objects.equals( - this.title, signatureRequestBulkCreateEmbeddedWithTemplateRequest.title); + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - templateIds, - clientId, - signerFile, - signerList, - allowDecline, - ccs, - customFields, - message, - metadata, - signingRedirectUrl, - subject, - testMode, - title); + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestBulkCreateEmbeddedWithTemplateRequest {\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" signerFile: ").append(toIndentedString(signerFile)).append("\n"); - sb.append(" signerList: ").append(toIndentedString(signerList)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } - - if (templateIds.getClass().equals(java.io.File.class) - || templateIds.getClass().equals(Integer.class) - || templateIds.getClass().equals(String.class) - || templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for (int i = 0; i < getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } else { - map.put( - "template_ids", - JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (signerFile != null) { - if (isFileTypeOrListOfFiles(signerFile)) { - fileTypeFound = true; - } - - if (signerFile.getClass().equals(java.io.File.class) - || signerFile.getClass().equals(Integer.class) - || signerFile.getClass().equals(String.class) - || signerFile.getClass().isEnum()) { - map.put("signer_file", signerFile); - } else if (isListOfFile(signerFile)) { - for (int i = 0; i < getListSize(signerFile); i++) { - map.put("signer_file[" + i + "]", getFromList(signerFile, i)); - } - } else { - map.put( - "signer_file", - JSON.getDefault().getMapper().writeValueAsString(signerFile)); - } - } - if (signerList != null) { - if (isFileTypeOrListOfFiles(signerList)) { - fileTypeFound = true; - } - - if (signerList.getClass().equals(java.io.File.class) - || signerList.getClass().equals(Integer.class) - || signerList.getClass().equals(String.class) - || signerList.getClass().isEnum()) { - map.put("signer_list", signerList); - } else if (isListOfFile(signerList)) { - for (int i = 0; i < getListSize(signerList); i++) { - map.put("signer_list[" + i + "]", getFromList(signerList, i)); - } - } else { - map.put( - "signer_list", - JSON.getDefault().getMapper().writeValueAsString(signerList)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (ccs != null) { - if (isFileTypeOrListOfFiles(ccs)) { - fileTypeFound = true; - } - - if (ccs.getClass().equals(java.io.File.class) - || ccs.getClass().equals(Integer.class) - || ccs.getClass().equals(String.class) - || ccs.getClass().isEnum()) { - map.put("ccs", ccs); - } else if (isListOfFile(ccs)) { - for (int i = 0; i < getListSize(ccs); i++) { - map.put("ccs[" + i + "]", getFromList(ccs, i)); - } - } else { - map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java index 67ab53ea1..1cd73c24e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java @@ -10,854 +10,830 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubBulkSignerList; +import com.dropbox.sign.model.SubCC; +import com.dropbox.sign.model.SubCustomField; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** SignatureRequestBulkSendWithTemplateRequest */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestBulkSendWithTemplateRequest + */ @JsonPropertyOrder({ - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNER_FILE, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNER_LIST, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_CCS, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_METADATA, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNER_FILE, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNER_LIST, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TITLE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestBulkSendWithTemplateRequest { - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - @javax.annotation.Nonnull private List templateIds = new ArrayList<>(); - - public static final String JSON_PROPERTY_SIGNER_FILE = "signer_file"; - @javax.annotation.Nullable private File signerFile; - - public static final String JSON_PROPERTY_SIGNER_LIST = "signer_list"; - @javax.annotation.Nullable private List signerList = null; - - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; - - public static final String JSON_PROPERTY_CCS = "ccs"; - @javax.annotation.Nullable private List ccs = null; - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nullable private String clientId; - - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public SignatureRequestBulkSendWithTemplateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestBulkSendWithTemplateRequest init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestBulkSendWithTemplateRequest.class); + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + @javax.annotation.Nonnull + private List templateIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_SIGNER_FILE = "signer_file"; + @javax.annotation.Nullable + private File signerFile; + + public static final String JSON_PROPERTY_SIGNER_LIST = "signer_list"; + @javax.annotation.Nullable + private List signerList = null; + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_CCS = "ccs"; + @javax.annotation.Nullable + private List ccs = null; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public SignatureRequestBulkSendWithTemplateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestBulkSendWithTemplateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestBulkSendWithTemplateRequest.class); + } + + static public SignatureRequestBulkSendWithTemplateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestBulkSendWithTemplateRequest.class + ); + } + + public SignatureRequestBulkSendWithTemplateRequest templateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + return this; + } + + public SignatureRequestBulkSendWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @return templateIds + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTemplateIds() { + return templateIds; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + } + + + public SignatureRequestBulkSendWithTemplateRequest signerFile(@javax.annotation.Nullable File signerFile) { + this.signerFile = signerFile; + return this; + } + + /** + * `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` + * @return signerFile + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public File getSignerFile() { + return signerFile; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerFile(@javax.annotation.Nullable File signerFile) { + this.signerFile = signerFile; + } + + + public SignatureRequestBulkSendWithTemplateRequest signerList(@javax.annotation.Nullable List signerList) { + this.signerList = signerList; + return this; + } + + public SignatureRequestBulkSendWithTemplateRequest addSignerListItem(SubBulkSignerList signerListItem) { + if (this.signerList == null) { + this.signerList = new ArrayList<>(); + } + this.signerList.add(signerListItem); + return this; + } + + /** + * `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. + * @return signerList + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSignerList() { + return signerList; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerList(@javax.annotation.Nullable List signerList) { + this.signerList = signerList; + } + + + public SignatureRequestBulkSendWithTemplateRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestBulkSendWithTemplateRequest ccs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + return this; + } + + public SignatureRequestBulkSendWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); } - - public static SignatureRequestBulkSendWithTemplateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestBulkSendWithTemplateRequest.class); + this.ccs.add(ccsItem); + return this; + } + + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * @return ccs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcs() { + return ccs; + } + + + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + } + + + public SignatureRequestBulkSendWithTemplateRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestBulkSendWithTemplateRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestBulkSendWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } - - public SignatureRequestBulkSendWithTemplateRequest templateIds( - @javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - return this; + this.customFields.add(customFieldsItem); + return this; + } + + /** + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + + + public SignatureRequestBulkSendWithTemplateRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public SignatureRequestBulkSendWithTemplateRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestBulkSendWithTemplateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + - public SignatureRequestBulkSendWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); + public SignatureRequestBulkSendWithTemplateRequest signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public SignatureRequestBulkSendWithTemplateRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public SignatureRequestBulkSendWithTemplateRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestBulkSendWithTemplateRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + /** + * Return true if this SignatureRequestBulkSendWithTemplateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest = (SignatureRequestBulkSendWithTemplateRequest) o; + return Objects.equals(this.templateIds, signatureRequestBulkSendWithTemplateRequest.templateIds) && + Objects.equals(this.signerFile, signatureRequestBulkSendWithTemplateRequest.signerFile) && + Objects.equals(this.signerList, signatureRequestBulkSendWithTemplateRequest.signerList) && + Objects.equals(this.allowDecline, signatureRequestBulkSendWithTemplateRequest.allowDecline) && + Objects.equals(this.ccs, signatureRequestBulkSendWithTemplateRequest.ccs) && + Objects.equals(this.clientId, signatureRequestBulkSendWithTemplateRequest.clientId) && + Objects.equals(this.customFields, signatureRequestBulkSendWithTemplateRequest.customFields) && + Objects.equals(this.message, signatureRequestBulkSendWithTemplateRequest.message) && + Objects.equals(this.metadata, signatureRequestBulkSendWithTemplateRequest.metadata) && + Objects.equals(this.signingRedirectUrl, signatureRequestBulkSendWithTemplateRequest.signingRedirectUrl) && + Objects.equals(this.subject, signatureRequestBulkSendWithTemplateRequest.subject) && + Objects.equals(this.testMode, signatureRequestBulkSendWithTemplateRequest.testMode) && + Objects.equals(this.title, signatureRequestBulkSendWithTemplateRequest.title); + } + + @Override + public int hashCode() { + return Objects.hash(templateIds, signerFile, signerList, allowDecline, ccs, clientId, customFields, message, metadata, signingRedirectUrl, subject, testMode, title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestBulkSendWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" signerFile: ").append(toIndentedString(signerFile)).append("\n"); + sb.append(" signerList: ").append(toIndentedString(signerList)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; } - this.templateIds.add(templateIdsItem); - return this; - } - - /** - * Use `template_ids` to create a SignatureRequest from one or more templates, in the - * order in which the template will be used. - * - * @return templateIds - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getTemplateIds() { - return templateIds; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - } - - public SignatureRequestBulkSendWithTemplateRequest signerFile( - @javax.annotation.Nullable File signerFile) { - this.signerFile = signerFile; - return this; - } - - /** - * `signer_file` is a CSV file defining values and options for signer fields. Required - * unless a `signer_list` is used, you may not use both. The CSV can have the - * following columns: - `name`: the name of the signer filling the role of RoleName - - * `email_address`: email address of the signer filling the role of RoleName - - * `pin`: the 4- to 12-character access code that will secure this signer's - * signature page (optional) - `sms_phone_number`: An E.164 formatted phone number - * that will receive a code via SMS to access this signer's signature page. (optional) By - * using the feature, you agree you are responsible for obtaining a signer's consent to - * receive text messages from Dropbox Sign related to this signature request and confirm you - * have obtained such consent from all signers prior to enabling SMS delivery for this signature - * request. [Learn - * more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). - * **NOTE:** Not available in test mode and requires a Standard plan or higher. - - * `*_field`: any column with a _field\" suffix will be treated as a custom field - * (optional) You may only specify field values here, any other options should be set in the - * custom_fields request parameter. Example CSV: ``` name, email_address, pin, - * company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, - * 123 LLC ``` - * - * @return signerFile - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public File getSignerFile() { - return signerFile; - } - @JsonProperty(JSON_PROPERTY_SIGNER_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerFile(@javax.annotation.Nullable File signerFile) { - this.signerFile = signerFile; - } - - public SignatureRequestBulkSendWithTemplateRequest signerList( - @javax.annotation.Nullable List signerList) { - this.signerList = signerList; - return this; - } - - public SignatureRequestBulkSendWithTemplateRequest addSignerListItem( - SubBulkSignerList signerListItem) { - if (this.signerList == null) { - this.signerList = new ArrayList<>(); + if (templateIds.getClass().equals(java.io.File.class) || + templateIds.getClass().equals(Integer.class) || + templateIds.getClass().equals(String.class) || + templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for(int i = 0; i< getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } } - this.signerList.add(signerListItem); - return this; - } - - /** - * `signer_list` is an array defining values and options for signer fields. Required - * unless a `signer_file` is used, you may not use both. - * - * @return signerList - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSignerList() { - return signerList; - } - - @JsonProperty(JSON_PROPERTY_SIGNER_LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerList(@javax.annotation.Nullable List signerList) { - this.signerList = signerList; - } - - public SignatureRequestBulkSendWithTemplateRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - public SignatureRequestBulkSendWithTemplateRequest ccs( - @javax.annotation.Nullable List ccs) { - this.ccs = ccs; - return this; - } - - public SignatureRequestBulkSendWithTemplateRequest addCcsItem(SubCC ccsItem) { - if (this.ccs == null) { - this.ccs = new ArrayList<>(); + else { + map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); } - this.ccs.add(ccsItem); - return this; - } - - /** - * Add CC email recipients. Required when a CC role exists for the Template. - * - * @return ccs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcs() { - return ccs; } - - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcs(@javax.annotation.Nullable List ccs) { - this.ccs = ccs; - } - - public SignatureRequestBulkSendWithTemplateRequest clientId( - @javax.annotation.Nullable String clientId) { - this.clientId = clientId; - return this; - } - - /** - * The client id of the API App you want to associate with this request. Used to apply the - * branding and callback url defined for the app. - * - * @return clientId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - } - - public SignatureRequestBulkSendWithTemplateRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestBulkSendWithTemplateRequest addCustomFieldsItem( - SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + if (signerFile != null) { + if (isFileTypeOrListOfFiles(signerFile)) { + fileTypeFound = true; } - this.customFields.add(customFieldsItem); - return this; - } - - /** - * When used together with merge fields, `custom_fields` allows users to add - * pre-filled data to their signature requests. Pre-filled data can be used with - * \"send-once\" signature requests by adding merge fields with - * `form_fields_per_document` or [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values - * back with `custom_fields` together in one API call. For using pre-filled on - * repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or - * by calling - * [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and - * then passing `custom_fields` on subsequent signature requests referencing that - * template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public SignatureRequestBulkSendWithTemplateRequest message( - @javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public SignatureRequestBulkSendWithTemplateRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestBulkSendWithTemplateRequest putMetadataItem( - String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (signerFile.getClass().equals(java.io.File.class) || + signerFile.getClass().equals(Integer.class) || + signerFile.getClass().equals(String.class) || + signerFile.getClass().isEnum()) { + map.put("signer_file", signerFile); + } else if (isListOfFile(signerFile)) { + for(int i = 0; i< getListSize(signerFile); i++) { + map.put("signer_file[" + i + "]", getFromList(signerFile, i)); + } + } + else { + map.put("signer_file", JSON.getDefault().getMapper().writeValueAsString(signerFile)); } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public SignatureRequestBulkSendWithTemplateRequest signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; } + if (signerList != null) { + if (isFileTypeOrListOfFiles(signerList)) { + fileTypeFound = true; + } - public SignatureRequestBulkSendWithTemplateRequest subject( - @javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (signerList.getClass().equals(java.io.File.class) || + signerList.getClass().equals(Integer.class) || + signerList.getClass().equals(String.class) || + signerList.getClass().isEnum()) { + map.put("signer_list", signerList); + } else if (isListOfFile(signerList)) { + for(int i = 0; i< getListSize(signerList); i++) { + map.put("signer_list[" + i + "]", getFromList(signerList, i)); + } + } + else { + map.put("signer_list", JSON.getDefault().getMapper().writeValueAsString(signerList)); + } } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (ccs.getClass().equals(java.io.File.class) || + ccs.getClass().equals(Integer.class) || + ccs.getClass().equals(String.class) || + ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for(int i = 0; i< getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } + else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } - public SignatureRequestBulkSendWithTemplateRequest testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request will not be legally binding if set to - * `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - public SignatureRequestBulkSendWithTemplateRequest title( - @javax.annotation.Nullable String title) { - this.title = title; - return this; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestBulkSendWithTemplateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest = - (SignatureRequestBulkSendWithTemplateRequest) o; - return Objects.equals( - this.templateIds, signatureRequestBulkSendWithTemplateRequest.templateIds) - && Objects.equals( - this.signerFile, signatureRequestBulkSendWithTemplateRequest.signerFile) - && Objects.equals( - this.signerList, signatureRequestBulkSendWithTemplateRequest.signerList) - && Objects.equals( - this.allowDecline, signatureRequestBulkSendWithTemplateRequest.allowDecline) - && Objects.equals(this.ccs, signatureRequestBulkSendWithTemplateRequest.ccs) - && Objects.equals( - this.clientId, signatureRequestBulkSendWithTemplateRequest.clientId) - && Objects.equals( - this.customFields, signatureRequestBulkSendWithTemplateRequest.customFields) - && Objects.equals(this.message, signatureRequestBulkSendWithTemplateRequest.message) - && Objects.equals( - this.metadata, signatureRequestBulkSendWithTemplateRequest.metadata) - && Objects.equals( - this.signingRedirectUrl, - signatureRequestBulkSendWithTemplateRequest.signingRedirectUrl) - && Objects.equals(this.subject, signatureRequestBulkSendWithTemplateRequest.subject) - && Objects.equals( - this.testMode, signatureRequestBulkSendWithTemplateRequest.testMode) - && Objects.equals(this.title, signatureRequestBulkSendWithTemplateRequest.title); + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - templateIds, - signerFile, - signerList, - allowDecline, - ccs, - clientId, - customFields, - message, - metadata, - signingRedirectUrl, - subject, - testMode, - title); + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestBulkSendWithTemplateRequest {\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" signerFile: ").append(toIndentedString(signerFile)).append("\n"); - sb.append(" signerList: ").append(toIndentedString(signerList)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } - - if (templateIds.getClass().equals(java.io.File.class) - || templateIds.getClass().equals(Integer.class) - || templateIds.getClass().equals(String.class) - || templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for (int i = 0; i < getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } else { - map.put( - "template_ids", - JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } - } - if (signerFile != null) { - if (isFileTypeOrListOfFiles(signerFile)) { - fileTypeFound = true; - } - - if (signerFile.getClass().equals(java.io.File.class) - || signerFile.getClass().equals(Integer.class) - || signerFile.getClass().equals(String.class) - || signerFile.getClass().isEnum()) { - map.put("signer_file", signerFile); - } else if (isListOfFile(signerFile)) { - for (int i = 0; i < getListSize(signerFile); i++) { - map.put("signer_file[" + i + "]", getFromList(signerFile, i)); - } - } else { - map.put( - "signer_file", - JSON.getDefault().getMapper().writeValueAsString(signerFile)); - } - } - if (signerList != null) { - if (isFileTypeOrListOfFiles(signerList)) { - fileTypeFound = true; - } - - if (signerList.getClass().equals(java.io.File.class) - || signerList.getClass().equals(Integer.class) - || signerList.getClass().equals(String.class) - || signerList.getClass().isEnum()) { - map.put("signer_list", signerList); - } else if (isListOfFile(signerList)) { - for (int i = 0; i < getListSize(signerList); i++) { - map.put("signer_list[" + i + "]", getFromList(signerList, i)); - } - } else { - map.put( - "signer_list", - JSON.getDefault().getMapper().writeValueAsString(signerList)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (ccs != null) { - if (isFileTypeOrListOfFiles(ccs)) { - fileTypeFound = true; - } - - if (ccs.getClass().equals(java.io.File.class) - || ccs.getClass().equals(Integer.class) - || ccs.getClass().equals(String.class) - || ccs.getClass().isEnum()) { - map.put("ccs", ccs); - } else if (isListOfFile(ccs)) { - for (int i = 0; i < getListSize(ccs); i++) { - map.put("ccs[" + i + "]", getFromList(ccs, i)); - } - } else { - map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java index 584b42cb2..b3d850e4f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java @@ -10,1542 +10,1496 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubAttachment; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubFieldOptions; +import com.dropbox.sign.model.SubFormFieldGroup; +import com.dropbox.sign.model.SubFormFieldRule; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.model.SubSignatureRequestGroupedSigners; +import com.dropbox.sign.model.SubSignatureRequestSigner; +import com.dropbox.sign.model.SubSigningOptions; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** SignatureRequestCreateEmbeddedRequest */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestCreateEmbeddedRequest + */ @JsonPropertyOrder({ - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FILES, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FILE_URLS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_SIGNERS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_GROUPED_SIGNERS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_REASSIGN, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ATTACHMENTS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FIELD_OPTIONS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_RULES, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_METADATA, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_SIGNING_OPTIONS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_TITLE, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_USE_TEXT_TAGS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FILES, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_GROUPED_SIGNERS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_REASSIGN, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ATTACHMENTS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FIELD_OPTIONS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_RULES, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_METADATA, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_TITLE, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_USE_TEXT_TAGS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestCreateEmbeddedRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nonnull private String clientId; - - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nonnull + private String clientId; - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nullable + private List signers = null; + + public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; + @javax.annotation.Nullable + private List groupedSigners = null; + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @javax.annotation.Nullable + private Boolean allowFormView = false; + + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + @javax.annotation.Nullable + private Boolean allowReassign = false; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + @javax.annotation.Nullable + private List attachments = null; + + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + @javax.annotation.Nullable + private List ccEmailAddresses = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + @javax.annotation.Nullable + private SubFieldOptions fieldOptions; + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + @javax.annotation.Nullable + private List formFieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + @javax.annotation.Nullable + private List formFieldRules = null; + + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + @javax.annotation.Nullable + private List formFieldsPerDocument = null; + + public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; + @javax.annotation.Nullable + private Boolean hideTextTags = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + @javax.annotation.Nullable + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + @javax.annotation.Nullable + private Boolean useTextTags = false; + + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = "populate_auto_fill_fields"; + @javax.annotation.Nullable + private Boolean populateAutoFillFields = false; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public SignatureRequestCreateEmbeddedRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestCreateEmbeddedRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestCreateEmbeddedRequest.class); + } + + static public SignatureRequestCreateEmbeddedRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestCreateEmbeddedRequest.class + ); + } + + public SignatureRequestCreateEmbeddedRequest clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app you're using to create this embedded signature request. Used for security purposes. + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestCreateEmbeddedRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public SignatureRequestCreateEmbeddedRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public SignatureRequestCreateEmbeddedRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public SignatureRequestCreateEmbeddedRequest signers(@javax.annotation.Nullable List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestCreateEmbeddedRequest addSignersItem(SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * @return signers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_SIGNERS = "signers"; - @javax.annotation.Nullable private List signers = null; + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(@javax.annotation.Nullable List signers) { + this.signers = signers; + } + + + public SignatureRequestCreateEmbeddedRequest groupedSigners(@javax.annotation.Nullable List groupedSigners) { + this.groupedSigners = groupedSigners; + return this; + } + + public SignatureRequestCreateEmbeddedRequest addGroupedSignersItem(SubSignatureRequestGroupedSigners groupedSignersItem) { + if (this.groupedSigners == null) { + this.groupedSigners = new ArrayList<>(); + } + this.groupedSigners.add(groupedSignersItem); + return this; + } + + /** + * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * @return groupedSigners + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; + public List getGroupedSigners() { + return groupedSigners; + } + + + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupedSigners(@javax.annotation.Nullable List groupedSigners) { + this.groupedSigners = groupedSigners; + } + + + public SignatureRequestCreateEmbeddedRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestCreateEmbeddedRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. + * @return allowFormView + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + public SignatureRequestCreateEmbeddedRequest allowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } - @javax.annotation.Nullable private List groupedSigners = null; + /** + * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. + * @return allowReassign + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowReassign() { + return allowReassign; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + } + + + public SignatureRequestCreateEmbeddedRequest attachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + return this; + } + + public SignatureRequestCreateEmbeddedRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * A list describing the attachments + * @return attachments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + } + + + public SignatureRequestCreateEmbeddedRequest ccEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; + } + + public SignatureRequestCreateEmbeddedRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); + } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } + + /** + * The email addresses that should be CCed. + * @return ccEmailAddresses + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; - public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; - @javax.annotation.Nullable private Boolean allowFormView = false; + public SignatureRequestCreateEmbeddedRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestCreateEmbeddedRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - @javax.annotation.Nullable private Boolean allowReassign = false; - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - @javax.annotation.Nullable private List attachments = null; + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - @javax.annotation.Nullable private List ccEmailAddresses = null; + public SignatureRequestCreateEmbeddedRequest fieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * @return fieldOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - @javax.annotation.Nullable private SubFieldOptions fieldOptions; + public SignatureRequestCreateEmbeddedRequest formFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } + + public SignatureRequestCreateEmbeddedRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); + } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } + + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * @return formFieldGroups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldGroups() { + return formFieldGroups; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + + public SignatureRequestCreateEmbeddedRequest formFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } + + public SignatureRequestCreateEmbeddedRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); + } + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * @return formFieldRules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldRules() { + return formFieldRules; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + + public SignatureRequestCreateEmbeddedRequest formFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public SignatureRequestCreateEmbeddedRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; + } + + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * @return formFieldsPerDocument + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - @javax.annotation.Nullable private List formFieldGroups = null; - - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - @javax.annotation.Nullable private List formFieldRules = null; - - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - - @javax.annotation.Nullable private List formFieldsPerDocument = null; - - public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; - @javax.annotation.Nullable private Boolean hideTextTags = false; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - @javax.annotation.Nullable private SubSigningOptions signingOptions; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; - @javax.annotation.Nullable private Boolean useTextTags = false; - - public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = - "populate_auto_fill_fields"; - @javax.annotation.Nullable private Boolean populateAutoFillFields = false; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public SignatureRequestCreateEmbeddedRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestCreateEmbeddedRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestCreateEmbeddedRequest.class); + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + + public SignatureRequestCreateEmbeddedRequest hideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; + } + + /** + * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + * @return hideTextTags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHideTextTags() { + return hideTextTags; + } + + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + } + + + public SignatureRequestCreateEmbeddedRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public SignatureRequestCreateEmbeddedRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestCreateEmbeddedRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public SignatureRequestCreateEmbeddedRequest signingOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } - public static SignatureRequestCreateEmbeddedRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestCreateEmbeddedRequest.class); - } + /** + * Get signingOptions + * @return signingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public SignatureRequestCreateEmbeddedRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } - public SignatureRequestCreateEmbeddedRequest clientId( - @javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - return this; - } + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public SignatureRequestCreateEmbeddedRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } - /** - * Client id of the app you're using to create this embedded signature request. Used for - * security purposes. - * - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - } - - public SignatureRequestCreateEmbeddedRequest files( - @javax.annotation.Nullable List files) { - this.files = files; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestCreateEmbeddedRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public SignatureRequestCreateEmbeddedRequest useTextTags(@javax.annotation.Nullable Boolean useTextTags) { + this.useTextTags = useTextTags; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + * @return useTextTags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseTextTags() { + return useTextTags; + } + + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(@javax.annotation.Nullable Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + + public SignatureRequestCreateEmbeddedRequest populateAutoFillFields(@javax.annotation.Nullable Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + return this; + } + + /** + * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + * @return populateAutoFillFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(@javax.annotation.Nullable Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + + public SignatureRequestCreateEmbeddedRequest expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this SignatureRequestCreateEmbeddedRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest = (SignatureRequestCreateEmbeddedRequest) o; + return Objects.equals(this.clientId, signatureRequestCreateEmbeddedRequest.clientId) && + Objects.equals(this.files, signatureRequestCreateEmbeddedRequest.files) && + Objects.equals(this.fileUrls, signatureRequestCreateEmbeddedRequest.fileUrls) && + Objects.equals(this.signers, signatureRequestCreateEmbeddedRequest.signers) && + Objects.equals(this.groupedSigners, signatureRequestCreateEmbeddedRequest.groupedSigners) && + Objects.equals(this.allowDecline, signatureRequestCreateEmbeddedRequest.allowDecline) && + Objects.equals(this.allowFormView, signatureRequestCreateEmbeddedRequest.allowFormView) && + Objects.equals(this.allowReassign, signatureRequestCreateEmbeddedRequest.allowReassign) && + Objects.equals(this.attachments, signatureRequestCreateEmbeddedRequest.attachments) && + Objects.equals(this.ccEmailAddresses, signatureRequestCreateEmbeddedRequest.ccEmailAddresses) && + Objects.equals(this.customFields, signatureRequestCreateEmbeddedRequest.customFields) && + Objects.equals(this.fieldOptions, signatureRequestCreateEmbeddedRequest.fieldOptions) && + Objects.equals(this.formFieldGroups, signatureRequestCreateEmbeddedRequest.formFieldGroups) && + Objects.equals(this.formFieldRules, signatureRequestCreateEmbeddedRequest.formFieldRules) && + Objects.equals(this.formFieldsPerDocument, signatureRequestCreateEmbeddedRequest.formFieldsPerDocument) && + Objects.equals(this.hideTextTags, signatureRequestCreateEmbeddedRequest.hideTextTags) && + Objects.equals(this.message, signatureRequestCreateEmbeddedRequest.message) && + Objects.equals(this.metadata, signatureRequestCreateEmbeddedRequest.metadata) && + Objects.equals(this.signingOptions, signatureRequestCreateEmbeddedRequest.signingOptions) && + Objects.equals(this.subject, signatureRequestCreateEmbeddedRequest.subject) && + Objects.equals(this.testMode, signatureRequestCreateEmbeddedRequest.testMode) && + Objects.equals(this.title, signatureRequestCreateEmbeddedRequest.title) && + Objects.equals(this.useTextTags, signatureRequestCreateEmbeddedRequest.useTextTags) && + Objects.equals(this.populateAutoFillFields, signatureRequestCreateEmbeddedRequest.populateAutoFillFields) && + Objects.equals(this.expiresAt, signatureRequestCreateEmbeddedRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, files, fileUrls, signers, groupedSigners, allowDecline, allowFormView, allowReassign, attachments, ccEmailAddresses, customFields, fieldOptions, formFieldGroups, formFieldRules, formFieldsPerDocument, hideTextTags, message, metadata, signingOptions, subject, testMode, title, useTextTags, populateAutoFillFields, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestCreateEmbeddedRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; } - this.files.add(filesItem); - return this; - } - - /** - * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } - - public SignatureRequestCreateEmbeddedRequest fileUrls( - @javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - public SignatureRequestCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - * This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - public SignatureRequestCreateEmbeddedRequest signers( - @javax.annotation.Nullable List signers) { - this.signers = signers; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addSignersItem( - SubSignatureRequestSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Signature Request. This endpoint requires either **signers** or - * **grouped_signers**, but not both. - * - * @return signers - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSigners() { - return signers; - } - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners(@javax.annotation.Nullable List signers) { - this.signers = signers; - } - - public SignatureRequestCreateEmbeddedRequest groupedSigners( - @javax.annotation.Nullable List groupedSigners) { - this.groupedSigners = groupedSigners; - return this; } - - public SignatureRequestCreateEmbeddedRequest addGroupedSignersItem( - SubSignatureRequestGroupedSigners groupedSignersItem) { - if (this.groupedSigners == null) { - this.groupedSigners = new ArrayList<>(); + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; } - this.groupedSigners.add(groupedSignersItem); - return this; - } - - /** - * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or - * **grouped_signers**, but not both. - * - * @return groupedSigners - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getGroupedSigners() { - return groupedSigners; - } - - @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroupedSigners( - @javax.annotation.Nullable List groupedSigners) { - this.groupedSigners = groupedSigners; - } - - public SignatureRequestCreateEmbeddedRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - public SignatureRequestCreateEmbeddedRequest allowFormView( - @javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - return this; - } - - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to - * `false`. - * - * @return allowFormView - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowFormView() { - return allowFormView; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - } - - public SignatureRequestCreateEmbeddedRequest allowReassign( - @javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - return this; - } - - /** - * Allows signers to reassign their signature requests to other signers if set to - * `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. - * - * @return allowReassign - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowReassign() { - return allowReassign; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - } - - public SignatureRequestCreateEmbeddedRequest attachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * - * @return attachments - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAttachments() { - return attachments; - } - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(@javax.annotation.Nullable List attachments) { - this.attachments = attachments; - } - - public SignatureRequestCreateEmbeddedRequest ccEmailAddresses( - @javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addCcEmailAddressesItem( - String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); } - this.ccEmailAddresses.add(ccEmailAddressesItem); - return this; } - - /** - * The email addresses that should be CCed. - * - * @return ccEmailAddresses - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } - - public SignatureRequestCreateEmbeddedRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addCustomFieldsItem( - SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; } - this.customFields.add(customFieldsItem); - return this; - } - /** - * When used together with merge fields, `custom_fields` allows users to add - * pre-filled data to their signature requests. Pre-filled data can be used with - * \"send-once\" signature requests by adding merge fields with - * `form_fields_per_document` or [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values - * back with `custom_fields` together in one API call. For using pre-filled on - * repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or - * by calling - * [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and - * then passing `custom_fields` on subsequent signature requests referencing that - * template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public SignatureRequestCreateEmbeddedRequest fieldOptions( - @javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * - * @return fieldOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - public SignatureRequestCreateEmbeddedRequest formFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addFormFieldGroupsItem( - SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } } - this.formFieldGroups.add(formFieldGroupsItem); - return this; - } - - /** - * Group information for fields defined in `form_fields_per_document`. String-indexed - * JSON array with `group_label` and `requirement` keys. - * `form_fields_per_document` must contain fields referencing a group defined in - * `form_field_groups`. - * - * @return formFieldGroups - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldGroups() { - return formFieldGroups; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - public SignatureRequestCreateEmbeddedRequest formFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addFormFieldRulesItem( - SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * - * @return formFieldRules - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldRules() { - return formFieldRules; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - public SignatureRequestCreateEmbeddedRequest formFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; } - - public SignatureRequestCreateEmbeddedRequest addFormFieldsPerDocumentItem( - SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; } - this.formFieldsPerDocument.add(formFieldsPerDocumentItem); - return this; - } - - /** - * The fields that should appear on the document, expressed as an array of objects. (For more - * details you can read about it here: [Using Form Fields per - * Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, - * **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and - * optional parameters. Check out the list of [additional - * parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text - * Field use `SubFormFieldsPerDocumentText` * Dropdown Field use - * `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use - * `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use - * `SubFormFieldsPerDocumentCheckbox` * Radio Field use - * `SubFormFieldsPerDocumentRadio` * Signature Field use - * `SubFormFieldsPerDocumentSignature` * Date Signed Field use - * `SubFormFieldsPerDocumentDateSigned` * Initials Field use - * `SubFormFieldsPerDocumentInitials` * Text Merge Field use - * `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use - * `SubFormFieldsPerDocumentCheckboxMerge` - * - * @return formFieldsPerDocument - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } - - public SignatureRequestCreateEmbeddedRequest hideTextTags( - @javax.annotation.Nullable Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - return this; - } - /** - * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way - * can cause unwanted clipping. We recommend leaving this setting on `false` and - * instead hiding your text tags using white text or a similar approach. See the [Text Tags - * Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more - * information. - * - * @return hideTextTags - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHideTextTags() { - return hideTextTags; - } - - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - } - - public SignatureRequestCreateEmbeddedRequest message( - @javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public SignatureRequestCreateEmbeddedRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestCreateEmbeddedRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public SignatureRequestCreateEmbeddedRequest signingOptions( - @javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; - } - - /** - * Get signingOptions - * - * @return signingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubSigningOptions getSigningOptions() { - return signingOptions; } + if (groupedSigners != null) { + if (isFileTypeOrListOfFiles(groupedSigners)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; + if (groupedSigners.getClass().equals(java.io.File.class) || + groupedSigners.getClass().equals(Integer.class) || + groupedSigners.getClass().equals(String.class) || + groupedSigners.getClass().isEnum()) { + map.put("grouped_signers", groupedSigners); + } else if (isListOfFile(groupedSigners)) { + for(int i = 0; i< getListSize(groupedSigners); i++) { + map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); + } + } + else { + map.put("grouped_signers", JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); + } } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } - public SignatureRequestCreateEmbeddedRequest subject( - @javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (allowReassign.getClass().equals(java.io.File.class) || + allowReassign.getClass().equals(Integer.class) || + allowReassign.getClass().equals(String.class) || + allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for(int i = 0; i< getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } + else { + map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } - public SignatureRequestCreateEmbeddedRequest testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + } } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request will not be legally binding if set to - * `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (ccEmailAddresses.getClass().equals(java.io.File.class) || + ccEmailAddresses.getClass().equals(Integer.class) || + ccEmailAddresses.getClass().equals(String.class) || + ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for(int i = 0; i< getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } + else { + map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } - public SignatureRequestCreateEmbeddedRequest title(@javax.annotation.Nullable String title) { - this.title = title; - return this; + if (fieldOptions.getClass().equals(java.io.File.class) || + fieldOptions.getClass().equals(Integer.class) || + fieldOptions.getClass().equals(String.class) || + fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for(int i = 0; i< getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } + else { + map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (formFieldGroups.getClass().equals(java.io.File.class) || + formFieldGroups.getClass().equals(Integer.class) || + formFieldGroups.getClass().equals(String.class) || + formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for(int i = 0; i< getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } + else { + map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (formFieldRules.getClass().equals(java.io.File.class) || + formFieldRules.getClass().equals(Integer.class) || + formFieldRules.getClass().equals(String.class) || + formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for(int i = 0; i< getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } + else { + map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } - public SignatureRequestCreateEmbeddedRequest useTextTags( - @javax.annotation.Nullable Boolean useTextTags) { - this.useTextTags = useTextTags; - return this; + if (formFieldsPerDocument.getClass().equals(java.io.File.class) || + formFieldsPerDocument.getClass().equals(Integer.class) || + formFieldsPerDocument.getClass().equals(String.class) || + formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { + map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); + } + } + else { + map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); + } } + if (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } - /** - * Send with a value of `true` if you wish to enable [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your - * document. Defaults to disabled, or `false`. - * - * @return useTextTags - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getUseTextTags() { - return useTextTags; + if (hideTextTags.getClass().equals(java.io.File.class) || + hideTextTags.getClass().equals(Integer.class) || + hideTextTags.getClass().equals(String.class) || + hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for(int i = 0; i< getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } + else { + map.put("hide_text_tags", JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUseTextTags(@javax.annotation.Nullable Boolean useTextTags) { - this.useTextTags = useTextTags; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - public SignatureRequestCreateEmbeddedRequest populateAutoFillFields( - @javax.annotation.Nullable Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; - return this; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } - /** - * Controls whether [auto fill - * fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can - * automatically populate a signer's information during signing. **NOTE:** Keep your - * signer's information safe by ensuring that the _signer on your signature request is the - * intended party_ before using this feature. - * - * @return populateAutoFillFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPopulateAutoFillFields() { - return populateAutoFillFields; + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPopulateAutoFillFields( - @javax.annotation.Nullable Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - public SignatureRequestCreateEmbeddedRequest expiresAt( - @javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - /** - * When the signature request will expire. Unsigned signatures will be moved to the expired - * status, and no longer signable. See [Signature Request Expiration - * Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; + if (useTextTags.getClass().equals(java.io.File.class) || + useTextTags.getClass().equals(Integer.class) || + useTextTags.getClass().equals(String.class) || + useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for(int i = 0; i< getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } + else { + map.put("use_text_tags", JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestCreateEmbeddedRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest = - (SignatureRequestCreateEmbeddedRequest) o; - return Objects.equals(this.clientId, signatureRequestCreateEmbeddedRequest.clientId) - && Objects.equals(this.files, signatureRequestCreateEmbeddedRequest.files) - && Objects.equals(this.fileUrls, signatureRequestCreateEmbeddedRequest.fileUrls) - && Objects.equals(this.signers, signatureRequestCreateEmbeddedRequest.signers) - && Objects.equals( - this.groupedSigners, signatureRequestCreateEmbeddedRequest.groupedSigners) - && Objects.equals( - this.allowDecline, signatureRequestCreateEmbeddedRequest.allowDecline) - && Objects.equals( - this.allowFormView, signatureRequestCreateEmbeddedRequest.allowFormView) - && Objects.equals( - this.allowReassign, signatureRequestCreateEmbeddedRequest.allowReassign) - && Objects.equals( - this.attachments, signatureRequestCreateEmbeddedRequest.attachments) - && Objects.equals( - this.ccEmailAddresses, - signatureRequestCreateEmbeddedRequest.ccEmailAddresses) - && Objects.equals( - this.customFields, signatureRequestCreateEmbeddedRequest.customFields) - && Objects.equals( - this.fieldOptions, signatureRequestCreateEmbeddedRequest.fieldOptions) - && Objects.equals( - this.formFieldGroups, signatureRequestCreateEmbeddedRequest.formFieldGroups) - && Objects.equals( - this.formFieldRules, signatureRequestCreateEmbeddedRequest.formFieldRules) - && Objects.equals( - this.formFieldsPerDocument, - signatureRequestCreateEmbeddedRequest.formFieldsPerDocument) - && Objects.equals( - this.hideTextTags, signatureRequestCreateEmbeddedRequest.hideTextTags) - && Objects.equals(this.message, signatureRequestCreateEmbeddedRequest.message) - && Objects.equals(this.metadata, signatureRequestCreateEmbeddedRequest.metadata) - && Objects.equals( - this.signingOptions, signatureRequestCreateEmbeddedRequest.signingOptions) - && Objects.equals(this.subject, signatureRequestCreateEmbeddedRequest.subject) - && Objects.equals(this.testMode, signatureRequestCreateEmbeddedRequest.testMode) - && Objects.equals(this.title, signatureRequestCreateEmbeddedRequest.title) - && Objects.equals( - this.useTextTags, signatureRequestCreateEmbeddedRequest.useTextTags) - && Objects.equals( - this.populateAutoFillFields, - signatureRequestCreateEmbeddedRequest.populateAutoFillFields) - && Objects.equals(this.expiresAt, signatureRequestCreateEmbeddedRequest.expiresAt); + if (populateAutoFillFields.getClass().equals(java.io.File.class) || + populateAutoFillFields.getClass().equals(Integer.class) || + populateAutoFillFields.getClass().equals(String.class) || + populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for(int i = 0; i< getListSize(populateAutoFillFields); i++) { + map.put("populate_auto_fill_fields[" + i + "]", getFromList(populateAutoFillFields, i)); + } + } + else { + map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - clientId, - files, - fileUrls, - signers, - groupedSigners, - allowDecline, - allowFormView, - allowReassign, - attachments, - ccEmailAddresses, - customFields, - fieldOptions, - formFieldGroups, - formFieldRules, - formFieldsPerDocument, - hideTextTags, - message, - metadata, - signingOptions, - subject, - testMode, - title, - useTextTags, - populateAutoFillFields, - expiresAt); + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestCreateEmbeddedRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" formFieldsPerDocument: ") - .append(toIndentedString(formFieldsPerDocument)) - .append("\n"); - sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); - sb.append(" populateAutoFillFields: ") - .append(toIndentedString(populateAutoFillFields)) - .append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - if (groupedSigners != null) { - if (isFileTypeOrListOfFiles(groupedSigners)) { - fileTypeFound = true; - } - - if (groupedSigners.getClass().equals(java.io.File.class) - || groupedSigners.getClass().equals(Integer.class) - || groupedSigners.getClass().equals(String.class) - || groupedSigners.getClass().isEnum()) { - map.put("grouped_signers", groupedSigners); - } else if (isListOfFile(groupedSigners)) { - for (int i = 0; i < getListSize(groupedSigners); i++) { - map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); - } - } else { - map.put( - "grouped_signers", - JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (allowFormView != null) { - if (isFileTypeOrListOfFiles(allowFormView)) { - fileTypeFound = true; - } - - if (allowFormView.getClass().equals(java.io.File.class) - || allowFormView.getClass().equals(Integer.class) - || allowFormView.getClass().equals(String.class) - || allowFormView.getClass().isEnum()) { - map.put("allow_form_view", allowFormView); - } else if (isListOfFile(allowFormView)) { - for (int i = 0; i < getListSize(allowFormView); i++) { - map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); - } - } else { - map.put( - "allow_form_view", - JSON.getDefault().getMapper().writeValueAsString(allowFormView)); - } - } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - - if (allowReassign.getClass().equals(java.io.File.class) - || allowReassign.getClass().equals(Integer.class) - || allowReassign.getClass().equals(String.class) - || allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for (int i = 0; i < getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } else { - map.put( - "allow_reassign", - JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } - } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - - if (attachments.getClass().equals(java.io.File.class) - || attachments.getClass().equals(Integer.class) - || attachments.getClass().equals(String.class) - || attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for (int i = 0; i < getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } else { - map.put( - "attachments", - JSON.getDefault().getMapper().writeValueAsString(attachments)); - } - } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - - if (ccEmailAddresses.getClass().equals(java.io.File.class) - || ccEmailAddresses.getClass().equals(Integer.class) - || ccEmailAddresses.getClass().equals(String.class) - || ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for (int i = 0; i < getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } else { - map.put( - "cc_email_addresses", - JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - - if (fieldOptions.getClass().equals(java.io.File.class) - || fieldOptions.getClass().equals(Integer.class) - || fieldOptions.getClass().equals(String.class) - || fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for (int i = 0; i < getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } else { - map.put( - "field_options", - JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } - } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - - if (formFieldGroups.getClass().equals(java.io.File.class) - || formFieldGroups.getClass().equals(Integer.class) - || formFieldGroups.getClass().equals(String.class) - || formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for (int i = 0; i < getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } else { - map.put( - "form_field_groups", - JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } - } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - - if (formFieldRules.getClass().equals(java.io.File.class) - || formFieldRules.getClass().equals(Integer.class) - || formFieldRules.getClass().equals(String.class) - || formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for (int i = 0; i < getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } else { - map.put( - "form_field_rules", - JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } - } - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - - if (formFieldsPerDocument.getClass().equals(java.io.File.class) - || formFieldsPerDocument.getClass().equals(Integer.class) - || formFieldsPerDocument.getClass().equals(String.class) - || formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { - map.put( - "form_fields_per_document[" + i + "]", - getFromList(formFieldsPerDocument, i)); - } - } else { - map.put( - "form_fields_per_document", - JSON.getDefault() - .getMapper() - .writeValueAsString(formFieldsPerDocument)); - } - } - if (hideTextTags != null) { - if (isFileTypeOrListOfFiles(hideTextTags)) { - fileTypeFound = true; - } - - if (hideTextTags.getClass().equals(java.io.File.class) - || hideTextTags.getClass().equals(Integer.class) - || hideTextTags.getClass().equals(String.class) - || hideTextTags.getClass().isEnum()) { - map.put("hide_text_tags", hideTextTags); - } else if (isListOfFile(hideTextTags)) { - for (int i = 0; i < getListSize(hideTextTags); i++) { - map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); - } - } else { - map.put( - "hide_text_tags", - JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - - if (signingOptions.getClass().equals(java.io.File.class) - || signingOptions.getClass().equals(Integer.class) - || signingOptions.getClass().equals(String.class) - || signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for (int i = 0; i < getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } else { - map.put( - "signing_options", - JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (useTextTags != null) { - if (isFileTypeOrListOfFiles(useTextTags)) { - fileTypeFound = true; - } - - if (useTextTags.getClass().equals(java.io.File.class) - || useTextTags.getClass().equals(Integer.class) - || useTextTags.getClass().equals(String.class) - || useTextTags.getClass().isEnum()) { - map.put("use_text_tags", useTextTags); - } else if (isListOfFile(useTextTags)) { - for (int i = 0; i < getListSize(useTextTags); i++) { - map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); - } - } else { - map.put( - "use_text_tags", - JSON.getDefault().getMapper().writeValueAsString(useTextTags)); - } - } - if (populateAutoFillFields != null) { - if (isFileTypeOrListOfFiles(populateAutoFillFields)) { - fileTypeFound = true; - } - - if (populateAutoFillFields.getClass().equals(java.io.File.class) - || populateAutoFillFields.getClass().equals(Integer.class) - || populateAutoFillFields.getClass().equals(String.class) - || populateAutoFillFields.getClass().isEnum()) { - map.put("populate_auto_fill_fields", populateAutoFillFields); - } else if (isListOfFile(populateAutoFillFields)) { - for (int i = 0; i < getListSize(populateAutoFillFields); i++) { - map.put( - "populate_auto_fill_fields[" + i + "]", - getFromList(populateAutoFillFields, i)); - } - } else { - map.put( - "populate_auto_fill_fields", - JSON.getDefault() - .getMapper() - .writeValueAsString(populateAutoFillFields)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java index a6b8c00ec..e0c004002 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java @@ -10,968 +10,949 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubCC; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubSignatureRequestTemplateSigner; +import com.dropbox.sign.model.SubSigningOptions; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** SignatureRequestCreateEmbeddedWithTemplateRequest */ +import com.dropbox.sign.ApiException; +/** + * SignatureRequestCreateEmbeddedWithTemplateRequest + */ @JsonPropertyOrder({ - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNERS, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILES, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILE_URLS, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILES, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestCreateEmbeddedWithTemplateRequest { - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - @javax.annotation.Nonnull private List templateIds = new ArrayList<>(); - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nonnull private String clientId; - - public static final String JSON_PROPERTY_SIGNERS = "signers"; - - @javax.annotation.Nonnull - private List signers = new ArrayList<>(); - - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; - - public static final String JSON_PROPERTY_CCS = "ccs"; - @javax.annotation.Nullable private List ccs = null; - - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + @javax.annotation.Nonnull + private List templateIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nonnull + private String clientId; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nonnull + private List signers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_CCS = "ccs"; + @javax.annotation.Nullable + private List ccs = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + @javax.annotation.Nullable + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = "populate_auto_fill_fields"; + @javax.annotation.Nullable + private Boolean populateAutoFillFields = false; + + public SignatureRequestCreateEmbeddedWithTemplateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestCreateEmbeddedWithTemplateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestCreateEmbeddedWithTemplateRequest.class); + } + + static public SignatureRequestCreateEmbeddedWithTemplateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestCreateEmbeddedWithTemplateRequest.class + ); + } + + public SignatureRequestCreateEmbeddedWithTemplateRequest templateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + return this; + } + + public SignatureRequestCreateEmbeddedWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @return templateIds + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTemplateIds() { + return templateIds; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + } + + + public SignatureRequestCreateEmbeddedWithTemplateRequest clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app you're using to create this embedded signature request. Used for security purposes. + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestCreateEmbeddedWithTemplateRequest signers(@javax.annotation.Nonnull List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestCreateEmbeddedWithTemplateRequest addSignersItem(SubSignatureRequestTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Templated-based Signature Request. + * @return signers + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigners(@javax.annotation.Nonnull List signers) { + this.signers = signers; + } + + + public SignatureRequestCreateEmbeddedWithTemplateRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestCreateEmbeddedWithTemplateRequest ccs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + return this; + } - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - @javax.annotation.Nullable private SubSigningOptions signingOptions; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = - "populate_auto_fill_fields"; - @javax.annotation.Nullable private Boolean populateAutoFillFields = false; - - public SignatureRequestCreateEmbeddedWithTemplateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestCreateEmbeddedWithTemplateRequest init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestCreateEmbeddedWithTemplateRequest.class); + public SignatureRequestCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); } + this.ccs.add(ccsItem); + return this; + } + + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * @return ccs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcs() { + return ccs; + } + + + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + } - public static SignatureRequestCreateEmbeddedWithTemplateRequest init(HashMap data) - throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestCreateEmbeddedWithTemplateRequest.class); - } - public SignatureRequestCreateEmbeddedWithTemplateRequest templateIds( - @javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - return this; - } + public SignatureRequestCreateEmbeddedWithTemplateRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestCreateEmbeddedWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array defining values and options for custom fields. Required when a custom field exists in the Template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + - public SignatureRequestCreateEmbeddedWithTemplateRequest addTemplateIdsItem( - String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); - } - this.templateIds.add(templateIdsItem); - return this; - } - - /** - * Use `template_ids` to create a SignatureRequest from one or more templates, in the - * order in which the template will be used. - * - * @return templateIds - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getTemplateIds() { - return templateIds; - } + public SignatureRequestCreateEmbeddedWithTemplateRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public SignatureRequestCreateEmbeddedWithTemplateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - } - public SignatureRequestCreateEmbeddedWithTemplateRequest clientId( - @javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - return this; - } + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public SignatureRequestCreateEmbeddedWithTemplateRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestCreateEmbeddedWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public SignatureRequestCreateEmbeddedWithTemplateRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public SignatureRequestCreateEmbeddedWithTemplateRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestCreateEmbeddedWithTemplateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } - /** - * Client id of the app you're using to create this embedded signature request. Used for - * security purposes. - * - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientId() { - return clientId; - } - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest signers( - @javax.annotation.Nonnull List signers) { - this.signers = signers; - return this; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest addSignersItem( - SubSignatureRequestTemplateSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + public SignatureRequestCreateEmbeddedWithTemplateRequest signingOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * @return signingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public SignatureRequestCreateEmbeddedWithTemplateRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public SignatureRequestCreateEmbeddedWithTemplateRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestCreateEmbeddedWithTemplateRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public SignatureRequestCreateEmbeddedWithTemplateRequest populateAutoFillFields(@javax.annotation.Nullable Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + return this; + } + + /** + * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + * @return populateAutoFillFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(@javax.annotation.Nullable Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + + /** + * Return true if this SignatureRequestCreateEmbeddedWithTemplateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest = (SignatureRequestCreateEmbeddedWithTemplateRequest) o; + return Objects.equals(this.templateIds, signatureRequestCreateEmbeddedWithTemplateRequest.templateIds) && + Objects.equals(this.clientId, signatureRequestCreateEmbeddedWithTemplateRequest.clientId) && + Objects.equals(this.signers, signatureRequestCreateEmbeddedWithTemplateRequest.signers) && + Objects.equals(this.allowDecline, signatureRequestCreateEmbeddedWithTemplateRequest.allowDecline) && + Objects.equals(this.ccs, signatureRequestCreateEmbeddedWithTemplateRequest.ccs) && + Objects.equals(this.customFields, signatureRequestCreateEmbeddedWithTemplateRequest.customFields) && + Objects.equals(this.files, signatureRequestCreateEmbeddedWithTemplateRequest.files) && + Objects.equals(this.fileUrls, signatureRequestCreateEmbeddedWithTemplateRequest.fileUrls) && + Objects.equals(this.message, signatureRequestCreateEmbeddedWithTemplateRequest.message) && + Objects.equals(this.metadata, signatureRequestCreateEmbeddedWithTemplateRequest.metadata) && + Objects.equals(this.signingOptions, signatureRequestCreateEmbeddedWithTemplateRequest.signingOptions) && + Objects.equals(this.subject, signatureRequestCreateEmbeddedWithTemplateRequest.subject) && + Objects.equals(this.testMode, signatureRequestCreateEmbeddedWithTemplateRequest.testMode) && + Objects.equals(this.title, signatureRequestCreateEmbeddedWithTemplateRequest.title) && + Objects.equals(this.populateAutoFillFields, signatureRequestCreateEmbeddedWithTemplateRequest.populateAutoFillFields); + } + + @Override + public int hashCode() { + return Objects.hash(templateIds, clientId, signers, allowDecline, ccs, customFields, files, fileUrls, message, metadata, signingOptions, subject, testMode, title, populateAutoFillFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestCreateEmbeddedWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; } - this.signers.add(signersItem); - return this; - } - /** - * Add Signers to your Templated-based Signature Request. - * - * @return signers - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getSigners() { - return signers; - } - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSigners( - @javax.annotation.Nonnull List signers) { - this.signers = signers; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest ccs( - @javax.annotation.Nullable List ccs) { - this.ccs = ccs; - return this; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { - if (this.ccs == null) { - this.ccs = new ArrayList<>(); + if (templateIds.getClass().equals(java.io.File.class) || + templateIds.getClass().equals(Integer.class) || + templateIds.getClass().equals(String.class) || + templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for(int i = 0; i< getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } } - this.ccs.add(ccsItem); - return this; - } - - /** - * Add CC email recipients. Required when a CC role exists for the Template. - * - * @return ccs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcs() { - return ccs; - } - - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcs(@javax.annotation.Nullable List ccs) { - this.ccs = ccs; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest addCustomFieldsItem( - SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + else { + map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); } - this.customFields.add(customFieldsItem); - return this; - } - - /** - * An array defining values and options for custom fields. Required when a custom field exists - * in the Template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest files( - @javax.annotation.Nullable List files) { - this.files = files; - return this; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; } - this.files.add(filesItem); - return this; - } - - /** - * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest fileUrls( - @javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - public SignatureRequestCreateEmbeddedWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - * This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest message( - @javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest putMetadataItem( - String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest signingOptions( - @javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; - } - - /** - * Get signingOptions - * - * @return signingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubSigningOptions getSigningOptions() { - return signingOptions; - } - - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest subject( - @javax.annotation.Nullable String subject) { - this.subject = subject; - return this; } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } - public SignatureRequestCreateEmbeddedWithTemplateRequest testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (ccs.getClass().equals(java.io.File.class) || + ccs.getClass().equals(Integer.class) || + ccs.getClass().equals(String.class) || + ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for(int i = 0; i< getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } + else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request will not be legally binding if set to - * `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } - public SignatureRequestCreateEmbeddedWithTemplateRequest title( - @javax.annotation.Nullable String title) { - this.title = title; - return this; + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } - public SignatureRequestCreateEmbeddedWithTemplateRequest populateAutoFillFields( - @javax.annotation.Nullable Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; - return this; + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - /** - * Controls whether [auto fill - * fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can - * automatically populate a signer's information during signing. **NOTE:** Keep your - * signer's information safe by ensuring that the _signer on your signature request is the - * intended party_ before using this feature. - * - * @return populateAutoFillFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPopulateAutoFillFields() { - return populateAutoFillFields; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPopulateAutoFillFields( - @javax.annotation.Nullable Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - /** - * Return true if this SignatureRequestCreateEmbeddedWithTemplateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestCreateEmbeddedWithTemplateRequest - signatureRequestCreateEmbeddedWithTemplateRequest = - (SignatureRequestCreateEmbeddedWithTemplateRequest) o; - return Objects.equals( - this.templateIds, - signatureRequestCreateEmbeddedWithTemplateRequest.templateIds) - && Objects.equals( - this.clientId, signatureRequestCreateEmbeddedWithTemplateRequest.clientId) - && Objects.equals( - this.signers, signatureRequestCreateEmbeddedWithTemplateRequest.signers) - && Objects.equals( - this.allowDecline, - signatureRequestCreateEmbeddedWithTemplateRequest.allowDecline) - && Objects.equals(this.ccs, signatureRequestCreateEmbeddedWithTemplateRequest.ccs) - && Objects.equals( - this.customFields, - signatureRequestCreateEmbeddedWithTemplateRequest.customFields) - && Objects.equals( - this.files, signatureRequestCreateEmbeddedWithTemplateRequest.files) - && Objects.equals( - this.fileUrls, signatureRequestCreateEmbeddedWithTemplateRequest.fileUrls) - && Objects.equals( - this.message, signatureRequestCreateEmbeddedWithTemplateRequest.message) - && Objects.equals( - this.metadata, signatureRequestCreateEmbeddedWithTemplateRequest.metadata) - && Objects.equals( - this.signingOptions, - signatureRequestCreateEmbeddedWithTemplateRequest.signingOptions) - && Objects.equals( - this.subject, signatureRequestCreateEmbeddedWithTemplateRequest.subject) - && Objects.equals( - this.testMode, signatureRequestCreateEmbeddedWithTemplateRequest.testMode) - && Objects.equals( - this.title, signatureRequestCreateEmbeddedWithTemplateRequest.title) - && Objects.equals( - this.populateAutoFillFields, - signatureRequestCreateEmbeddedWithTemplateRequest.populateAutoFillFields); + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - templateIds, - clientId, - signers, - allowDecline, - ccs, - customFields, - files, - fileUrls, - message, - metadata, - signingOptions, - subject, - testMode, - title, - populateAutoFillFields); + if (populateAutoFillFields.getClass().equals(java.io.File.class) || + populateAutoFillFields.getClass().equals(Integer.class) || + populateAutoFillFields.getClass().equals(String.class) || + populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for(int i = 0; i< getListSize(populateAutoFillFields); i++) { + map.put("populate_auto_fill_fields[" + i + "]", getFromList(populateAutoFillFields, i)); + } + } + else { + map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestCreateEmbeddedWithTemplateRequest {\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" populateAutoFillFields: ") - .append(toIndentedString(populateAutoFillFields)) - .append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } - - if (templateIds.getClass().equals(java.io.File.class) - || templateIds.getClass().equals(Integer.class) - || templateIds.getClass().equals(String.class) - || templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for (int i = 0; i < getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } else { - map.put( - "template_ids", - JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (ccs != null) { - if (isFileTypeOrListOfFiles(ccs)) { - fileTypeFound = true; - } - - if (ccs.getClass().equals(java.io.File.class) - || ccs.getClass().equals(Integer.class) - || ccs.getClass().equals(String.class) - || ccs.getClass().isEnum()) { - map.put("ccs", ccs); - } else if (isListOfFile(ccs)) { - for (int i = 0; i < getListSize(ccs); i++) { - map.put("ccs[" + i + "]", getFromList(ccs, i)); - } - } else { - map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - - if (signingOptions.getClass().equals(java.io.File.class) - || signingOptions.getClass().equals(Integer.class) - || signingOptions.getClass().equals(String.class) - || signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for (int i = 0; i < getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } else { - map.put( - "signing_options", - JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (populateAutoFillFields != null) { - if (isFileTypeOrListOfFiles(populateAutoFillFields)) { - fileTypeFound = true; - } - - if (populateAutoFillFields.getClass().equals(java.io.File.class) - || populateAutoFillFields.getClass().equals(Integer.class) - || populateAutoFillFields.getClass().equals(String.class) - || populateAutoFillFields.getClass().isEnum()) { - map.put("populate_auto_fill_fields", populateAutoFillFields); - } else if (isListOfFile(populateAutoFillFields)) { - for (int i = 0; i < getListSize(populateAutoFillFields); i++) { - map.put( - "populate_auto_fill_fields[" + i + "]", - getFromList(populateAutoFillFields, i)); - } - } else { - map.put( - "populate_auto_fill_fields", - JSON.getDefault() - .getMapper() - .writeValueAsString(populateAutoFillFields)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedRequest.java index d6a528648..9bb6dfdfe 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedRequest.java @@ -10,1535 +10,1496 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubAttachment; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubFieldOptions; +import com.dropbox.sign.model.SubFormFieldGroup; +import com.dropbox.sign.model.SubFormFieldRule; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.model.SubSignatureRequestGroupedSigners; +import com.dropbox.sign.model.SubSignatureRequestSigner; +import com.dropbox.sign.model.SubSigningOptions; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** SignatureRequestEditEmbeddedRequest */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestEditEmbeddedRequest + */ @JsonPropertyOrder({ - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FILES, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FILE_URLS, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_SIGNERS, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_GROUPED_SIGNERS, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ALLOW_REASSIGN, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ATTACHMENTS, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FIELD_OPTIONS, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_RULES, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_METADATA, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_SIGNING_OPTIONS, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_TITLE, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_USE_TEXT_TAGS, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, - SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FILES, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_GROUPED_SIGNERS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ALLOW_REASSIGN, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_ATTACHMENTS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FIELD_OPTIONS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_RULES, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_METADATA, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_TITLE, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_USE_TEXT_TAGS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, + SignatureRequestEditEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestEditEmbeddedRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nonnull private String clientId; - - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nonnull + private String clientId; - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nullable + private List signers = null; + + public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; + @javax.annotation.Nullable + private List groupedSigners = null; + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @javax.annotation.Nullable + private Boolean allowFormView = false; + + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + @javax.annotation.Nullable + private Boolean allowReassign = false; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + @javax.annotation.Nullable + private List attachments = null; + + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + @javax.annotation.Nullable + private List ccEmailAddresses = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + @javax.annotation.Nullable + private SubFieldOptions fieldOptions; + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + @javax.annotation.Nullable + private List formFieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + @javax.annotation.Nullable + private List formFieldRules = null; + + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + @javax.annotation.Nullable + private List formFieldsPerDocument = null; + + public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; + @javax.annotation.Nullable + private Boolean hideTextTags = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + @javax.annotation.Nullable + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + @javax.annotation.Nullable + private Boolean useTextTags = false; + + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = "populate_auto_fill_fields"; + @javax.annotation.Nullable + private Boolean populateAutoFillFields = false; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public SignatureRequestEditEmbeddedRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestEditEmbeddedRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestEditEmbeddedRequest.class); + } + + static public SignatureRequestEditEmbeddedRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestEditEmbeddedRequest.class + ); + } + + public SignatureRequestEditEmbeddedRequest clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app you're using to create this embedded signature request. Used for security purposes. + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestEditEmbeddedRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public SignatureRequestEditEmbeddedRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public SignatureRequestEditEmbeddedRequest signers(@javax.annotation.Nullable List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestEditEmbeddedRequest addSignersItem(SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * @return signers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_SIGNERS = "signers"; - @javax.annotation.Nullable private List signers = null; + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(@javax.annotation.Nullable List signers) { + this.signers = signers; + } + + + public SignatureRequestEditEmbeddedRequest groupedSigners(@javax.annotation.Nullable List groupedSigners) { + this.groupedSigners = groupedSigners; + return this; + } + + public SignatureRequestEditEmbeddedRequest addGroupedSignersItem(SubSignatureRequestGroupedSigners groupedSignersItem) { + if (this.groupedSigners == null) { + this.groupedSigners = new ArrayList<>(); + } + this.groupedSigners.add(groupedSignersItem); + return this; + } + + /** + * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * @return groupedSigners + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; + public List getGroupedSigners() { + return groupedSigners; + } + + + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupedSigners(@javax.annotation.Nullable List groupedSigners) { + this.groupedSigners = groupedSigners; + } + + + public SignatureRequestEditEmbeddedRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestEditEmbeddedRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. + * @return allowFormView + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + public SignatureRequestEditEmbeddedRequest allowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } - @javax.annotation.Nullable private List groupedSigners = null; + /** + * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. + * @return allowReassign + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowReassign() { + return allowReassign; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + } + + + public SignatureRequestEditEmbeddedRequest attachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + return this; + } + + public SignatureRequestEditEmbeddedRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * A list describing the attachments + * @return attachments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + } + + + public SignatureRequestEditEmbeddedRequest ccEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; + } + + public SignatureRequestEditEmbeddedRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); + } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } + + /** + * The email addresses that should be CCed. + * @return ccEmailAddresses + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; - public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; - @javax.annotation.Nullable private Boolean allowFormView = false; + public SignatureRequestEditEmbeddedRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestEditEmbeddedRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - @javax.annotation.Nullable private Boolean allowReassign = false; - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - @javax.annotation.Nullable private List attachments = null; + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - @javax.annotation.Nullable private List ccEmailAddresses = null; + public SignatureRequestEditEmbeddedRequest fieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * @return fieldOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - @javax.annotation.Nullable private SubFieldOptions fieldOptions; + public SignatureRequestEditEmbeddedRequest formFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); + } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } + + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * @return formFieldGroups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldGroups() { + return formFieldGroups; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + + public SignatureRequestEditEmbeddedRequest formFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); + } + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * @return formFieldRules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldRules() { + return formFieldRules; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + + public SignatureRequestEditEmbeddedRequest formFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public SignatureRequestEditEmbeddedRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; + } + + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * @return formFieldsPerDocument + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - @javax.annotation.Nullable private List formFieldGroups = null; - - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - @javax.annotation.Nullable private List formFieldRules = null; - - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - - @javax.annotation.Nullable private List formFieldsPerDocument = null; - - public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; - @javax.annotation.Nullable private Boolean hideTextTags = false; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - @javax.annotation.Nullable private SubSigningOptions signingOptions; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; - @javax.annotation.Nullable private Boolean useTextTags = false; - - public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = - "populate_auto_fill_fields"; - @javax.annotation.Nullable private Boolean populateAutoFillFields = false; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public SignatureRequestEditEmbeddedRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestEditEmbeddedRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestEditEmbeddedRequest.class); + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + + public SignatureRequestEditEmbeddedRequest hideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; + } + + /** + * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + * @return hideTextTags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHideTextTags() { + return hideTextTags; + } + + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + } + + + public SignatureRequestEditEmbeddedRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public SignatureRequestEditEmbeddedRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestEditEmbeddedRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public SignatureRequestEditEmbeddedRequest signingOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } - public static SignatureRequestEditEmbeddedRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestEditEmbeddedRequest.class); - } + /** + * Get signingOptions + * @return signingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public SignatureRequestEditEmbeddedRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } - public SignatureRequestEditEmbeddedRequest clientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - return this; - } + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public SignatureRequestEditEmbeddedRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } - /** - * Client id of the app you're using to create this embedded signature request. Used for - * security purposes. - * - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - } - - public SignatureRequestEditEmbeddedRequest files(@javax.annotation.Nullable List files) { - this.files = files; - return this; - } - - public SignatureRequestEditEmbeddedRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestEditEmbeddedRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public SignatureRequestEditEmbeddedRequest useTextTags(@javax.annotation.Nullable Boolean useTextTags) { + this.useTextTags = useTextTags; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + * @return useTextTags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseTextTags() { + return useTextTags; + } + + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(@javax.annotation.Nullable Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + + public SignatureRequestEditEmbeddedRequest populateAutoFillFields(@javax.annotation.Nullable Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + return this; + } + + /** + * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + * @return populateAutoFillFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(@javax.annotation.Nullable Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + + public SignatureRequestEditEmbeddedRequest expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this SignatureRequestEditEmbeddedRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest = (SignatureRequestEditEmbeddedRequest) o; + return Objects.equals(this.clientId, signatureRequestEditEmbeddedRequest.clientId) && + Objects.equals(this.files, signatureRequestEditEmbeddedRequest.files) && + Objects.equals(this.fileUrls, signatureRequestEditEmbeddedRequest.fileUrls) && + Objects.equals(this.signers, signatureRequestEditEmbeddedRequest.signers) && + Objects.equals(this.groupedSigners, signatureRequestEditEmbeddedRequest.groupedSigners) && + Objects.equals(this.allowDecline, signatureRequestEditEmbeddedRequest.allowDecline) && + Objects.equals(this.allowFormView, signatureRequestEditEmbeddedRequest.allowFormView) && + Objects.equals(this.allowReassign, signatureRequestEditEmbeddedRequest.allowReassign) && + Objects.equals(this.attachments, signatureRequestEditEmbeddedRequest.attachments) && + Objects.equals(this.ccEmailAddresses, signatureRequestEditEmbeddedRequest.ccEmailAddresses) && + Objects.equals(this.customFields, signatureRequestEditEmbeddedRequest.customFields) && + Objects.equals(this.fieldOptions, signatureRequestEditEmbeddedRequest.fieldOptions) && + Objects.equals(this.formFieldGroups, signatureRequestEditEmbeddedRequest.formFieldGroups) && + Objects.equals(this.formFieldRules, signatureRequestEditEmbeddedRequest.formFieldRules) && + Objects.equals(this.formFieldsPerDocument, signatureRequestEditEmbeddedRequest.formFieldsPerDocument) && + Objects.equals(this.hideTextTags, signatureRequestEditEmbeddedRequest.hideTextTags) && + Objects.equals(this.message, signatureRequestEditEmbeddedRequest.message) && + Objects.equals(this.metadata, signatureRequestEditEmbeddedRequest.metadata) && + Objects.equals(this.signingOptions, signatureRequestEditEmbeddedRequest.signingOptions) && + Objects.equals(this.subject, signatureRequestEditEmbeddedRequest.subject) && + Objects.equals(this.testMode, signatureRequestEditEmbeddedRequest.testMode) && + Objects.equals(this.title, signatureRequestEditEmbeddedRequest.title) && + Objects.equals(this.useTextTags, signatureRequestEditEmbeddedRequest.useTextTags) && + Objects.equals(this.populateAutoFillFields, signatureRequestEditEmbeddedRequest.populateAutoFillFields) && + Objects.equals(this.expiresAt, signatureRequestEditEmbeddedRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, files, fileUrls, signers, groupedSigners, allowDecline, allowFormView, allowReassign, attachments, ccEmailAddresses, customFields, fieldOptions, formFieldGroups, formFieldRules, formFieldsPerDocument, hideTextTags, message, metadata, signingOptions, subject, testMode, title, useTextTags, populateAutoFillFields, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestEditEmbeddedRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; } - this.files.add(filesItem); - return this; - } - - /** - * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } - - public SignatureRequestEditEmbeddedRequest fileUrls( - @javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - public SignatureRequestEditEmbeddedRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - * This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - public SignatureRequestEditEmbeddedRequest signers( - @javax.annotation.Nullable List signers) { - this.signers = signers; - return this; - } - - public SignatureRequestEditEmbeddedRequest addSignersItem( - SubSignatureRequestSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Signature Request. This endpoint requires either **signers** or - * **grouped_signers**, but not both. - * - * @return signers - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSigners() { - return signers; - } - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners(@javax.annotation.Nullable List signers) { - this.signers = signers; - } - - public SignatureRequestEditEmbeddedRequest groupedSigners( - @javax.annotation.Nullable List groupedSigners) { - this.groupedSigners = groupedSigners; - return this; } - - public SignatureRequestEditEmbeddedRequest addGroupedSignersItem( - SubSignatureRequestGroupedSigners groupedSignersItem) { - if (this.groupedSigners == null) { - this.groupedSigners = new ArrayList<>(); + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; } - this.groupedSigners.add(groupedSignersItem); - return this; - } - - /** - * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or - * **grouped_signers**, but not both. - * - * @return groupedSigners - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getGroupedSigners() { - return groupedSigners; - } - - @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroupedSigners( - @javax.annotation.Nullable List groupedSigners) { - this.groupedSigners = groupedSigners; - } - - public SignatureRequestEditEmbeddedRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - public SignatureRequestEditEmbeddedRequest allowFormView( - @javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - return this; - } - - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to - * `false`. - * - * @return allowFormView - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowFormView() { - return allowFormView; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - } - - public SignatureRequestEditEmbeddedRequest allowReassign( - @javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - return this; - } - - /** - * Allows signers to reassign their signature requests to other signers if set to - * `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. - * - * @return allowReassign - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowReassign() { - return allowReassign; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - } - - public SignatureRequestEditEmbeddedRequest attachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; - return this; - } - - public SignatureRequestEditEmbeddedRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * - * @return attachments - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAttachments() { - return attachments; - } - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(@javax.annotation.Nullable List attachments) { - this.attachments = attachments; - } - - public SignatureRequestEditEmbeddedRequest ccEmailAddresses( - @javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public SignatureRequestEditEmbeddedRequest addCcEmailAddressesItem( - String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); } - this.ccEmailAddresses.add(ccEmailAddressesItem); - return this; } - - /** - * The email addresses that should be CCed. - * - * @return ccEmailAddresses - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } - - public SignatureRequestEditEmbeddedRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestEditEmbeddedRequest addCustomFieldsItem( - SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; } - this.customFields.add(customFieldsItem); - return this; - } - /** - * When used together with merge fields, `custom_fields` allows users to add - * pre-filled data to their signature requests. Pre-filled data can be used with - * \"send-once\" signature requests by adding merge fields with - * `form_fields_per_document` or [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values - * back with `custom_fields` together in one API call. For using pre-filled on - * repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or - * by calling - * [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and - * then passing `custom_fields` on subsequent signature requests referencing that - * template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public SignatureRequestEditEmbeddedRequest fieldOptions( - @javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * - * @return fieldOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - public SignatureRequestEditEmbeddedRequest formFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } - - public SignatureRequestEditEmbeddedRequest addFormFieldGroupsItem( - SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } } - this.formFieldGroups.add(formFieldGroupsItem); - return this; - } - - /** - * Group information for fields defined in `form_fields_per_document`. String-indexed - * JSON array with `group_label` and `requirement` keys. - * `form_fields_per_document` must contain fields referencing a group defined in - * `form_field_groups`. - * - * @return formFieldGroups - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldGroups() { - return formFieldGroups; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - public SignatureRequestEditEmbeddedRequest formFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - - public SignatureRequestEditEmbeddedRequest addFormFieldRulesItem( - SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * - * @return formFieldRules - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldRules() { - return formFieldRules; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - public SignatureRequestEditEmbeddedRequest formFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; } - - public SignatureRequestEditEmbeddedRequest addFormFieldsPerDocumentItem( - SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; } - this.formFieldsPerDocument.add(formFieldsPerDocumentItem); - return this; - } - - /** - * The fields that should appear on the document, expressed as an array of objects. (For more - * details you can read about it here: [Using Form Fields per - * Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, - * **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and - * optional parameters. Check out the list of [additional - * parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text - * Field use `SubFormFieldsPerDocumentText` * Dropdown Field use - * `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use - * `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use - * `SubFormFieldsPerDocumentCheckbox` * Radio Field use - * `SubFormFieldsPerDocumentRadio` * Signature Field use - * `SubFormFieldsPerDocumentSignature` * Date Signed Field use - * `SubFormFieldsPerDocumentDateSigned` * Initials Field use - * `SubFormFieldsPerDocumentInitials` * Text Merge Field use - * `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use - * `SubFormFieldsPerDocumentCheckboxMerge` - * - * @return formFieldsPerDocument - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } - - public SignatureRequestEditEmbeddedRequest hideTextTags( - @javax.annotation.Nullable Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - return this; - } - /** - * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way - * can cause unwanted clipping. We recommend leaving this setting on `false` and - * instead hiding your text tags using white text or a similar approach. See the [Text Tags - * Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more - * information. - * - * @return hideTextTags - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHideTextTags() { - return hideTextTags; - } - - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - } - - public SignatureRequestEditEmbeddedRequest message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public SignatureRequestEditEmbeddedRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestEditEmbeddedRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public SignatureRequestEditEmbeddedRequest signingOptions( - @javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; - } - - /** - * Get signingOptions - * - * @return signingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubSigningOptions getSigningOptions() { - return signingOptions; } + if (groupedSigners != null) { + if (isFileTypeOrListOfFiles(groupedSigners)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; + if (groupedSigners.getClass().equals(java.io.File.class) || + groupedSigners.getClass().equals(Integer.class) || + groupedSigners.getClass().equals(String.class) || + groupedSigners.getClass().isEnum()) { + map.put("grouped_signers", groupedSigners); + } else if (isListOfFile(groupedSigners)) { + for(int i = 0; i< getListSize(groupedSigners); i++) { + map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); + } + } + else { + map.put("grouped_signers", JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); + } } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } - public SignatureRequestEditEmbeddedRequest subject(@javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (allowReassign.getClass().equals(java.io.File.class) || + allowReassign.getClass().equals(Integer.class) || + allowReassign.getClass().equals(String.class) || + allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for(int i = 0; i< getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } + else { + map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } - public SignatureRequestEditEmbeddedRequest testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + } } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request will not be legally binding if set to - * `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (ccEmailAddresses.getClass().equals(java.io.File.class) || + ccEmailAddresses.getClass().equals(Integer.class) || + ccEmailAddresses.getClass().equals(String.class) || + ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for(int i = 0; i< getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } + else { + map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } - public SignatureRequestEditEmbeddedRequest title(@javax.annotation.Nullable String title) { - this.title = title; - return this; + if (fieldOptions.getClass().equals(java.io.File.class) || + fieldOptions.getClass().equals(Integer.class) || + fieldOptions.getClass().equals(String.class) || + fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for(int i = 0; i< getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } + else { + map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (formFieldGroups.getClass().equals(java.io.File.class) || + formFieldGroups.getClass().equals(Integer.class) || + formFieldGroups.getClass().equals(String.class) || + formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for(int i = 0; i< getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } + else { + map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (formFieldRules.getClass().equals(java.io.File.class) || + formFieldRules.getClass().equals(Integer.class) || + formFieldRules.getClass().equals(String.class) || + formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for(int i = 0; i< getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } + else { + map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } - public SignatureRequestEditEmbeddedRequest useTextTags( - @javax.annotation.Nullable Boolean useTextTags) { - this.useTextTags = useTextTags; - return this; + if (formFieldsPerDocument.getClass().equals(java.io.File.class) || + formFieldsPerDocument.getClass().equals(Integer.class) || + formFieldsPerDocument.getClass().equals(String.class) || + formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { + map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); + } + } + else { + map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); + } } + if (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } - /** - * Send with a value of `true` if you wish to enable [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your - * document. Defaults to disabled, or `false`. - * - * @return useTextTags - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getUseTextTags() { - return useTextTags; + if (hideTextTags.getClass().equals(java.io.File.class) || + hideTextTags.getClass().equals(Integer.class) || + hideTextTags.getClass().equals(String.class) || + hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for(int i = 0; i< getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } + else { + map.put("hide_text_tags", JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUseTextTags(@javax.annotation.Nullable Boolean useTextTags) { - this.useTextTags = useTextTags; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - public SignatureRequestEditEmbeddedRequest populateAutoFillFields( - @javax.annotation.Nullable Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; - return this; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } - /** - * Controls whether [auto fill - * fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can - * automatically populate a signer's information during signing. **NOTE:** Keep your - * signer's information safe by ensuring that the _signer on your signature request is the - * intended party_ before using this feature. - * - * @return populateAutoFillFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPopulateAutoFillFields() { - return populateAutoFillFields; + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPopulateAutoFillFields( - @javax.annotation.Nullable Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - public SignatureRequestEditEmbeddedRequest expiresAt( - @javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - /** - * When the signature request will expire. Unsigned signatures will be moved to the expired - * status, and no longer signable. See [Signature Request Expiration - * Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; + if (useTextTags.getClass().equals(java.io.File.class) || + useTextTags.getClass().equals(Integer.class) || + useTextTags.getClass().equals(String.class) || + useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for(int i = 0; i< getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } + else { + map.put("use_text_tags", JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestEditEmbeddedRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest = - (SignatureRequestEditEmbeddedRequest) o; - return Objects.equals(this.clientId, signatureRequestEditEmbeddedRequest.clientId) - && Objects.equals(this.files, signatureRequestEditEmbeddedRequest.files) - && Objects.equals(this.fileUrls, signatureRequestEditEmbeddedRequest.fileUrls) - && Objects.equals(this.signers, signatureRequestEditEmbeddedRequest.signers) - && Objects.equals( - this.groupedSigners, signatureRequestEditEmbeddedRequest.groupedSigners) - && Objects.equals( - this.allowDecline, signatureRequestEditEmbeddedRequest.allowDecline) - && Objects.equals( - this.allowFormView, signatureRequestEditEmbeddedRequest.allowFormView) - && Objects.equals( - this.allowReassign, signatureRequestEditEmbeddedRequest.allowReassign) - && Objects.equals(this.attachments, signatureRequestEditEmbeddedRequest.attachments) - && Objects.equals( - this.ccEmailAddresses, signatureRequestEditEmbeddedRequest.ccEmailAddresses) - && Objects.equals( - this.customFields, signatureRequestEditEmbeddedRequest.customFields) - && Objects.equals( - this.fieldOptions, signatureRequestEditEmbeddedRequest.fieldOptions) - && Objects.equals( - this.formFieldGroups, signatureRequestEditEmbeddedRequest.formFieldGroups) - && Objects.equals( - this.formFieldRules, signatureRequestEditEmbeddedRequest.formFieldRules) - && Objects.equals( - this.formFieldsPerDocument, - signatureRequestEditEmbeddedRequest.formFieldsPerDocument) - && Objects.equals( - this.hideTextTags, signatureRequestEditEmbeddedRequest.hideTextTags) - && Objects.equals(this.message, signatureRequestEditEmbeddedRequest.message) - && Objects.equals(this.metadata, signatureRequestEditEmbeddedRequest.metadata) - && Objects.equals( - this.signingOptions, signatureRequestEditEmbeddedRequest.signingOptions) - && Objects.equals(this.subject, signatureRequestEditEmbeddedRequest.subject) - && Objects.equals(this.testMode, signatureRequestEditEmbeddedRequest.testMode) - && Objects.equals(this.title, signatureRequestEditEmbeddedRequest.title) - && Objects.equals(this.useTextTags, signatureRequestEditEmbeddedRequest.useTextTags) - && Objects.equals( - this.populateAutoFillFields, - signatureRequestEditEmbeddedRequest.populateAutoFillFields) - && Objects.equals(this.expiresAt, signatureRequestEditEmbeddedRequest.expiresAt); + if (populateAutoFillFields.getClass().equals(java.io.File.class) || + populateAutoFillFields.getClass().equals(Integer.class) || + populateAutoFillFields.getClass().equals(String.class) || + populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for(int i = 0; i< getListSize(populateAutoFillFields); i++) { + map.put("populate_auto_fill_fields[" + i + "]", getFromList(populateAutoFillFields, i)); + } + } + else { + map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - clientId, - files, - fileUrls, - signers, - groupedSigners, - allowDecline, - allowFormView, - allowReassign, - attachments, - ccEmailAddresses, - customFields, - fieldOptions, - formFieldGroups, - formFieldRules, - formFieldsPerDocument, - hideTextTags, - message, - metadata, - signingOptions, - subject, - testMode, - title, - useTextTags, - populateAutoFillFields, - expiresAt); + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestEditEmbeddedRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" formFieldsPerDocument: ") - .append(toIndentedString(formFieldsPerDocument)) - .append("\n"); - sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); - sb.append(" populateAutoFillFields: ") - .append(toIndentedString(populateAutoFillFields)) - .append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - if (groupedSigners != null) { - if (isFileTypeOrListOfFiles(groupedSigners)) { - fileTypeFound = true; - } - - if (groupedSigners.getClass().equals(java.io.File.class) - || groupedSigners.getClass().equals(Integer.class) - || groupedSigners.getClass().equals(String.class) - || groupedSigners.getClass().isEnum()) { - map.put("grouped_signers", groupedSigners); - } else if (isListOfFile(groupedSigners)) { - for (int i = 0; i < getListSize(groupedSigners); i++) { - map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); - } - } else { - map.put( - "grouped_signers", - JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (allowFormView != null) { - if (isFileTypeOrListOfFiles(allowFormView)) { - fileTypeFound = true; - } - - if (allowFormView.getClass().equals(java.io.File.class) - || allowFormView.getClass().equals(Integer.class) - || allowFormView.getClass().equals(String.class) - || allowFormView.getClass().isEnum()) { - map.put("allow_form_view", allowFormView); - } else if (isListOfFile(allowFormView)) { - for (int i = 0; i < getListSize(allowFormView); i++) { - map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); - } - } else { - map.put( - "allow_form_view", - JSON.getDefault().getMapper().writeValueAsString(allowFormView)); - } - } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - - if (allowReassign.getClass().equals(java.io.File.class) - || allowReassign.getClass().equals(Integer.class) - || allowReassign.getClass().equals(String.class) - || allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for (int i = 0; i < getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } else { - map.put( - "allow_reassign", - JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } - } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - - if (attachments.getClass().equals(java.io.File.class) - || attachments.getClass().equals(Integer.class) - || attachments.getClass().equals(String.class) - || attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for (int i = 0; i < getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } else { - map.put( - "attachments", - JSON.getDefault().getMapper().writeValueAsString(attachments)); - } - } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - - if (ccEmailAddresses.getClass().equals(java.io.File.class) - || ccEmailAddresses.getClass().equals(Integer.class) - || ccEmailAddresses.getClass().equals(String.class) - || ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for (int i = 0; i < getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } else { - map.put( - "cc_email_addresses", - JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - - if (fieldOptions.getClass().equals(java.io.File.class) - || fieldOptions.getClass().equals(Integer.class) - || fieldOptions.getClass().equals(String.class) - || fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for (int i = 0; i < getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } else { - map.put( - "field_options", - JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } - } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - - if (formFieldGroups.getClass().equals(java.io.File.class) - || formFieldGroups.getClass().equals(Integer.class) - || formFieldGroups.getClass().equals(String.class) - || formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for (int i = 0; i < getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } else { - map.put( - "form_field_groups", - JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } - } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - - if (formFieldRules.getClass().equals(java.io.File.class) - || formFieldRules.getClass().equals(Integer.class) - || formFieldRules.getClass().equals(String.class) - || formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for (int i = 0; i < getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } else { - map.put( - "form_field_rules", - JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } - } - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - - if (formFieldsPerDocument.getClass().equals(java.io.File.class) - || formFieldsPerDocument.getClass().equals(Integer.class) - || formFieldsPerDocument.getClass().equals(String.class) - || formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { - map.put( - "form_fields_per_document[" + i + "]", - getFromList(formFieldsPerDocument, i)); - } - } else { - map.put( - "form_fields_per_document", - JSON.getDefault() - .getMapper() - .writeValueAsString(formFieldsPerDocument)); - } - } - if (hideTextTags != null) { - if (isFileTypeOrListOfFiles(hideTextTags)) { - fileTypeFound = true; - } - - if (hideTextTags.getClass().equals(java.io.File.class) - || hideTextTags.getClass().equals(Integer.class) - || hideTextTags.getClass().equals(String.class) - || hideTextTags.getClass().isEnum()) { - map.put("hide_text_tags", hideTextTags); - } else if (isListOfFile(hideTextTags)) { - for (int i = 0; i < getListSize(hideTextTags); i++) { - map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); - } - } else { - map.put( - "hide_text_tags", - JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - - if (signingOptions.getClass().equals(java.io.File.class) - || signingOptions.getClass().equals(Integer.class) - || signingOptions.getClass().equals(String.class) - || signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for (int i = 0; i < getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } else { - map.put( - "signing_options", - JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (useTextTags != null) { - if (isFileTypeOrListOfFiles(useTextTags)) { - fileTypeFound = true; - } - - if (useTextTags.getClass().equals(java.io.File.class) - || useTextTags.getClass().equals(Integer.class) - || useTextTags.getClass().equals(String.class) - || useTextTags.getClass().isEnum()) { - map.put("use_text_tags", useTextTags); - } else if (isListOfFile(useTextTags)) { - for (int i = 0; i < getListSize(useTextTags); i++) { - map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); - } - } else { - map.put( - "use_text_tags", - JSON.getDefault().getMapper().writeValueAsString(useTextTags)); - } - } - if (populateAutoFillFields != null) { - if (isFileTypeOrListOfFiles(populateAutoFillFields)) { - fileTypeFound = true; - } - - if (populateAutoFillFields.getClass().equals(java.io.File.class) - || populateAutoFillFields.getClass().equals(Integer.class) - || populateAutoFillFields.getClass().equals(String.class) - || populateAutoFillFields.getClass().isEnum()) { - map.put("populate_auto_fill_fields", populateAutoFillFields); - } else if (isListOfFile(populateAutoFillFields)) { - for (int i = 0; i < getListSize(populateAutoFillFields); i++) { - map.put( - "populate_auto_fill_fields[" + i + "]", - getFromList(populateAutoFillFields, i)); - } - } else { - map.put( - "populate_auto_fill_fields", - JSON.getDefault() - .getMapper() - .writeValueAsString(populateAutoFillFields)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedWithTemplateRequest.java index 6cd3dbed4..74a2f0c0e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditEmbeddedWithTemplateRequest.java @@ -10,964 +10,949 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubCC; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubSignatureRequestTemplateSigner; +import com.dropbox.sign.model.SubSigningOptions; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** SignatureRequestEditEmbeddedWithTemplateRequest */ +import com.dropbox.sign.ApiException; +/** + * SignatureRequestEditEmbeddedWithTemplateRequest + */ @JsonPropertyOrder({ - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNERS, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_FILES, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_FILE_URLS, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, - SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_FILES, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, + SignatureRequestEditEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestEditEmbeddedWithTemplateRequest { - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - @javax.annotation.Nonnull private List templateIds = new ArrayList<>(); - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nonnull private String clientId; - - public static final String JSON_PROPERTY_SIGNERS = "signers"; - - @javax.annotation.Nonnull - private List signers = new ArrayList<>(); - - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; - - public static final String JSON_PROPERTY_CCS = "ccs"; - @javax.annotation.Nullable private List ccs = null; - - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + @javax.annotation.Nonnull + private List templateIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nonnull + private String clientId; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nonnull + private List signers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_CCS = "ccs"; + @javax.annotation.Nullable + private List ccs = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + @javax.annotation.Nullable + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = "populate_auto_fill_fields"; + @javax.annotation.Nullable + private Boolean populateAutoFillFields = false; + + public SignatureRequestEditEmbeddedWithTemplateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestEditEmbeddedWithTemplateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestEditEmbeddedWithTemplateRequest.class); + } + + static public SignatureRequestEditEmbeddedWithTemplateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestEditEmbeddedWithTemplateRequest.class + ); + } + + public SignatureRequestEditEmbeddedWithTemplateRequest templateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @return templateIds + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTemplateIds() { + return templateIds; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app you're using to create this embedded signature request. Used for security purposes. + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest signers(@javax.annotation.Nonnull List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addSignersItem(SubSignatureRequestTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Templated-based Signature Request. + * @return signers + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigners(@javax.annotation.Nonnull List signers) { + this.signers = signers; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest ccs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + return this; + } - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - @javax.annotation.Nullable private SubSigningOptions signingOptions; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = - "populate_auto_fill_fields"; - @javax.annotation.Nullable private Boolean populateAutoFillFields = false; - - public SignatureRequestEditEmbeddedWithTemplateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestEditEmbeddedWithTemplateRequest init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestEditEmbeddedWithTemplateRequest.class); + public SignatureRequestEditEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); } + this.ccs.add(ccsItem); + return this; + } + + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * @return ccs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcs() { + return ccs; + } + + + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + } - public static SignatureRequestEditEmbeddedWithTemplateRequest init(HashMap data) - throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestEditEmbeddedWithTemplateRequest.class); - } - public SignatureRequestEditEmbeddedWithTemplateRequest templateIds( - @javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - return this; - } + public SignatureRequestEditEmbeddedWithTemplateRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array defining values and options for custom fields. Required when a custom field exists in the Template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + - public SignatureRequestEditEmbeddedWithTemplateRequest addTemplateIdsItem( - String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); - } - this.templateIds.add(templateIdsItem); - return this; - } - - /** - * Use `template_ids` to create a SignatureRequest from one or more templates, in the - * order in which the template will be used. - * - * @return templateIds - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getTemplateIds() { - return templateIds; - } + public SignatureRequestEditEmbeddedWithTemplateRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - } - public SignatureRequestEditEmbeddedWithTemplateRequest clientId( - @javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - return this; - } + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestEditEmbeddedWithTemplateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } - /** - * Client id of the app you're using to create this embedded signature request. Used for - * security purposes. - * - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientId() { - return clientId; - } - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest signers( - @javax.annotation.Nonnull List signers) { - this.signers = signers; - return this; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest addSignersItem( - SubSignatureRequestTemplateSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + public SignatureRequestEditEmbeddedWithTemplateRequest signingOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * @return signingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public SignatureRequestEditEmbeddedWithTemplateRequest populateAutoFillFields(@javax.annotation.Nullable Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + return this; + } + + /** + * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + * @return populateAutoFillFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(@javax.annotation.Nullable Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + + /** + * Return true if this SignatureRequestEditEmbeddedWithTemplateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest = (SignatureRequestEditEmbeddedWithTemplateRequest) o; + return Objects.equals(this.templateIds, signatureRequestEditEmbeddedWithTemplateRequest.templateIds) && + Objects.equals(this.clientId, signatureRequestEditEmbeddedWithTemplateRequest.clientId) && + Objects.equals(this.signers, signatureRequestEditEmbeddedWithTemplateRequest.signers) && + Objects.equals(this.allowDecline, signatureRequestEditEmbeddedWithTemplateRequest.allowDecline) && + Objects.equals(this.ccs, signatureRequestEditEmbeddedWithTemplateRequest.ccs) && + Objects.equals(this.customFields, signatureRequestEditEmbeddedWithTemplateRequest.customFields) && + Objects.equals(this.files, signatureRequestEditEmbeddedWithTemplateRequest.files) && + Objects.equals(this.fileUrls, signatureRequestEditEmbeddedWithTemplateRequest.fileUrls) && + Objects.equals(this.message, signatureRequestEditEmbeddedWithTemplateRequest.message) && + Objects.equals(this.metadata, signatureRequestEditEmbeddedWithTemplateRequest.metadata) && + Objects.equals(this.signingOptions, signatureRequestEditEmbeddedWithTemplateRequest.signingOptions) && + Objects.equals(this.subject, signatureRequestEditEmbeddedWithTemplateRequest.subject) && + Objects.equals(this.testMode, signatureRequestEditEmbeddedWithTemplateRequest.testMode) && + Objects.equals(this.title, signatureRequestEditEmbeddedWithTemplateRequest.title) && + Objects.equals(this.populateAutoFillFields, signatureRequestEditEmbeddedWithTemplateRequest.populateAutoFillFields); + } + + @Override + public int hashCode() { + return Objects.hash(templateIds, clientId, signers, allowDecline, ccs, customFields, files, fileUrls, message, metadata, signingOptions, subject, testMode, title, populateAutoFillFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestEditEmbeddedWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; } - this.signers.add(signersItem); - return this; - } - /** - * Add Signers to your Templated-based Signature Request. - * - * @return signers - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getSigners() { - return signers; - } - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSigners( - @javax.annotation.Nonnull List signers) { - this.signers = signers; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest ccs( - @javax.annotation.Nullable List ccs) { - this.ccs = ccs; - return this; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { - if (this.ccs == null) { - this.ccs = new ArrayList<>(); + if (templateIds.getClass().equals(java.io.File.class) || + templateIds.getClass().equals(Integer.class) || + templateIds.getClass().equals(String.class) || + templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for(int i = 0; i< getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } } - this.ccs.add(ccsItem); - return this; - } - - /** - * Add CC email recipients. Required when a CC role exists for the Template. - * - * @return ccs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcs() { - return ccs; - } - - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcs(@javax.annotation.Nullable List ccs) { - this.ccs = ccs; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest addCustomFieldsItem( - SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + else { + map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); } - this.customFields.add(customFieldsItem); - return this; - } - - /** - * An array defining values and options for custom fields. Required when a custom field exists - * in the Template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest files( - @javax.annotation.Nullable List files) { - this.files = files; - return this; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; } - this.files.add(filesItem); - return this; - } - - /** - * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest fileUrls( - @javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - public SignatureRequestEditEmbeddedWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - * This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest message( - @javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest putMetadataItem( - String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest signingOptions( - @javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; - } - - /** - * Get signingOptions - * - * @return signingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubSigningOptions getSigningOptions() { - return signingOptions; - } - - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - } - - public SignatureRequestEditEmbeddedWithTemplateRequest subject( - @javax.annotation.Nullable String subject) { - this.subject = subject; - return this; } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } - public SignatureRequestEditEmbeddedWithTemplateRequest testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (ccs.getClass().equals(java.io.File.class) || + ccs.getClass().equals(Integer.class) || + ccs.getClass().equals(String.class) || + ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for(int i = 0; i< getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } + else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request will not be legally binding if set to - * `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } - public SignatureRequestEditEmbeddedWithTemplateRequest title( - @javax.annotation.Nullable String title) { - this.title = title; - return this; + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } - public SignatureRequestEditEmbeddedWithTemplateRequest populateAutoFillFields( - @javax.annotation.Nullable Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; - return this; + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - /** - * Controls whether [auto fill - * fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can - * automatically populate a signer's information during signing. **NOTE:** Keep your - * signer's information safe by ensuring that the _signer on your signature request is the - * intended party_ before using this feature. - * - * @return populateAutoFillFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPopulateAutoFillFields() { - return populateAutoFillFields; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPopulateAutoFillFields( - @javax.annotation.Nullable Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestEditEmbeddedWithTemplateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestEditEmbeddedWithTemplateRequest - signatureRequestEditEmbeddedWithTemplateRequest = - (SignatureRequestEditEmbeddedWithTemplateRequest) o; - return Objects.equals( - this.templateIds, - signatureRequestEditEmbeddedWithTemplateRequest.templateIds) - && Objects.equals( - this.clientId, signatureRequestEditEmbeddedWithTemplateRequest.clientId) - && Objects.equals( - this.signers, signatureRequestEditEmbeddedWithTemplateRequest.signers) - && Objects.equals( - this.allowDecline, - signatureRequestEditEmbeddedWithTemplateRequest.allowDecline) - && Objects.equals(this.ccs, signatureRequestEditEmbeddedWithTemplateRequest.ccs) - && Objects.equals( - this.customFields, - signatureRequestEditEmbeddedWithTemplateRequest.customFields) - && Objects.equals(this.files, signatureRequestEditEmbeddedWithTemplateRequest.files) - && Objects.equals( - this.fileUrls, signatureRequestEditEmbeddedWithTemplateRequest.fileUrls) - && Objects.equals( - this.message, signatureRequestEditEmbeddedWithTemplateRequest.message) - && Objects.equals( - this.metadata, signatureRequestEditEmbeddedWithTemplateRequest.metadata) - && Objects.equals( - this.signingOptions, - signatureRequestEditEmbeddedWithTemplateRequest.signingOptions) - && Objects.equals( - this.subject, signatureRequestEditEmbeddedWithTemplateRequest.subject) - && Objects.equals( - this.testMode, signatureRequestEditEmbeddedWithTemplateRequest.testMode) - && Objects.equals(this.title, signatureRequestEditEmbeddedWithTemplateRequest.title) - && Objects.equals( - this.populateAutoFillFields, - signatureRequestEditEmbeddedWithTemplateRequest.populateAutoFillFields); + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - templateIds, - clientId, - signers, - allowDecline, - ccs, - customFields, - files, - fileUrls, - message, - metadata, - signingOptions, - subject, - testMode, - title, - populateAutoFillFields); + if (populateAutoFillFields.getClass().equals(java.io.File.class) || + populateAutoFillFields.getClass().equals(Integer.class) || + populateAutoFillFields.getClass().equals(String.class) || + populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for(int i = 0; i< getListSize(populateAutoFillFields); i++) { + map.put("populate_auto_fill_fields[" + i + "]", getFromList(populateAutoFillFields, i)); + } + } + else { + map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestEditEmbeddedWithTemplateRequest {\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" populateAutoFillFields: ") - .append(toIndentedString(populateAutoFillFields)) - .append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } - - if (templateIds.getClass().equals(java.io.File.class) - || templateIds.getClass().equals(Integer.class) - || templateIds.getClass().equals(String.class) - || templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for (int i = 0; i < getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } else { - map.put( - "template_ids", - JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (ccs != null) { - if (isFileTypeOrListOfFiles(ccs)) { - fileTypeFound = true; - } - - if (ccs.getClass().equals(java.io.File.class) - || ccs.getClass().equals(Integer.class) - || ccs.getClass().equals(String.class) - || ccs.getClass().isEnum()) { - map.put("ccs", ccs); - } else if (isListOfFile(ccs)) { - for (int i = 0; i < getListSize(ccs); i++) { - map.put("ccs[" + i + "]", getFromList(ccs, i)); - } - } else { - map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - - if (signingOptions.getClass().equals(java.io.File.class) - || signingOptions.getClass().equals(Integer.class) - || signingOptions.getClass().equals(String.class) - || signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for (int i = 0; i < getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } else { - map.put( - "signing_options", - JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (populateAutoFillFields != null) { - if (isFileTypeOrListOfFiles(populateAutoFillFields)) { - fileTypeFound = true; - } - - if (populateAutoFillFields.getClass().equals(java.io.File.class) - || populateAutoFillFields.getClass().equals(Integer.class) - || populateAutoFillFields.getClass().equals(String.class) - || populateAutoFillFields.getClass().isEnum()) { - map.put("populate_auto_fill_fields", populateAutoFillFields); - } else if (isListOfFile(populateAutoFillFields)) { - for (int i = 0; i < getListSize(populateAutoFillFields); i++) { - map.put( - "populate_auto_fill_fields[" + i + "]", - getFromList(populateAutoFillFields, i)); - } - } else { - map.put( - "populate_auto_fill_fields", - JSON.getDefault() - .getMapper() - .writeValueAsString(populateAutoFillFields)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditRequest.java index 9fa77a0d9..8a59745c8 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditRequest.java @@ -10,1558 +10,1547 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubAttachment; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubFieldOptions; +import com.dropbox.sign.model.SubFormFieldGroup; +import com.dropbox.sign.model.SubFormFieldRule; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.model.SubSignatureRequestGroupedSigners; +import com.dropbox.sign.model.SubSignatureRequestSigner; +import com.dropbox.sign.model.SubSigningOptions; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** SignatureRequestEditRequest */ +import com.dropbox.sign.ApiException; +/** + * SignatureRequestEditRequest + */ @JsonPropertyOrder({ - SignatureRequestEditRequest.JSON_PROPERTY_FILES, - SignatureRequestEditRequest.JSON_PROPERTY_FILE_URLS, - SignatureRequestEditRequest.JSON_PROPERTY_SIGNERS, - SignatureRequestEditRequest.JSON_PROPERTY_GROUPED_SIGNERS, - SignatureRequestEditRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestEditRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, - SignatureRequestEditRequest.JSON_PROPERTY_ALLOW_REASSIGN, - SignatureRequestEditRequest.JSON_PROPERTY_ATTACHMENTS, - SignatureRequestEditRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - SignatureRequestEditRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestEditRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestEditRequest.JSON_PROPERTY_FIELD_OPTIONS, - SignatureRequestEditRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - SignatureRequestEditRequest.JSON_PROPERTY_FORM_FIELD_RULES, - SignatureRequestEditRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - SignatureRequestEditRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, - SignatureRequestEditRequest.JSON_PROPERTY_IS_EID, - SignatureRequestEditRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestEditRequest.JSON_PROPERTY_METADATA, - SignatureRequestEditRequest.JSON_PROPERTY_SIGNING_OPTIONS, - SignatureRequestEditRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - SignatureRequestEditRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestEditRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestEditRequest.JSON_PROPERTY_TITLE, - SignatureRequestEditRequest.JSON_PROPERTY_USE_TEXT_TAGS, - SignatureRequestEditRequest.JSON_PROPERTY_EXPIRES_AT + SignatureRequestEditRequest.JSON_PROPERTY_FILES, + SignatureRequestEditRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestEditRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestEditRequest.JSON_PROPERTY_GROUPED_SIGNERS, + SignatureRequestEditRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestEditRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, + SignatureRequestEditRequest.JSON_PROPERTY_ALLOW_REASSIGN, + SignatureRequestEditRequest.JSON_PROPERTY_ATTACHMENTS, + SignatureRequestEditRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + SignatureRequestEditRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestEditRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestEditRequest.JSON_PROPERTY_FIELD_OPTIONS, + SignatureRequestEditRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + SignatureRequestEditRequest.JSON_PROPERTY_FORM_FIELD_RULES, + SignatureRequestEditRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + SignatureRequestEditRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + SignatureRequestEditRequest.JSON_PROPERTY_IS_EID, + SignatureRequestEditRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestEditRequest.JSON_PROPERTY_METADATA, + SignatureRequestEditRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestEditRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestEditRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestEditRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestEditRequest.JSON_PROPERTY_TITLE, + SignatureRequestEditRequest.JSON_PROPERTY_USE_TEXT_TAGS, + SignatureRequestEditRequest.JSON_PROPERTY_EXPIRES_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestEditRequest { - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; - - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; - - public static final String JSON_PROPERTY_SIGNERS = "signers"; - @javax.annotation.Nullable private List signers = null; - - public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; - - @javax.annotation.Nullable private List groupedSigners = null; - - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; - - public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; - @javax.annotation.Nullable private Boolean allowFormView = false; - - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - @javax.annotation.Nullable private Boolean allowReassign = false; - - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - @javax.annotation.Nullable private List attachments = null; - - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - @javax.annotation.Nullable private List ccEmailAddresses = null; - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nullable private String clientId; - - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - @javax.annotation.Nullable private SubFieldOptions fieldOptions; - - public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - @javax.annotation.Nullable private List formFieldGroups = null; - - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - @javax.annotation.Nullable private List formFieldRules = null; - - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - - @javax.annotation.Nullable private List formFieldsPerDocument = null; - - public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; - @javax.annotation.Nullable private Boolean hideTextTags = false; - - public static final String JSON_PROPERTY_IS_EID = "is_eid"; - @javax.annotation.Nullable private Boolean isEid = false; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - @javax.annotation.Nullable private SubSigningOptions signingOptions; + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nullable + private List signers = null; + + public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; + @javax.annotation.Nullable + private List groupedSigners = null; + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @javax.annotation.Nullable + private Boolean allowFormView = false; + + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + @javax.annotation.Nullable + private Boolean allowReassign = false; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + @javax.annotation.Nullable + private List attachments = null; + + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + @javax.annotation.Nullable + private List ccEmailAddresses = null; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + @javax.annotation.Nullable + private SubFieldOptions fieldOptions; + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + @javax.annotation.Nullable + private List formFieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + @javax.annotation.Nullable + private List formFieldRules = null; + + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + @javax.annotation.Nullable + private List formFieldsPerDocument = null; + + public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; + @javax.annotation.Nullable + private Boolean hideTextTags = false; + + public static final String JSON_PROPERTY_IS_EID = "is_eid"; + @javax.annotation.Nullable + private Boolean isEid = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + @javax.annotation.Nullable + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + @javax.annotation.Nullable + private Boolean useTextTags = false; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public SignatureRequestEditRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestEditRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestEditRequest.class); + } + + static public SignatureRequestEditRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestEditRequest.class + ); + } + + public SignatureRequestEditRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public SignatureRequestEditRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public SignatureRequestEditRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestEditRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public SignatureRequestEditRequest signers(@javax.annotation.Nullable List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestEditRequest addSignersItem(SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * @return signers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(@javax.annotation.Nullable List signers) { + this.signers = signers; + } + + + public SignatureRequestEditRequest groupedSigners(@javax.annotation.Nullable List groupedSigners) { + this.groupedSigners = groupedSigners; + return this; + } + + public SignatureRequestEditRequest addGroupedSignersItem(SubSignatureRequestGroupedSigners groupedSignersItem) { + if (this.groupedSigners == null) { + this.groupedSigners = new ArrayList<>(); + } + this.groupedSigners.add(groupedSignersItem); + return this; + } + + /** + * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * @return groupedSigners + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getGroupedSigners() { + return groupedSigners; + } + + + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupedSigners(@javax.annotation.Nullable List groupedSigners) { + this.groupedSigners = groupedSigners; + } + + + public SignatureRequestEditRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestEditRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. + * @return allowFormView + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + public SignatureRequestEditRequest allowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } + + /** + * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + * @return allowReassign + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowReassign() { + return allowReassign; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + } + + + public SignatureRequestEditRequest attachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + return this; + } + + public SignatureRequestEditRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * A list describing the attachments + * @return attachments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + } + + + public SignatureRequestEditRequest ccEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; + } + + public SignatureRequestEditRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); + } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } + + /** + * The email addresses that should be CCed. + * @return ccEmailAddresses + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } + + + public SignatureRequestEditRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; + public SignatureRequestEditRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestEditRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + - public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; - @javax.annotation.Nullable private Boolean useTextTags = false; + public SignatureRequestEditRequest fieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * @return fieldOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } + + + public SignatureRequestEditRequest formFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; + public SignatureRequestEditRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); + } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } + + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * @return formFieldGroups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldGroups() { + return formFieldGroups; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + + public SignatureRequestEditRequest formFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } + + public SignatureRequestEditRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); + } + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * @return formFieldRules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldRules() { + return formFieldRules; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + + public SignatureRequestEditRequest formFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public SignatureRequestEditRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; + } + + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * @return formFieldsPerDocument + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SignatureRequestEditRequest() {} + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + + public SignatureRequestEditRequest hideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; + } + + /** + * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + * @return hideTextTags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHideTextTags() { + return hideTextTags; + } + + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + } + + + public SignatureRequestEditRequest isEid(@javax.annotation.Nullable Boolean isEid) { + this.isEid = isEid; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + * @return isEid + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsEid() { + return isEid; + } + + + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEid(@javax.annotation.Nullable Boolean isEid) { + this.isEid = isEid; + } + + + public SignatureRequestEditRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public SignatureRequestEditRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestEditRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestEditRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestEditRequest.class); - } + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public SignatureRequestEditRequest signingOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } - public static SignatureRequestEditRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestEditRequest.class); - } + /** + * Get signingOptions + * @return signingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public SignatureRequestEditRequest signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } - public SignatureRequestEditRequest files(@javax.annotation.Nullable List files) { - this.files = files; - return this; - } + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public SignatureRequestEditRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } - public SignatureRequestEditRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public SignatureRequestEditRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestEditRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public SignatureRequestEditRequest useTextTags(@javax.annotation.Nullable Boolean useTextTags) { + this.useTextTags = useTextTags; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + * @return useTextTags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseTextTags() { + return useTextTags; + } + + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(@javax.annotation.Nullable Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + + public SignatureRequestEditRequest expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this SignatureRequestEditRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestEditRequest signatureRequestEditRequest = (SignatureRequestEditRequest) o; + return Objects.equals(this.files, signatureRequestEditRequest.files) && + Objects.equals(this.fileUrls, signatureRequestEditRequest.fileUrls) && + Objects.equals(this.signers, signatureRequestEditRequest.signers) && + Objects.equals(this.groupedSigners, signatureRequestEditRequest.groupedSigners) && + Objects.equals(this.allowDecline, signatureRequestEditRequest.allowDecline) && + Objects.equals(this.allowFormView, signatureRequestEditRequest.allowFormView) && + Objects.equals(this.allowReassign, signatureRequestEditRequest.allowReassign) && + Objects.equals(this.attachments, signatureRequestEditRequest.attachments) && + Objects.equals(this.ccEmailAddresses, signatureRequestEditRequest.ccEmailAddresses) && + Objects.equals(this.clientId, signatureRequestEditRequest.clientId) && + Objects.equals(this.customFields, signatureRequestEditRequest.customFields) && + Objects.equals(this.fieldOptions, signatureRequestEditRequest.fieldOptions) && + Objects.equals(this.formFieldGroups, signatureRequestEditRequest.formFieldGroups) && + Objects.equals(this.formFieldRules, signatureRequestEditRequest.formFieldRules) && + Objects.equals(this.formFieldsPerDocument, signatureRequestEditRequest.formFieldsPerDocument) && + Objects.equals(this.hideTextTags, signatureRequestEditRequest.hideTextTags) && + Objects.equals(this.isEid, signatureRequestEditRequest.isEid) && + Objects.equals(this.message, signatureRequestEditRequest.message) && + Objects.equals(this.metadata, signatureRequestEditRequest.metadata) && + Objects.equals(this.signingOptions, signatureRequestEditRequest.signingOptions) && + Objects.equals(this.signingRedirectUrl, signatureRequestEditRequest.signingRedirectUrl) && + Objects.equals(this.subject, signatureRequestEditRequest.subject) && + Objects.equals(this.testMode, signatureRequestEditRequest.testMode) && + Objects.equals(this.title, signatureRequestEditRequest.title) && + Objects.equals(this.useTextTags, signatureRequestEditRequest.useTextTags) && + Objects.equals(this.expiresAt, signatureRequestEditRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(files, fileUrls, signers, groupedSigners, allowDecline, allowFormView, allowReassign, attachments, ccEmailAddresses, clientId, customFields, fieldOptions, formFieldGroups, formFieldRules, formFieldsPerDocument, hideTextTags, isEid, message, metadata, signingOptions, signingRedirectUrl, subject, testMode, title, useTextTags, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestEditRequest {\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; } - this.files.add(filesItem); - return this; - } - /** - * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } - - public SignatureRequestEditRequest fileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public SignatureRequestEditRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - * This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - public SignatureRequestEditRequest signers( - @javax.annotation.Nullable List signers) { - this.signers = signers; - return this; - } - - public SignatureRequestEditRequest addSignersItem(SubSignatureRequestSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Signature Request. This endpoint requires either **signers** or - * **grouped_signers**, but not both. - * - * @return signers - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSigners() { - return signers; - } - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners(@javax.annotation.Nullable List signers) { - this.signers = signers; } - - public SignatureRequestEditRequest groupedSigners( - @javax.annotation.Nullable List groupedSigners) { - this.groupedSigners = groupedSigners; - return this; - } - - public SignatureRequestEditRequest addGroupedSignersItem( - SubSignatureRequestGroupedSigners groupedSignersItem) { - if (this.groupedSigners == null) { - this.groupedSigners = new ArrayList<>(); + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; } - this.groupedSigners.add(groupedSignersItem); - return this; - } - /** - * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or - * **grouped_signers**, but not both. - * - * @return groupedSigners - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getGroupedSigners() { - return groupedSigners; - } - - @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroupedSigners( - @javax.annotation.Nullable List groupedSigners) { - this.groupedSigners = groupedSigners; - } - - public SignatureRequestEditRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - public SignatureRequestEditRequest allowFormView( - @javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - return this; - } - - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to - * `false`. - * - * @return allowFormView - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowFormView() { - return allowFormView; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - } - - public SignatureRequestEditRequest allowReassign( - @javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - return this; - } - - /** - * Allows signers to reassign their signature requests to other signers if set to - * `true`. Defaults to `false`. **NOTE:** Only available for Premium plan - * and higher. - * - * @return allowReassign - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowReassign() { - return allowReassign; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - } - - public SignatureRequestEditRequest attachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; - return this; - } - - public SignatureRequestEditRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * - * @return attachments - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAttachments() { - return attachments; - } - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(@javax.annotation.Nullable List attachments) { - this.attachments = attachments; - } - - public SignatureRequestEditRequest ccEmailAddresses( - @javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public SignatureRequestEditRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); } - this.ccEmailAddresses.add(ccEmailAddressesItem); - return this; - } - - /** - * The email addresses that should be CCed. - * - * @return ccEmailAddresses - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; } - - public SignatureRequestEditRequest clientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - return this; - } - - /** - * The client id of the API App you want to associate with this request. Used to apply the - * branding and callback url defined for the app. - * - * @return clientId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - } - - public SignatureRequestEditRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestEditRequest addCustomFieldsItem(SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; } - this.customFields.add(customFieldsItem); - return this; - } - - /** - * When used together with merge fields, `custom_fields` allows users to add - * pre-filled data to their signature requests. Pre-filled data can be used with - * \"send-once\" signature requests by adding merge fields with - * `form_fields_per_document` or [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values - * back with `custom_fields` together in one API call. For using pre-filled on - * repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or - * by calling - * [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and - * then passing `custom_fields` on subsequent signature requests referencing that - * template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - public SignatureRequestEditRequest fieldOptions( - @javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * - * @return fieldOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - public SignatureRequestEditRequest formFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } - - public SignatureRequestEditRequest addFormFieldGroupsItem( - SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } } - this.formFieldGroups.add(formFieldGroupsItem); - return this; - } - - /** - * Group information for fields defined in `form_fields_per_document`. String-indexed - * JSON array with `group_label` and `requirement` keys. - * `form_fields_per_document` must contain fields referencing a group defined in - * `form_field_groups`. - * - * @return formFieldGroups - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldGroups() { - return formFieldGroups; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - public SignatureRequestEditRequest formFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - - public SignatureRequestEditRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * - * @return formFieldRules - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldRules() { - return formFieldRules; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - public SignatureRequestEditRequest formFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; } - - public SignatureRequestEditRequest addFormFieldsPerDocumentItem( - SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); + if (groupedSigners != null) { + if (isFileTypeOrListOfFiles(groupedSigners)) { + fileTypeFound = true; } - this.formFieldsPerDocument.add(formFieldsPerDocumentItem); - return this; - } - - /** - * The fields that should appear on the document, expressed as an array of objects. (For more - * details you can read about it here: [Using Form Fields per - * Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, - * **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and - * optional parameters. Check out the list of [additional - * parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text - * Field use `SubFormFieldsPerDocumentText` * Dropdown Field use - * `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use - * `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use - * `SubFormFieldsPerDocumentCheckbox` * Radio Field use - * `SubFormFieldsPerDocumentRadio` * Signature Field use - * `SubFormFieldsPerDocumentSignature` * Date Signed Field use - * `SubFormFieldsPerDocumentDateSigned` * Initials Field use - * `SubFormFieldsPerDocumentInitials` * Text Merge Field use - * `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use - * `SubFormFieldsPerDocumentCheckboxMerge` - * - * @return formFieldsPerDocument - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } - - public SignatureRequestEditRequest hideTextTags( - @javax.annotation.Nullable Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - return this; - } - - /** - * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way - * can cause unwanted clipping. We recommend leaving this setting on `false` and - * instead hiding your text tags using white text or a similar approach. See the [Text Tags - * Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more - * information. - * - * @return hideTextTags - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHideTextTags() { - return hideTextTags; - } - - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - } - - public SignatureRequestEditRequest isEid(@javax.annotation.Nullable Boolean isEid) { - this.isEid = isEid; - return this; - } - /** - * Send with a value of `true` if you wish to enable [electronic identification - * (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify - * their identity with an eID provider to sign a document.<br> **NOTE:** eID is only - * available on the Premium API plan. Cannot be used in `test_mode`. Only works on - * requests with one signer. - * - * @return isEid - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_EID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsEid() { - return isEid; - } - - @JsonProperty(JSON_PROPERTY_IS_EID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsEid(@javax.annotation.Nullable Boolean isEid) { - this.isEid = isEid; - } - - public SignatureRequestEditRequest message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public SignatureRequestEditRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestEditRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (groupedSigners.getClass().equals(java.io.File.class) || + groupedSigners.getClass().equals(Integer.class) || + groupedSigners.getClass().equals(String.class) || + groupedSigners.getClass().isEnum()) { + map.put("grouped_signers", groupedSigners); + } else if (isListOfFile(groupedSigners)) { + for(int i = 0; i< getListSize(groupedSigners); i++) { + map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); + } + } + else { + map.put("grouped_signers", JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public SignatureRequestEditRequest signingOptions( - @javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } - /** - * Get signingOptions - * - * @return signingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubSigningOptions getSigningOptions() { - return signingOptions; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } - public SignatureRequestEditRequest signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; + if (allowReassign.getClass().equals(java.io.File.class) || + allowReassign.getClass().equals(Integer.class) || + allowReassign.getClass().equals(String.class) || + allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for(int i = 0; i< getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } + else { + map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } - /** - * The URL you want signers redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + } } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; + if (ccEmailAddresses.getClass().equals(java.io.File.class) || + ccEmailAddresses.getClass().equals(Integer.class) || + ccEmailAddresses.getClass().equals(String.class) || + ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for(int i = 0; i< getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } + else { + map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } - public SignatureRequestEditRequest subject(@javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (fieldOptions.getClass().equals(java.io.File.class) || + fieldOptions.getClass().equals(Integer.class) || + fieldOptions.getClass().equals(String.class) || + fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for(int i = 0; i< getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } + else { + map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } - public SignatureRequestEditRequest testMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (formFieldGroups.getClass().equals(java.io.File.class) || + formFieldGroups.getClass().equals(Integer.class) || + formFieldGroups.getClass().equals(String.class) || + formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for(int i = 0; i< getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } + else { + map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request will not be legally binding if set to - * `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (formFieldRules.getClass().equals(java.io.File.class) || + formFieldRules.getClass().equals(Integer.class) || + formFieldRules.getClass().equals(String.class) || + formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for(int i = 0; i< getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } + else { + map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (formFieldsPerDocument.getClass().equals(java.io.File.class) || + formFieldsPerDocument.getClass().equals(Integer.class) || + formFieldsPerDocument.getClass().equals(String.class) || + formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { + map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); + } + } + else { + map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); + } } + if (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } - public SignatureRequestEditRequest title(@javax.annotation.Nullable String title) { - this.title = title; - return this; + if (hideTextTags.getClass().equals(java.io.File.class) || + hideTextTags.getClass().equals(Integer.class) || + hideTextTags.getClass().equals(String.class) || + hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for(int i = 0; i< getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } + else { + map.put("hide_text_tags", JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } } + if (isEid != null) { + if (isFileTypeOrListOfFiles(isEid)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (isEid.getClass().equals(java.io.File.class) || + isEid.getClass().equals(Integer.class) || + isEid.getClass().equals(String.class) || + isEid.getClass().isEnum()) { + map.put("is_eid", isEid); + } else if (isListOfFile(isEid)) { + for(int i = 0; i< getListSize(isEid); i++) { + map.put("is_eid[" + i + "]", getFromList(isEid, i)); + } + } + else { + map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - public SignatureRequestEditRequest useTextTags(@javax.annotation.Nullable Boolean useTextTags) { - this.useTextTags = useTextTags; - return this; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } - /** - * Send with a value of `true` if you wish to enable [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your - * document. Defaults to disabled, or `false`. - * - * @return useTextTags - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getUseTextTags() { - return useTextTags; + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUseTextTags(@javax.annotation.Nullable Boolean useTextTags) { - this.useTextTags = useTextTags; + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - public SignatureRequestEditRequest expiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - /** - * When the signature request will expire. Unsigned signatures will be moved to the expired - * status, and no longer signable. See [Signature Request Expiration - * Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestEditRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestEditRequest signatureRequestEditRequest = (SignatureRequestEditRequest) o; - return Objects.equals(this.files, signatureRequestEditRequest.files) - && Objects.equals(this.fileUrls, signatureRequestEditRequest.fileUrls) - && Objects.equals(this.signers, signatureRequestEditRequest.signers) - && Objects.equals(this.groupedSigners, signatureRequestEditRequest.groupedSigners) - && Objects.equals(this.allowDecline, signatureRequestEditRequest.allowDecline) - && Objects.equals(this.allowFormView, signatureRequestEditRequest.allowFormView) - && Objects.equals(this.allowReassign, signatureRequestEditRequest.allowReassign) - && Objects.equals(this.attachments, signatureRequestEditRequest.attachments) - && Objects.equals( - this.ccEmailAddresses, signatureRequestEditRequest.ccEmailAddresses) - && Objects.equals(this.clientId, signatureRequestEditRequest.clientId) - && Objects.equals(this.customFields, signatureRequestEditRequest.customFields) - && Objects.equals(this.fieldOptions, signatureRequestEditRequest.fieldOptions) - && Objects.equals(this.formFieldGroups, signatureRequestEditRequest.formFieldGroups) - && Objects.equals(this.formFieldRules, signatureRequestEditRequest.formFieldRules) - && Objects.equals( - this.formFieldsPerDocument, - signatureRequestEditRequest.formFieldsPerDocument) - && Objects.equals(this.hideTextTags, signatureRequestEditRequest.hideTextTags) - && Objects.equals(this.isEid, signatureRequestEditRequest.isEid) - && Objects.equals(this.message, signatureRequestEditRequest.message) - && Objects.equals(this.metadata, signatureRequestEditRequest.metadata) - && Objects.equals(this.signingOptions, signatureRequestEditRequest.signingOptions) - && Objects.equals( - this.signingRedirectUrl, signatureRequestEditRequest.signingRedirectUrl) - && Objects.equals(this.subject, signatureRequestEditRequest.subject) - && Objects.equals(this.testMode, signatureRequestEditRequest.testMode) - && Objects.equals(this.title, signatureRequestEditRequest.title) - && Objects.equals(this.useTextTags, signatureRequestEditRequest.useTextTags) - && Objects.equals(this.expiresAt, signatureRequestEditRequest.expiresAt); + if (useTextTags.getClass().equals(java.io.File.class) || + useTextTags.getClass().equals(Integer.class) || + useTextTags.getClass().equals(String.class) || + useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for(int i = 0; i< getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } + else { + map.put("use_text_tags", JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - files, - fileUrls, - signers, - groupedSigners, - allowDecline, - allowFormView, - allowReassign, - attachments, - ccEmailAddresses, - clientId, - customFields, - fieldOptions, - formFieldGroups, - formFieldRules, - formFieldsPerDocument, - hideTextTags, - isEid, - message, - metadata, - signingOptions, - signingRedirectUrl, - subject, - testMode, - title, - useTextTags, - expiresAt); + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestEditRequest {\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" formFieldsPerDocument: ") - .append(toIndentedString(formFieldsPerDocument)) - .append("\n"); - sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); - sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - if (groupedSigners != null) { - if (isFileTypeOrListOfFiles(groupedSigners)) { - fileTypeFound = true; - } - - if (groupedSigners.getClass().equals(java.io.File.class) - || groupedSigners.getClass().equals(Integer.class) - || groupedSigners.getClass().equals(String.class) - || groupedSigners.getClass().isEnum()) { - map.put("grouped_signers", groupedSigners); - } else if (isListOfFile(groupedSigners)) { - for (int i = 0; i < getListSize(groupedSigners); i++) { - map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); - } - } else { - map.put( - "grouped_signers", - JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (allowFormView != null) { - if (isFileTypeOrListOfFiles(allowFormView)) { - fileTypeFound = true; - } - - if (allowFormView.getClass().equals(java.io.File.class) - || allowFormView.getClass().equals(Integer.class) - || allowFormView.getClass().equals(String.class) - || allowFormView.getClass().isEnum()) { - map.put("allow_form_view", allowFormView); - } else if (isListOfFile(allowFormView)) { - for (int i = 0; i < getListSize(allowFormView); i++) { - map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); - } - } else { - map.put( - "allow_form_view", - JSON.getDefault().getMapper().writeValueAsString(allowFormView)); - } - } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - - if (allowReassign.getClass().equals(java.io.File.class) - || allowReassign.getClass().equals(Integer.class) - || allowReassign.getClass().equals(String.class) - || allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for (int i = 0; i < getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } else { - map.put( - "allow_reassign", - JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } - } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - - if (attachments.getClass().equals(java.io.File.class) - || attachments.getClass().equals(Integer.class) - || attachments.getClass().equals(String.class) - || attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for (int i = 0; i < getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } else { - map.put( - "attachments", - JSON.getDefault().getMapper().writeValueAsString(attachments)); - } - } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - - if (ccEmailAddresses.getClass().equals(java.io.File.class) - || ccEmailAddresses.getClass().equals(Integer.class) - || ccEmailAddresses.getClass().equals(String.class) - || ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for (int i = 0; i < getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } else { - map.put( - "cc_email_addresses", - JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - - if (fieldOptions.getClass().equals(java.io.File.class) - || fieldOptions.getClass().equals(Integer.class) - || fieldOptions.getClass().equals(String.class) - || fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for (int i = 0; i < getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } else { - map.put( - "field_options", - JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } - } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - - if (formFieldGroups.getClass().equals(java.io.File.class) - || formFieldGroups.getClass().equals(Integer.class) - || formFieldGroups.getClass().equals(String.class) - || formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for (int i = 0; i < getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } else { - map.put( - "form_field_groups", - JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } - } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - - if (formFieldRules.getClass().equals(java.io.File.class) - || formFieldRules.getClass().equals(Integer.class) - || formFieldRules.getClass().equals(String.class) - || formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for (int i = 0; i < getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } else { - map.put( - "form_field_rules", - JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } - } - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - - if (formFieldsPerDocument.getClass().equals(java.io.File.class) - || formFieldsPerDocument.getClass().equals(Integer.class) - || formFieldsPerDocument.getClass().equals(String.class) - || formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { - map.put( - "form_fields_per_document[" + i + "]", - getFromList(formFieldsPerDocument, i)); - } - } else { - map.put( - "form_fields_per_document", - JSON.getDefault() - .getMapper() - .writeValueAsString(formFieldsPerDocument)); - } - } - if (hideTextTags != null) { - if (isFileTypeOrListOfFiles(hideTextTags)) { - fileTypeFound = true; - } - - if (hideTextTags.getClass().equals(java.io.File.class) - || hideTextTags.getClass().equals(Integer.class) - || hideTextTags.getClass().equals(String.class) - || hideTextTags.getClass().isEnum()) { - map.put("hide_text_tags", hideTextTags); - } else if (isListOfFile(hideTextTags)) { - for (int i = 0; i < getListSize(hideTextTags); i++) { - map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); - } - } else { - map.put( - "hide_text_tags", - JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); - } - } - if (isEid != null) { - if (isFileTypeOrListOfFiles(isEid)) { - fileTypeFound = true; - } - - if (isEid.getClass().equals(java.io.File.class) - || isEid.getClass().equals(Integer.class) - || isEid.getClass().equals(String.class) - || isEid.getClass().isEnum()) { - map.put("is_eid", isEid); - } else if (isListOfFile(isEid)) { - for (int i = 0; i < getListSize(isEid); i++) { - map.put("is_eid[" + i + "]", getFromList(isEid, i)); - } - } else { - map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - - if (signingOptions.getClass().equals(java.io.File.class) - || signingOptions.getClass().equals(Integer.class) - || signingOptions.getClass().equals(String.class) - || signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for (int i = 0; i < getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } else { - map.put( - "signing_options", - JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (useTextTags != null) { - if (isFileTypeOrListOfFiles(useTextTags)) { - fileTypeFound = true; - } - - if (useTextTags.getClass().equals(java.io.File.class) - || useTextTags.getClass().equals(Integer.class) - || useTextTags.getClass().equals(String.class) - || useTextTags.getClass().isEnum()) { - map.put("use_text_tags", useTextTags); - } else if (isListOfFile(useTextTags)) { - for (int i = 0; i < getListSize(useTextTags); i++) { - map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); - } - } else { - map.put( - "use_text_tags", - JSON.getDefault().getMapper().writeValueAsString(useTextTags)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditWithTemplateRequest.java index c49c66ff3..eda2e1f57 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestEditWithTemplateRequest.java @@ -10,988 +10,1000 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubCC; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubSignatureRequestTemplateSigner; +import com.dropbox.sign.model.SubSigningOptions; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** */ +import com.dropbox.sign.ApiException; +/** + * + */ @JsonPropertyOrder({ - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SIGNERS, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_CCS, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_FILES, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_FILE_URLS, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_IS_EID, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_METADATA, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_FILES, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_IS_EID, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestEditWithTemplateRequest.JSON_PROPERTY_TITLE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestEditWithTemplateRequest { - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - @javax.annotation.Nonnull private List templateIds = new ArrayList<>(); - - public static final String JSON_PROPERTY_SIGNERS = "signers"; - - @javax.annotation.Nonnull - private List signers = new ArrayList<>(); - - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; - - public static final String JSON_PROPERTY_CCS = "ccs"; - @javax.annotation.Nullable private List ccs = null; - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nullable private String clientId; - - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; - - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + @javax.annotation.Nonnull + private List templateIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nonnull + private List signers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_CCS = "ccs"; + @javax.annotation.Nullable + private List ccs = null; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_IS_EID = "is_eid"; + @javax.annotation.Nullable + private Boolean isEid = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + @javax.annotation.Nullable + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public SignatureRequestEditWithTemplateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestEditWithTemplateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestEditWithTemplateRequest.class); + } + + static public SignatureRequestEditWithTemplateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestEditWithTemplateRequest.class + ); + } + + public SignatureRequestEditWithTemplateRequest templateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + return this; + } + + public SignatureRequestEditWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @return templateIds + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTemplateIds() { + return templateIds; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + } + + + public SignatureRequestEditWithTemplateRequest signers(@javax.annotation.Nonnull List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestEditWithTemplateRequest addSignersItem(SubSignatureRequestTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Templated-based Signature Request. + * @return signers + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigners(@javax.annotation.Nonnull List signers) { + this.signers = signers; + } + + + public SignatureRequestEditWithTemplateRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestEditWithTemplateRequest ccs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + return this; + } + + public SignatureRequestEditWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); + } + this.ccs.add(ccsItem); + return this; + } + + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * @return ccs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcs() { + return ccs; + } + + + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + } + - public static final String JSON_PROPERTY_IS_EID = "is_eid"; - @javax.annotation.Nullable private Boolean isEid = false; + public SignatureRequestEditWithTemplateRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestEditWithTemplateRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; + public SignatureRequestEditWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array defining values and options for custom fields. Required when a custom field exists in the Template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + + + public SignatureRequestEditWithTemplateRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public SignatureRequestEditWithTemplateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public SignatureRequestEditWithTemplateRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestEditWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - @javax.annotation.Nullable private SubSigningOptions signingOptions; - - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public SignatureRequestEditWithTemplateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestEditWithTemplateRequest init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestEditWithTemplateRequest.class); + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public SignatureRequestEditWithTemplateRequest isEid(@javax.annotation.Nullable Boolean isEid) { + this.isEid = isEid; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + * @return isEid + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsEid() { + return isEid; + } + + + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEid(@javax.annotation.Nullable Boolean isEid) { + this.isEid = isEid; + } + + + public SignatureRequestEditWithTemplateRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public SignatureRequestEditWithTemplateRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestEditWithTemplateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public SignatureRequestEditWithTemplateRequest signingOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } - public static SignatureRequestEditWithTemplateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestEditWithTemplateRequest.class); - } - - public SignatureRequestEditWithTemplateRequest templateIds( - @javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - return this; - } - - public SignatureRequestEditWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); + /** + * Get signingOptions + * @return signingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public SignatureRequestEditWithTemplateRequest signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public SignatureRequestEditWithTemplateRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public SignatureRequestEditWithTemplateRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestEditWithTemplateRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + /** + * Return true if this SignatureRequestEditWithTemplateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest = (SignatureRequestEditWithTemplateRequest) o; + return Objects.equals(this.templateIds, signatureRequestEditWithTemplateRequest.templateIds) && + Objects.equals(this.signers, signatureRequestEditWithTemplateRequest.signers) && + Objects.equals(this.allowDecline, signatureRequestEditWithTemplateRequest.allowDecline) && + Objects.equals(this.ccs, signatureRequestEditWithTemplateRequest.ccs) && + Objects.equals(this.clientId, signatureRequestEditWithTemplateRequest.clientId) && + Objects.equals(this.customFields, signatureRequestEditWithTemplateRequest.customFields) && + Objects.equals(this.files, signatureRequestEditWithTemplateRequest.files) && + Objects.equals(this.fileUrls, signatureRequestEditWithTemplateRequest.fileUrls) && + Objects.equals(this.isEid, signatureRequestEditWithTemplateRequest.isEid) && + Objects.equals(this.message, signatureRequestEditWithTemplateRequest.message) && + Objects.equals(this.metadata, signatureRequestEditWithTemplateRequest.metadata) && + Objects.equals(this.signingOptions, signatureRequestEditWithTemplateRequest.signingOptions) && + Objects.equals(this.signingRedirectUrl, signatureRequestEditWithTemplateRequest.signingRedirectUrl) && + Objects.equals(this.subject, signatureRequestEditWithTemplateRequest.subject) && + Objects.equals(this.testMode, signatureRequestEditWithTemplateRequest.testMode) && + Objects.equals(this.title, signatureRequestEditWithTemplateRequest.title); + } + + @Override + public int hashCode() { + return Objects.hash(templateIds, signers, allowDecline, ccs, clientId, customFields, files, fileUrls, isEid, message, metadata, signingOptions, signingRedirectUrl, subject, testMode, title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestEditWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; } - this.templateIds.add(templateIdsItem); - return this; - } - /** - * Use `template_ids` to create a SignatureRequest from one or more templates, in the - * order in which the template will be used. - * - * @return templateIds - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getTemplateIds() { - return templateIds; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - } - - public SignatureRequestEditWithTemplateRequest signers( - @javax.annotation.Nonnull List signers) { - this.signers = signers; - return this; - } - - public SignatureRequestEditWithTemplateRequest addSignersItem( - SubSignatureRequestTemplateSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + if (templateIds.getClass().equals(java.io.File.class) || + templateIds.getClass().equals(Integer.class) || + templateIds.getClass().equals(String.class) || + templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for(int i = 0; i< getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Templated-based Signature Request. - * - * @return signers - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getSigners() { - return signers; - } - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSigners( - @javax.annotation.Nonnull List signers) { - this.signers = signers; - } - - public SignatureRequestEditWithTemplateRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - public SignatureRequestEditWithTemplateRequest ccs(@javax.annotation.Nullable List ccs) { - this.ccs = ccs; - return this; - } - - public SignatureRequestEditWithTemplateRequest addCcsItem(SubCC ccsItem) { - if (this.ccs == null) { - this.ccs = new ArrayList<>(); + else { + map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); } - this.ccs.add(ccsItem); - return this; - } - - /** - * Add CC email recipients. Required when a CC role exists for the Template. - * - * @return ccs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcs() { - return ccs; } - - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcs(@javax.annotation.Nullable List ccs) { - this.ccs = ccs; - } - - public SignatureRequestEditWithTemplateRequest clientId( - @javax.annotation.Nullable String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Client id of the app to associate with the signature request. Used to apply the branding and - * callback url defined for the app. - * - * @return clientId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - } - - public SignatureRequestEditWithTemplateRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestEditWithTemplateRequest addCustomFieldsItem( - SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; } - this.customFields.add(customFieldsItem); - return this; - } - /** - * An array defining values and options for custom fields. Required when a custom field exists - * in the Template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public SignatureRequestEditWithTemplateRequest files( - @javax.annotation.Nullable List files) { - this.files = files; - return this; - } - - public SignatureRequestEditWithTemplateRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } } - this.files.add(filesItem); - return this; - } - - /** - * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } - - public SignatureRequestEditWithTemplateRequest fileUrls( - @javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public SignatureRequestEditWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - * This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - public SignatureRequestEditWithTemplateRequest isEid(@javax.annotation.Nullable Boolean isEid) { - this.isEid = isEid; - return this; - } - - /** - * Send with a value of `true` if you wish to enable [electronic identification - * (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify - * their identity with an eID provider to sign a document.<br> **NOTE:** eID is only - * available on the Premium API plan. Cannot be used in `test_mode`. Only works on - * requests with one signer. - * - * @return isEid - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_EID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsEid() { - return isEid; - } - - @JsonProperty(JSON_PROPERTY_IS_EID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsEid(@javax.annotation.Nullable Boolean isEid) { - this.isEid = isEid; - } - - public SignatureRequestEditWithTemplateRequest message( - @javax.annotation.Nullable String message) { - this.message = message; - return this; } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public SignatureRequestEditWithTemplateRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestEditWithTemplateRequest putMetadataItem( - String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public SignatureRequestEditWithTemplateRequest signingOptions( - @javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; - } - - /** - * Get signingOptions - * - * @return signingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubSigningOptions getSigningOptions() { - return signingOptions; - } - - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - } - - public SignatureRequestEditWithTemplateRequest signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } - /** - * The URL you want signers redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; + if (ccs.getClass().equals(java.io.File.class) || + ccs.getClass().equals(Integer.class) || + ccs.getClass().equals(String.class) || + ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for(int i = 0; i< getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } + else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - public SignatureRequestEditWithTemplateRequest subject( - @javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } } + if (isEid != null) { + if (isFileTypeOrListOfFiles(isEid)) { + fileTypeFound = true; + } - public SignatureRequestEditWithTemplateRequest testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (isEid.getClass().equals(java.io.File.class) || + isEid.getClass().equals(Integer.class) || + isEid.getClass().equals(String.class) || + isEid.getClass().isEnum()) { + map.put("is_eid", isEid); + } else if (isListOfFile(isEid)) { + for(int i = 0; i< getListSize(isEid); i++) { + map.put("is_eid[" + i + "]", getFromList(isEid, i)); + } + } + else { + map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request will not be legally binding if set to - * `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } - public SignatureRequestEditWithTemplateRequest title(@javax.annotation.Nullable String title) { - this.title = title; - return this; + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestEditWithTemplateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest = - (SignatureRequestEditWithTemplateRequest) o; - return Objects.equals(this.templateIds, signatureRequestEditWithTemplateRequest.templateIds) - && Objects.equals(this.signers, signatureRequestEditWithTemplateRequest.signers) - && Objects.equals( - this.allowDecline, signatureRequestEditWithTemplateRequest.allowDecline) - && Objects.equals(this.ccs, signatureRequestEditWithTemplateRequest.ccs) - && Objects.equals(this.clientId, signatureRequestEditWithTemplateRequest.clientId) - && Objects.equals( - this.customFields, signatureRequestEditWithTemplateRequest.customFields) - && Objects.equals(this.files, signatureRequestEditWithTemplateRequest.files) - && Objects.equals(this.fileUrls, signatureRequestEditWithTemplateRequest.fileUrls) - && Objects.equals(this.isEid, signatureRequestEditWithTemplateRequest.isEid) - && Objects.equals(this.message, signatureRequestEditWithTemplateRequest.message) - && Objects.equals(this.metadata, signatureRequestEditWithTemplateRequest.metadata) - && Objects.equals( - this.signingOptions, signatureRequestEditWithTemplateRequest.signingOptions) - && Objects.equals( - this.signingRedirectUrl, - signatureRequestEditWithTemplateRequest.signingRedirectUrl) - && Objects.equals(this.subject, signatureRequestEditWithTemplateRequest.subject) - && Objects.equals(this.testMode, signatureRequestEditWithTemplateRequest.testMode) - && Objects.equals(this.title, signatureRequestEditWithTemplateRequest.title); + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - templateIds, - signers, - allowDecline, - ccs, - clientId, - customFields, - files, - fileUrls, - isEid, - message, - metadata, - signingOptions, - signingRedirectUrl, - subject, - testMode, - title); + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestEditWithTemplateRequest {\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } - - if (templateIds.getClass().equals(java.io.File.class) - || templateIds.getClass().equals(Integer.class) - || templateIds.getClass().equals(String.class) - || templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for (int i = 0; i < getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } else { - map.put( - "template_ids", - JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (ccs != null) { - if (isFileTypeOrListOfFiles(ccs)) { - fileTypeFound = true; - } - - if (ccs.getClass().equals(java.io.File.class) - || ccs.getClass().equals(Integer.class) - || ccs.getClass().equals(String.class) - || ccs.getClass().isEnum()) { - map.put("ccs", ccs); - } else if (isListOfFile(ccs)) { - for (int i = 0; i < getListSize(ccs); i++) { - map.put("ccs[" + i + "]", getFromList(ccs, i)); - } - } else { - map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (isEid != null) { - if (isFileTypeOrListOfFiles(isEid)) { - fileTypeFound = true; - } - - if (isEid.getClass().equals(java.io.File.class) - || isEid.getClass().equals(Integer.class) - || isEid.getClass().equals(String.class) - || isEid.getClass().isEnum()) { - map.put("is_eid", isEid); - } else if (isListOfFile(isEid)) { - for (int i = 0; i < getListSize(isEid); i++) { - map.put("is_eid[" + i + "]", getFromList(isEid, i)); - } - } else { - map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - - if (signingOptions.getClass().equals(java.io.File.class) - || signingOptions.getClass().equals(Integer.class) - || signingOptions.getClass().equals(String.class) - || signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for (int i = 0; i < getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } else { - map.put( - "signing_options", - JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java index 713db0586..f9bd5748e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java @@ -10,222 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** SignatureRequestGetResponse */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestGetResponse + */ @JsonPropertyOrder({ - SignatureRequestGetResponse.JSON_PROPERTY_SIGNATURE_REQUEST, - SignatureRequestGetResponse.JSON_PROPERTY_WARNINGS + SignatureRequestGetResponse.JSON_PROPERTY_SIGNATURE_REQUEST, + SignatureRequestGetResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestGetResponse { - public static final String JSON_PROPERTY_SIGNATURE_REQUEST = "signature_request"; - @javax.annotation.Nonnull private SignatureRequestResponse signatureRequest; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public SignatureRequestGetResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestGetResponse.class); - } - - public static SignatureRequestGetResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestGetResponse.class); - } - - public SignatureRequestGetResponse signatureRequest( - @javax.annotation.Nonnull SignatureRequestResponse signatureRequest) { - this.signatureRequest = signatureRequest; - return this; - } - - /** - * Get signatureRequest - * - * @return signatureRequest - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public SignatureRequestResponse getSignatureRequest() { - return signatureRequest; - } - - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSignatureRequest( - @javax.annotation.Nonnull SignatureRequestResponse signatureRequest) { - this.signatureRequest = signatureRequest; - } - - public SignatureRequestGetResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public SignatureRequestGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_SIGNATURE_REQUEST = "signature_request"; + @javax.annotation.Nonnull + private SignatureRequestResponse signatureRequest; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public SignatureRequestGetResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestGetResponse.class); + } + + static public SignatureRequestGetResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestGetResponse.class + ); + } + + public SignatureRequestGetResponse signatureRequest(@javax.annotation.Nonnull SignatureRequestResponse signatureRequest) { + this.signatureRequest = signatureRequest; + return this; + } + + /** + * Get signatureRequest + * @return signatureRequest + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public SignatureRequestResponse getSignatureRequest() { + return signatureRequest; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignatureRequest(@javax.annotation.Nonnull SignatureRequestResponse signatureRequest) { + this.signatureRequest = signatureRequest; + } + + + public SignatureRequestGetResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public SignatureRequestGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this SignatureRequestGetResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestGetResponse signatureRequestGetResponse = (SignatureRequestGetResponse) o; + return Objects.equals(this.signatureRequest, signatureRequestGetResponse.signatureRequest) && + Objects.equals(this.warnings, signatureRequestGetResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(signatureRequest, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestGetResponse {\n"); + sb.append(" signatureRequest: ").append(toIndentedString(signatureRequest)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (signatureRequest != null) { + if (isFileTypeOrListOfFiles(signatureRequest)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this SignatureRequestGetResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (signatureRequest.getClass().equals(java.io.File.class) || + signatureRequest.getClass().equals(Integer.class) || + signatureRequest.getClass().equals(String.class) || + signatureRequest.getClass().isEnum()) { + map.put("signature_request", signatureRequest); + } else if (isListOfFile(signatureRequest)) { + for(int i = 0; i< getListSize(signatureRequest); i++) { + map.put("signature_request[" + i + "]", getFromList(signatureRequest, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("signature_request", JSON.getDefault().getMapper().writeValueAsString(signatureRequest)); } - SignatureRequestGetResponse signatureRequestGetResponse = (SignatureRequestGetResponse) o; - return Objects.equals(this.signatureRequest, signatureRequestGetResponse.signatureRequest) - && Objects.equals(this.warnings, signatureRequestGetResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(signatureRequest, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestGetResponse {\n"); - sb.append(" signatureRequest: ").append(toIndentedString(signatureRequest)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (signatureRequest != null) { - if (isFileTypeOrListOfFiles(signatureRequest)) { - fileTypeFound = true; - } - - if (signatureRequest.getClass().equals(java.io.File.class) - || signatureRequest.getClass().equals(Integer.class) - || signatureRequest.getClass().equals(String.class) - || signatureRequest.getClass().isEnum()) { - map.put("signature_request", signatureRequest); - } else if (isListOfFile(signatureRequest)) { - for (int i = 0; i < getListSize(signatureRequest); i++) { - map.put("signature_request[" + i + "]", getFromList(signatureRequest, i)); - } - } else { - map.put( - "signature_request", - JSON.getDefault().getMapper().writeValueAsString(signatureRequest)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java index 2829c0ded..89f8357de 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java @@ -10,287 +10,293 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.ListInfoResponse; +import com.dropbox.sign.model.SignatureRequestResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** SignatureRequestListResponse */ +import com.dropbox.sign.ApiException; +/** + * SignatureRequestListResponse + */ @JsonPropertyOrder({ - SignatureRequestListResponse.JSON_PROPERTY_SIGNATURE_REQUESTS, - SignatureRequestListResponse.JSON_PROPERTY_LIST_INFO, - SignatureRequestListResponse.JSON_PROPERTY_WARNINGS + SignatureRequestListResponse.JSON_PROPERTY_SIGNATURE_REQUESTS, + SignatureRequestListResponse.JSON_PROPERTY_LIST_INFO, + SignatureRequestListResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestListResponse { - public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; - - @javax.annotation.Nonnull - private List signatureRequests = new ArrayList<>(); - - public static final String JSON_PROPERTY_LIST_INFO = "list_info"; - @javax.annotation.Nonnull private ListInfoResponse listInfo; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public SignatureRequestListResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestListResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestListResponse.class); - } - - public static SignatureRequestListResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestListResponse.class); - } - - public SignatureRequestListResponse signatureRequests( - @javax.annotation.Nonnull List signatureRequests) { - this.signatureRequests = signatureRequests; - return this; - } - - public SignatureRequestListResponse addSignatureRequestsItem( - SignatureRequestResponse signatureRequestsItem) { - if (this.signatureRequests == null) { - this.signatureRequests = new ArrayList<>(); - } - this.signatureRequests.add(signatureRequestsItem); - return this; - } - - /** - * Contains information about signature requests. - * - * @return signatureRequests - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getSignatureRequests() { - return signatureRequests; + public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; + @javax.annotation.Nonnull + private List signatureRequests = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + @javax.annotation.Nonnull + private ListInfoResponse listInfo; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public SignatureRequestListResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestListResponse.class); + } + + static public SignatureRequestListResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestListResponse.class + ); + } + + public SignatureRequestListResponse signatureRequests(@javax.annotation.Nonnull List signatureRequests) { + this.signatureRequests = signatureRequests; + return this; + } + + public SignatureRequestListResponse addSignatureRequestsItem(SignatureRequestResponse signatureRequestsItem) { + if (this.signatureRequests == null) { + this.signatureRequests = new ArrayList<>(); } - - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSignatureRequests( - @javax.annotation.Nonnull List signatureRequests) { - this.signatureRequests = signatureRequests; + this.signatureRequests.add(signatureRequestsItem); + return this; + } + + /** + * Contains information about signature requests. + * @return signatureRequests + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSignatureRequests() { + return signatureRequests; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignatureRequests(@javax.annotation.Nonnull List signatureRequests) { + this.signatureRequests = signatureRequests; + } + + + public SignatureRequestListResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; + } + + /** + * Get listInfo + * @return listInfo + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ListInfoResponse getListInfo() { + return listInfo; + } + + + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + } + + + public SignatureRequestListResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public SignatureRequestListResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } - - public SignatureRequestListResponse listInfo( - @javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - return this; + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this SignatureRequestListResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * Get listInfo - * - * @return listInfo - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ListInfoResponse getListInfo() { - return listInfo; - } - - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; + if (o == null || getClass() != o.getClass()) { + return false; } - - public SignatureRequestListResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public SignatureRequestListResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + SignatureRequestListResponse signatureRequestListResponse = (SignatureRequestListResponse) o; + return Objects.equals(this.signatureRequests, signatureRequestListResponse.signatureRequests) && + Objects.equals(this.listInfo, signatureRequestListResponse.listInfo) && + Objects.equals(this.warnings, signatureRequestListResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(signatureRequests, listInfo, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestListResponse {\n"); + sb.append(" signatureRequests: ").append(toIndentedString(signatureRequests)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (signatureRequests != null) { + if (isFileTypeOrListOfFiles(signatureRequests)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; + if (signatureRequests.getClass().equals(java.io.File.class) || + signatureRequests.getClass().equals(Integer.class) || + signatureRequests.getClass().equals(String.class) || + signatureRequests.getClass().isEnum()) { + map.put("signature_requests", signatureRequests); + } else if (isListOfFile(signatureRequests)) { + for(int i = 0; i< getListSize(signatureRequests); i++) { + map.put("signature_requests[" + i + "]", getFromList(signatureRequests, i)); + } + } + else { + map.put("signature_requests", JSON.getDefault().getMapper().writeValueAsString(signatureRequests)); + } } + if (listInfo != null) { + if (isFileTypeOrListOfFiles(listInfo)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestListResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (listInfo.getClass().equals(java.io.File.class) || + listInfo.getClass().equals(Integer.class) || + listInfo.getClass().equals(String.class) || + listInfo.getClass().isEnum()) { + map.put("list_info", listInfo); + } else if (isListOfFile(listInfo)) { + for(int i = 0; i< getListSize(listInfo); i++) { + map.put("list_info[" + i + "]", getFromList(listInfo, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("list_info", JSON.getDefault().getMapper().writeValueAsString(listInfo)); } - SignatureRequestListResponse signatureRequestListResponse = - (SignatureRequestListResponse) o; - return Objects.equals( - this.signatureRequests, signatureRequestListResponse.signatureRequests) - && Objects.equals(this.listInfo, signatureRequestListResponse.listInfo) - && Objects.equals(this.warnings, signatureRequestListResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(signatureRequests, listInfo, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestListResponse {\n"); - sb.append(" signatureRequests: ") - .append(toIndentedString(signatureRequests)) - .append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (signatureRequests != null) { - if (isFileTypeOrListOfFiles(signatureRequests)) { - fileTypeFound = true; - } - - if (signatureRequests.getClass().equals(java.io.File.class) - || signatureRequests.getClass().equals(Integer.class) - || signatureRequests.getClass().equals(String.class) - || signatureRequests.getClass().isEnum()) { - map.put("signature_requests", signatureRequests); - } else if (isListOfFile(signatureRequests)) { - for (int i = 0; i < getListSize(signatureRequests); i++) { - map.put("signature_requests[" + i + "]", getFromList(signatureRequests, i)); - } - } else { - map.put( - "signature_requests", - JSON.getDefault().getMapper().writeValueAsString(signatureRequests)); - } - } - if (listInfo != null) { - if (isFileTypeOrListOfFiles(listInfo)) { - fileTypeFound = true; - } - - if (listInfo.getClass().equals(java.io.File.class) - || listInfo.getClass().equals(Integer.class) - || listInfo.getClass().equals(String.class) - || listInfo.getClass().isEnum()) { - map.put("list_info", listInfo); - } else if (isListOfFile(listInfo)) { - for (int i = 0; i < getListSize(listInfo); i++) { - map.put("list_info[" + i + "]", getFromList(listInfo, i)); - } - } else { - map.put( - "list_info", - JSON.getDefault().getMapper().writeValueAsString(listInfo)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java index ee3fae591..36d8f7700 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java @@ -10,212 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SignatureRequestRemindRequest */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestRemindRequest + */ @JsonPropertyOrder({ - SignatureRequestRemindRequest.JSON_PROPERTY_EMAIL_ADDRESS, - SignatureRequestRemindRequest.JSON_PROPERTY_NAME + SignatureRequestRemindRequest.JSON_PROPERTY_EMAIL_ADDRESS, + SignatureRequestRemindRequest.JSON_PROPERTY_NAME }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestRemindRequest { - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nonnull private String emailAddress; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public SignatureRequestRemindRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestRemindRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestRemindRequest.class); - } - - public static SignatureRequestRemindRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestRemindRequest.class); - } - - public SignatureRequestRemindRequest emailAddress( - @javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address of the signer to send a reminder to. - * - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getEmailAddress() { - return emailAddress; - } - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; - } - - public SignatureRequestRemindRequest name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of the signer to send a reminder to. Include if two or more signers share an email - * address. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nonnull + private String emailAddress; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public SignatureRequestRemindRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestRemindRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestRemindRequest.class); + } + + static public SignatureRequestRemindRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestRemindRequest.class + ); + } + + public SignatureRequestRemindRequest emailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The email address of the signer to send a reminder to. + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + } + + + public SignatureRequestRemindRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the signer to send a reminder to. Include if two or more signers share an email address. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + /** + * Return true if this SignatureRequestRemindRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestRemindRequest signatureRequestRemindRequest = (SignatureRequestRemindRequest) o; + return Objects.equals(this.emailAddress, signatureRequestRemindRequest.emailAddress) && + Objects.equals(this.name, signatureRequestRemindRequest.name); + } + + @Override + public int hashCode() { + return Objects.hash(emailAddress, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestRemindRequest {\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestRemindRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); } - SignatureRequestRemindRequest signatureRequestRemindRequest = - (SignatureRequestRemindRequest) o; - return Objects.equals(this.emailAddress, signatureRequestRemindRequest.emailAddress) - && Objects.equals(this.name, signatureRequestRemindRequest.name); } - - @Override - public int hashCode() { - return Objects.hash(emailAddress, name); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestRemindRequest {\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java index 85da7fb61..d29224081 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java @@ -10,1436 +10,1458 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseAttachment; +import com.dropbox.sign.model.SignatureRequestResponseCustomFieldBase; +import com.dropbox.sign.model.SignatureRequestResponseDataBase; +import com.dropbox.sign.model.SignatureRequestResponseSignatures; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** Contains information about a signature request. */ +import com.dropbox.sign.ApiException; +/** + * Contains information about a signature request. + */ @JsonPropertyOrder({ - SignatureRequestResponse.JSON_PROPERTY_TEST_MODE, - SignatureRequestResponse.JSON_PROPERTY_SIGNATURE_REQUEST_ID, - SignatureRequestResponse.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, - SignatureRequestResponse.JSON_PROPERTY_TITLE, - SignatureRequestResponse.JSON_PROPERTY_ORIGINAL_TITLE, - SignatureRequestResponse.JSON_PROPERTY_SUBJECT, - SignatureRequestResponse.JSON_PROPERTY_MESSAGE, - SignatureRequestResponse.JSON_PROPERTY_METADATA, - SignatureRequestResponse.JSON_PROPERTY_CREATED_AT, - SignatureRequestResponse.JSON_PROPERTY_EXPIRES_AT, - SignatureRequestResponse.JSON_PROPERTY_IS_COMPLETE, - SignatureRequestResponse.JSON_PROPERTY_IS_DECLINED, - SignatureRequestResponse.JSON_PROPERTY_HAS_ERROR, - SignatureRequestResponse.JSON_PROPERTY_FILES_URL, - SignatureRequestResponse.JSON_PROPERTY_SIGNING_URL, - SignatureRequestResponse.JSON_PROPERTY_DETAILS_URL, - SignatureRequestResponse.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - SignatureRequestResponse.JSON_PROPERTY_SIGNING_REDIRECT_URL, - SignatureRequestResponse.JSON_PROPERTY_FINAL_COPY_URI, - SignatureRequestResponse.JSON_PROPERTY_TEMPLATE_IDS, - SignatureRequestResponse.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestResponse.JSON_PROPERTY_ATTACHMENTS, - SignatureRequestResponse.JSON_PROPERTY_RESPONSE_DATA, - SignatureRequestResponse.JSON_PROPERTY_SIGNATURES, - SignatureRequestResponse.JSON_PROPERTY_BULK_SEND_JOB_ID + SignatureRequestResponse.JSON_PROPERTY_TEST_MODE, + SignatureRequestResponse.JSON_PROPERTY_SIGNATURE_REQUEST_ID, + SignatureRequestResponse.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, + SignatureRequestResponse.JSON_PROPERTY_TITLE, + SignatureRequestResponse.JSON_PROPERTY_ORIGINAL_TITLE, + SignatureRequestResponse.JSON_PROPERTY_SUBJECT, + SignatureRequestResponse.JSON_PROPERTY_MESSAGE, + SignatureRequestResponse.JSON_PROPERTY_METADATA, + SignatureRequestResponse.JSON_PROPERTY_CREATED_AT, + SignatureRequestResponse.JSON_PROPERTY_EXPIRES_AT, + SignatureRequestResponse.JSON_PROPERTY_IS_COMPLETE, + SignatureRequestResponse.JSON_PROPERTY_IS_DECLINED, + SignatureRequestResponse.JSON_PROPERTY_HAS_ERROR, + SignatureRequestResponse.JSON_PROPERTY_FILES_URL, + SignatureRequestResponse.JSON_PROPERTY_SIGNING_URL, + SignatureRequestResponse.JSON_PROPERTY_DETAILS_URL, + SignatureRequestResponse.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + SignatureRequestResponse.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestResponse.JSON_PROPERTY_FINAL_COPY_URI, + SignatureRequestResponse.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestResponse.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestResponse.JSON_PROPERTY_ATTACHMENTS, + SignatureRequestResponse.JSON_PROPERTY_RESPONSE_DATA, + SignatureRequestResponse.JSON_PROPERTY_SIGNATURES, + SignatureRequestResponse.JSON_PROPERTY_BULK_SEND_JOB_ID }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestResponse { - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; - @javax.annotation.Nullable private String signatureRequestId; - - public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; - @javax.annotation.Nullable private String requesterEmailAddress; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public static final String JSON_PROPERTY_ORIGINAL_TITLE = "original_title"; - @javax.annotation.Nullable private String originalTitle; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_CREATED_AT = "created_at"; - @javax.annotation.Nullable private Integer createdAt; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public static final String JSON_PROPERTY_IS_COMPLETE = "is_complete"; - @javax.annotation.Nullable private Boolean isComplete; - - public static final String JSON_PROPERTY_IS_DECLINED = "is_declined"; - @javax.annotation.Nullable private Boolean isDeclined; - - public static final String JSON_PROPERTY_HAS_ERROR = "has_error"; - @javax.annotation.Nullable private Boolean hasError; - - public static final String JSON_PROPERTY_FILES_URL = "files_url"; - @javax.annotation.Nullable private String filesUrl; - - public static final String JSON_PROPERTY_SIGNING_URL = "signing_url"; - @javax.annotation.Nullable private String signingUrl; - - public static final String JSON_PROPERTY_DETAILS_URL = "details_url"; - @javax.annotation.Nullable private String detailsUrl; - - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - @javax.annotation.Nullable private List ccEmailAddresses = null; - - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; - public static final String JSON_PROPERTY_FINAL_COPY_URI = "final_copy_uri"; - @javax.annotation.Nullable private String finalCopyUri; + public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; + @javax.annotation.Nullable + private String signatureRequestId; + + public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; + @javax.annotation.Nullable + private String requesterEmailAddress; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "original_title"; + @javax.annotation.Nullable + private String originalTitle; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + @javax.annotation.Nullable + private Integer createdAt; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public static final String JSON_PROPERTY_IS_COMPLETE = "is_complete"; + @javax.annotation.Nullable + private Boolean isComplete; + + public static final String JSON_PROPERTY_IS_DECLINED = "is_declined"; + @javax.annotation.Nullable + private Boolean isDeclined; + + public static final String JSON_PROPERTY_HAS_ERROR = "has_error"; + @javax.annotation.Nullable + private Boolean hasError; + + public static final String JSON_PROPERTY_FILES_URL = "files_url"; + @javax.annotation.Nullable + private String filesUrl; + + public static final String JSON_PROPERTY_SIGNING_URL = "signing_url"; + @javax.annotation.Nullable + private String signingUrl; + + public static final String JSON_PROPERTY_DETAILS_URL = "details_url"; + @javax.annotation.Nullable + private String detailsUrl; + + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + @javax.annotation.Nullable + private List ccEmailAddresses = null; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_FINAL_COPY_URI = "final_copy_uri"; + @javax.annotation.Nullable + private String finalCopyUri; + + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + @javax.annotation.Nullable + private List templateIds = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + @javax.annotation.Nullable + private List attachments = null; + + public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; + @javax.annotation.Nullable + private List responseData = null; + + public static final String JSON_PROPERTY_SIGNATURES = "signatures"; + @javax.annotation.Nullable + private List signatures = null; + + public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; + @javax.annotation.Nullable + private String bulkSendJobId; + + public SignatureRequestResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponse.class); + } + + static public SignatureRequestResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponse.class + ); + } + + public SignatureRequestResponse testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestResponse signatureRequestId(@javax.annotation.Nullable String signatureRequestId) { + this.signatureRequestId = signatureRequestId; + return this; + } + + /** + * The id of the SignatureRequest. + * @return signatureRequestId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSignatureRequestId() { + return signatureRequestId; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatureRequestId(@javax.annotation.Nullable String signatureRequestId) { + this.signatureRequestId = signatureRequestId; + } + + + public SignatureRequestResponse requesterEmailAddress(@javax.annotation.Nullable String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + return this; + } + + /** + * The email address of the initiator of the SignatureRequest. + * @return requesterEmailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRequesterEmailAddress() { + return requesterEmailAddress; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequesterEmailAddress(@javax.annotation.Nullable String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + } + + + public SignatureRequestResponse title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title the specified Account uses for the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public SignatureRequestResponse originalTitle(@javax.annotation.Nullable String originalTitle) { + this.originalTitle = originalTitle; + return this; + } + + /** + * Default Label for account. + * @return originalTitle + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - @javax.annotation.Nullable private List templateIds = null; + public String getOriginalTitle() { + return originalTitle; + } + + + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(@javax.annotation.Nullable String originalTitle) { + this.originalTitle = originalTitle; + } + + + public SignatureRequestResponse subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that was initially sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public SignatureRequestResponse message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that was initially sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @javax.annotation.Nullable private List customFields = null; + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public SignatureRequestResponse metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestResponse putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - @javax.annotation.Nullable private List attachments = null; + /** + * The metadata attached to the signature request. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public SignatureRequestResponse createdAt(@javax.annotation.Nullable Integer createdAt) { + this.createdAt = createdAt; + return this; + } - public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; - @javax.annotation.Nullable private List responseData = null; + /** + * Time the signature request was created. + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(@javax.annotation.Nullable Integer createdAt) { + this.createdAt = createdAt; + } + + + public SignatureRequestResponse expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } - public static final String JSON_PROPERTY_SIGNATURES = "signatures"; - @javax.annotation.Nullable private List signatures = null; + /** + * The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + public SignatureRequestResponse isComplete(@javax.annotation.Nullable Boolean isComplete) { + this.isComplete = isComplete; + return this; + } - public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; - @javax.annotation.Nullable private String bulkSendJobId; + /** + * Whether or not the SignatureRequest has been fully executed by all signers. + * @return isComplete + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsComplete() { + return isComplete; + } + + + @JsonProperty(JSON_PROPERTY_IS_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsComplete(@javax.annotation.Nullable Boolean isComplete) { + this.isComplete = isComplete; + } + + + public SignatureRequestResponse isDeclined(@javax.annotation.Nullable Boolean isDeclined) { + this.isDeclined = isDeclined; + return this; + } + + /** + * Whether or not the SignatureRequest has been declined by a signer. + * @return isDeclined + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_DECLINED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsDeclined() { + return isDeclined; + } + + + @JsonProperty(JSON_PROPERTY_IS_DECLINED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDeclined(@javax.annotation.Nullable Boolean isDeclined) { + this.isDeclined = isDeclined; + } + + + public SignatureRequestResponse hasError(@javax.annotation.Nullable Boolean hasError) { + this.hasError = hasError; + return this; + } + + /** + * Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). + * @return hasError + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SignatureRequestResponse() {} + public Boolean getHasError() { + return hasError; + } + + + @JsonProperty(JSON_PROPERTY_HAS_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasError(@javax.annotation.Nullable Boolean hasError) { + this.hasError = hasError; + } + + + public SignatureRequestResponse filesUrl(@javax.annotation.Nullable String filesUrl) { + this.filesUrl = filesUrl; + return this; + } + + /** + * The URL where a copy of the request's documents can be downloaded. + * @return filesUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponse.class); - } - - public static SignatureRequestResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponse.class); - } - - public SignatureRequestResponse testMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; - } - - /** - * Whether this is a test signature request. Test requests have no legal value. Defaults to - * `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; - } - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - } - - public SignatureRequestResponse signatureRequestId( - @javax.annotation.Nullable String signatureRequestId) { - this.signatureRequestId = signatureRequestId; - return this; - } - - /** - * The id of the SignatureRequest. - * - * @return signatureRequestId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSignatureRequestId() { - return signatureRequestId; - } - - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatureRequestId(@javax.annotation.Nullable String signatureRequestId) { - this.signatureRequestId = signatureRequestId; - } - - public SignatureRequestResponse requesterEmailAddress( - @javax.annotation.Nullable String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - return this; - } + public String getFilesUrl() { + return filesUrl; + } + + + @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilesUrl(@javax.annotation.Nullable String filesUrl) { + this.filesUrl = filesUrl; + } + + + public SignatureRequestResponse signingUrl(@javax.annotation.Nullable String signingUrl) { + this.signingUrl = signingUrl; + return this; + } + + /** + * The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. + * @return signingUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - /** - * The email address of the initiator of the SignatureRequest. - * - * @return requesterEmailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRequesterEmailAddress() { - return requesterEmailAddress; - } + public String getSigningUrl() { + return signingUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningUrl(@javax.annotation.Nullable String signingUrl) { + this.signingUrl = signingUrl; + } + + + public SignatureRequestResponse detailsUrl(@javax.annotation.Nullable String detailsUrl) { + this.detailsUrl = detailsUrl; + return this; + } + + /** + * The URL where the requester and the signers can view the current status of the SignatureRequest. + * @return detailsUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DETAILS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequesterEmailAddress(@javax.annotation.Nullable String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - } + public String getDetailsUrl() { + return detailsUrl; + } - public SignatureRequestResponse title(@javax.annotation.Nullable String title) { - this.title = title; - return this; - } - /** - * The title the specified Account uses for the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; - } + @JsonProperty(JSON_PROPERTY_DETAILS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetailsUrl(@javax.annotation.Nullable String detailsUrl) { + this.detailsUrl = detailsUrl; + } + + + public SignatureRequestResponse ccEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; + } + + public SignatureRequestResponse addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); + } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } + + /** + * A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. + * @return ccEmailAddresses + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } + + + public SignatureRequestResponse signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want the signer redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public SignatureRequestResponse finalCopyUri(@javax.annotation.Nullable String finalCopyUri) { + this.finalCopyUri = finalCopyUri; + return this; + } + + /** + * The path where the completed document can be downloaded + * @return finalCopyUri + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFinalCopyUri() { + return finalCopyUri; + } + + + @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFinalCopyUri(@javax.annotation.Nullable String finalCopyUri) { + this.finalCopyUri = finalCopyUri; + } + + + public SignatureRequestResponse templateIds(@javax.annotation.Nullable List templateIds) { + this.templateIds = templateIds; + return this; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + public SignatureRequestResponse addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Templates IDs used in this SignatureRequest (if any). + * @return templateIds + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTemplateIds() { + return templateIds; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateIds(@javax.annotation.Nullable List templateIds) { + this.templateIds = templateIds; + } + + + public SignatureRequestResponse customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } - public SignatureRequestResponse originalTitle(@javax.annotation.Nullable String originalTitle) { - this.originalTitle = originalTitle; - return this; + public SignatureRequestResponse addCustomFieldsItem(SignatureRequestResponseCustomFieldBase customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } - /** - * Default Label for account. - * - * @return originalTitle - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getOriginalTitle() { - return originalTitle; - } - - @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOriginalTitle(@javax.annotation.Nullable String originalTitle) { - this.originalTitle = originalTitle; - } - - public SignatureRequestResponse subject(@javax.annotation.Nullable String subject) { - this.subject = subject; - return this; - } - - /** - * The subject in the email that was initially sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; - } - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; - } - - public SignatureRequestResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that was initially sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } + public SignatureRequestResponse attachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + return this; + } + + public SignatureRequestResponse addAttachmentsItem(SignatureRequestResponseAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * Signer attachments. + * @return attachments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } - public SignatureRequestResponse metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - public SignatureRequestResponse putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + } + + + public SignatureRequestResponse responseData(@javax.annotation.Nullable List responseData) { + this.responseData = responseData; + return this; + } + + public SignatureRequestResponse addResponseDataItem(SignatureRequestResponseDataBase responseDataItem) { + if (this.responseData == null) { + this.responseData = new ArrayList<>(); + } + this.responseData.add(responseDataItem); + return this; + } + + /** + * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. + * @return responseData + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getResponseData() { + return responseData; + } + + + @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseData(@javax.annotation.Nullable List responseData) { + this.responseData = responseData; + } + + + public SignatureRequestResponse signatures(@javax.annotation.Nullable List signatures) { + this.signatures = signatures; + return this; + } + + public SignatureRequestResponse addSignaturesItem(SignatureRequestResponseSignatures signaturesItem) { + if (this.signatures == null) { + this.signatures = new ArrayList<>(); + } + this.signatures.add(signaturesItem); + return this; + } + + /** + * An array of signature objects, 1 for each signer. + * @return signatures + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSignatures() { + return signatures; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatures(@javax.annotation.Nullable List signatures) { + this.signatures = signatures; + } + + + public SignatureRequestResponse bulkSendJobId(@javax.annotation.Nullable String bulkSendJobId) { + this.bulkSendJobId = bulkSendJobId; + return this; + } + + /** + * The ID of the Bulk Send job which sent the signature request, if applicable. + * @return bulkSendJobId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBulkSendJobId() { + return bulkSendJobId; + } + + + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBulkSendJobId(@javax.annotation.Nullable String bulkSendJobId) { + this.bulkSendJobId = bulkSendJobId; + } + + + /** + * Return true if this SignatureRequestResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponse signatureRequestResponse = (SignatureRequestResponse) o; + return Objects.equals(this.testMode, signatureRequestResponse.testMode) && + Objects.equals(this.signatureRequestId, signatureRequestResponse.signatureRequestId) && + Objects.equals(this.requesterEmailAddress, signatureRequestResponse.requesterEmailAddress) && + Objects.equals(this.title, signatureRequestResponse.title) && + Objects.equals(this.originalTitle, signatureRequestResponse.originalTitle) && + Objects.equals(this.subject, signatureRequestResponse.subject) && + Objects.equals(this.message, signatureRequestResponse.message) && + Objects.equals(this.metadata, signatureRequestResponse.metadata) && + Objects.equals(this.createdAt, signatureRequestResponse.createdAt) && + Objects.equals(this.expiresAt, signatureRequestResponse.expiresAt) && + Objects.equals(this.isComplete, signatureRequestResponse.isComplete) && + Objects.equals(this.isDeclined, signatureRequestResponse.isDeclined) && + Objects.equals(this.hasError, signatureRequestResponse.hasError) && + Objects.equals(this.filesUrl, signatureRequestResponse.filesUrl) && + Objects.equals(this.signingUrl, signatureRequestResponse.signingUrl) && + Objects.equals(this.detailsUrl, signatureRequestResponse.detailsUrl) && + Objects.equals(this.ccEmailAddresses, signatureRequestResponse.ccEmailAddresses) && + Objects.equals(this.signingRedirectUrl, signatureRequestResponse.signingRedirectUrl) && + Objects.equals(this.finalCopyUri, signatureRequestResponse.finalCopyUri) && + Objects.equals(this.templateIds, signatureRequestResponse.templateIds) && + Objects.equals(this.customFields, signatureRequestResponse.customFields) && + Objects.equals(this.attachments, signatureRequestResponse.attachments) && + Objects.equals(this.responseData, signatureRequestResponse.responseData) && + Objects.equals(this.signatures, signatureRequestResponse.signatures) && + Objects.equals(this.bulkSendJobId, signatureRequestResponse.bulkSendJobId); + } + + @Override + public int hashCode() { + return Objects.hash(testMode, signatureRequestId, requesterEmailAddress, title, originalTitle, subject, message, metadata, createdAt, expiresAt, isComplete, isDeclined, hasError, filesUrl, signingUrl, detailsUrl, ccEmailAddresses, signingRedirectUrl, finalCopyUri, templateIds, customFields, attachments, responseData, signatures, bulkSendJobId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponse {\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" signatureRequestId: ").append(toIndentedString(signatureRequestId)).append("\n"); + sb.append(" requesterEmailAddress: ").append(toIndentedString(requesterEmailAddress)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" isComplete: ").append(toIndentedString(isComplete)).append("\n"); + sb.append(" isDeclined: ").append(toIndentedString(isDeclined)).append("\n"); + sb.append(" hasError: ").append(toIndentedString(hasError)).append("\n"); + sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); + sb.append(" signingUrl: ").append(toIndentedString(signingUrl)).append("\n"); + sb.append(" detailsUrl: ").append(toIndentedString(detailsUrl)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" finalCopyUri: ").append(toIndentedString(finalCopyUri)).append("\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" responseData: ").append(toIndentedString(responseData)).append("\n"); + sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); + sb.append(" bulkSendJobId: ").append(toIndentedString(bulkSendJobId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * The metadata attached to the signature request. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public SignatureRequestResponse createdAt(@javax.annotation.Nullable Integer createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Time the signature request was created. - * - * @return createdAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getCreatedAt() { - return createdAt; - } - - @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCreatedAt(@javax.annotation.Nullable Integer createdAt) { - this.createdAt = createdAt; - } - - public SignatureRequestResponse expiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * The time when the signature request will expire unsigned signatures. See [Signature Request - * Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for - * details. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; - } - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - } - - public SignatureRequestResponse isComplete(@javax.annotation.Nullable Boolean isComplete) { - this.isComplete = isComplete; - return this; - } - - /** - * Whether or not the SignatureRequest has been fully executed by all signers. - * - * @return isComplete - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsComplete() { - return isComplete; - } - - @JsonProperty(JSON_PROPERTY_IS_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsComplete(@javax.annotation.Nullable Boolean isComplete) { - this.isComplete = isComplete; - } - - public SignatureRequestResponse isDeclined(@javax.annotation.Nullable Boolean isDeclined) { - this.isDeclined = isDeclined; - return this; - } - - /** - * Whether or not the SignatureRequest has been declined by a signer. - * - * @return isDeclined - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_DECLINED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsDeclined() { - return isDeclined; - } - - @JsonProperty(JSON_PROPERTY_IS_DECLINED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsDeclined(@javax.annotation.Nullable Boolean isDeclined) { - this.isDeclined = isDeclined; - } - - public SignatureRequestResponse hasError(@javax.annotation.Nullable Boolean hasError) { - this.hasError = hasError; - return this; - } - - /** - * Whether or not an error occurred (either during the creation of the SignatureRequest or - * during one of the signings). - * - * @return hasError - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHasError() { - return hasError; - } - - @JsonProperty(JSON_PROPERTY_HAS_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasError(@javax.annotation.Nullable Boolean hasError) { - this.hasError = hasError; - } - - public SignatureRequestResponse filesUrl(@javax.annotation.Nullable String filesUrl) { - this.filesUrl = filesUrl; - return this; - } - - /** - * The URL where a copy of the request's documents can be downloaded. - * - * @return filesUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFilesUrl() { - return filesUrl; - } - - @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFilesUrl(@javax.annotation.Nullable String filesUrl) { - this.filesUrl = filesUrl; - } - - public SignatureRequestResponse signingUrl(@javax.annotation.Nullable String signingUrl) { - this.signingUrl = signingUrl; - return this; - } - - /** - * The URL where a signer, after authenticating, can sign the documents. This should only be - * used by users with existing Dropbox Sign accounts as they will be required to log in before - * signing. - * - * @return signingUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningUrl() { - return signingUrl; - } - - @JsonProperty(JSON_PROPERTY_SIGNING_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningUrl(@javax.annotation.Nullable String signingUrl) { - this.signingUrl = signingUrl; - } - - public SignatureRequestResponse detailsUrl(@javax.annotation.Nullable String detailsUrl) { - this.detailsUrl = detailsUrl; - return this; - } - /** - * The URL where the requester and the signers can view the current status of the - * SignatureRequest. - * - * @return detailsUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DETAILS_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getDetailsUrl() { - return detailsUrl; - } - - @JsonProperty(JSON_PROPERTY_DETAILS_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDetailsUrl(@javax.annotation.Nullable String detailsUrl) { - this.detailsUrl = detailsUrl; - } - - public SignatureRequestResponse ccEmailAddresses( - @javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public SignatureRequestResponse addCcEmailAddressesItem(String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); } - this.ccEmailAddresses.add(ccEmailAddressesItem); - return this; - } - - /** - * A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of - * the final PDF once all the signers have signed. - * - * @return ccEmailAddresses - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } - - public SignatureRequestResponse signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } - - /** - * The URL you want the signer redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - public SignatureRequestResponse finalCopyUri(@javax.annotation.Nullable String finalCopyUri) { - this.finalCopyUri = finalCopyUri; - return this; - } - - /** - * The path where the completed document can be downloaded - * - * @return finalCopyUri - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFinalCopyUri() { - return finalCopyUri; - } - - @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFinalCopyUri(@javax.annotation.Nullable String finalCopyUri) { - this.finalCopyUri = finalCopyUri; - } - - public SignatureRequestResponse templateIds( - @javax.annotation.Nullable List templateIds) { - this.templateIds = templateIds; - return this; } + if (signatureRequestId != null) { + if (isFileTypeOrListOfFiles(signatureRequestId)) { + fileTypeFound = true; + } - public SignatureRequestResponse addTemplateIdsItem(String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); + if (signatureRequestId.getClass().equals(java.io.File.class) || + signatureRequestId.getClass().equals(Integer.class) || + signatureRequestId.getClass().equals(String.class) || + signatureRequestId.getClass().isEnum()) { + map.put("signature_request_id", signatureRequestId); + } else if (isListOfFile(signatureRequestId)) { + for(int i = 0; i< getListSize(signatureRequestId); i++) { + map.put("signature_request_id[" + i + "]", getFromList(signatureRequestId, i)); + } + } + else { + map.put("signature_request_id", JSON.getDefault().getMapper().writeValueAsString(signatureRequestId)); } - this.templateIds.add(templateIdsItem); - return this; } + if (requesterEmailAddress != null) { + if (isFileTypeOrListOfFiles(requesterEmailAddress)) { + fileTypeFound = true; + } - /** - * Templates IDs used in this SignatureRequest (if any). - * - * @return templateIds - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getTemplateIds() { - return templateIds; + if (requesterEmailAddress.getClass().equals(java.io.File.class) || + requesterEmailAddress.getClass().equals(Integer.class) || + requesterEmailAddress.getClass().equals(String.class) || + requesterEmailAddress.getClass().isEnum()) { + map.put("requester_email_address", requesterEmailAddress); + } else if (isListOfFile(requesterEmailAddress)) { + for(int i = 0; i< getListSize(requesterEmailAddress); i++) { + map.put("requester_email_address[" + i + "]", getFromList(requesterEmailAddress, i)); + } + } + else { + map.put("requester_email_address", JSON.getDefault().getMapper().writeValueAsString(requesterEmailAddress)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplateIds(@javax.annotation.Nullable List templateIds) { - this.templateIds = templateIds; + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } + if (originalTitle != null) { + if (isFileTypeOrListOfFiles(originalTitle)) { + fileTypeFound = true; + } - public SignatureRequestResponse customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; + if (originalTitle.getClass().equals(java.io.File.class) || + originalTitle.getClass().equals(Integer.class) || + originalTitle.getClass().equals(String.class) || + originalTitle.getClass().isEnum()) { + map.put("original_title", originalTitle); + } else if (isListOfFile(originalTitle)) { + for(int i = 0; i< getListSize(originalTitle); i++) { + map.put("original_title[" + i + "]", getFromList(originalTitle, i)); + } + } + else { + map.put("original_title", JSON.getDefault().getMapper().writeValueAsString(originalTitle)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - public SignatureRequestResponse addCustomFieldsItem( - SignatureRequestResponseCustomFieldBase customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); } - this.customFields.add(customFieldsItem); - return this; } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - /** - * An array of Custom Field objects containing the name and type of each custom field. * Text - * Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses - * `SignatureRequestResponseCustomFieldCheckbox` - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (createdAt != null) { + if (isFileTypeOrListOfFiles(createdAt)) { + fileTypeFound = true; + } - public SignatureRequestResponse attachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; - return this; + if (createdAt.getClass().equals(java.io.File.class) || + createdAt.getClass().equals(Integer.class) || + createdAt.getClass().equals(String.class) || + createdAt.getClass().isEnum()) { + map.put("created_at", createdAt); + } else if (isListOfFile(createdAt)) { + for(int i = 0; i< getListSize(createdAt); i++) { + map.put("created_at[" + i + "]", getFromList(createdAt, i)); + } + } + else { + map.put("created_at", JSON.getDefault().getMapper().writeValueAsString(createdAt)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - public SignatureRequestResponse addAttachmentsItem( - SignatureRequestResponseAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); } - this.attachments.add(attachmentsItem); - return this; } + if (isComplete != null) { + if (isFileTypeOrListOfFiles(isComplete)) { + fileTypeFound = true; + } - /** - * Signer attachments. - * - * @return attachments - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAttachments() { - return attachments; + if (isComplete.getClass().equals(java.io.File.class) || + isComplete.getClass().equals(Integer.class) || + isComplete.getClass().equals(String.class) || + isComplete.getClass().isEnum()) { + map.put("is_complete", isComplete); + } else if (isListOfFile(isComplete)) { + for(int i = 0; i< getListSize(isComplete); i++) { + map.put("is_complete[" + i + "]", getFromList(isComplete, i)); + } + } + else { + map.put("is_complete", JSON.getDefault().getMapper().writeValueAsString(isComplete)); + } } + if (isDeclined != null) { + if (isFileTypeOrListOfFiles(isDeclined)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; + if (isDeclined.getClass().equals(java.io.File.class) || + isDeclined.getClass().equals(Integer.class) || + isDeclined.getClass().equals(String.class) || + isDeclined.getClass().isEnum()) { + map.put("is_declined", isDeclined); + } else if (isListOfFile(isDeclined)) { + for(int i = 0; i< getListSize(isDeclined); i++) { + map.put("is_declined[" + i + "]", getFromList(isDeclined, i)); + } + } + else { + map.put("is_declined", JSON.getDefault().getMapper().writeValueAsString(isDeclined)); + } } + if (hasError != null) { + if (isFileTypeOrListOfFiles(hasError)) { + fileTypeFound = true; + } - public SignatureRequestResponse responseData( - @javax.annotation.Nullable List responseData) { - this.responseData = responseData; - return this; + if (hasError.getClass().equals(java.io.File.class) || + hasError.getClass().equals(Integer.class) || + hasError.getClass().equals(String.class) || + hasError.getClass().isEnum()) { + map.put("has_error", hasError); + } else if (isListOfFile(hasError)) { + for(int i = 0; i< getListSize(hasError); i++) { + map.put("has_error[" + i + "]", getFromList(hasError, i)); + } + } + else { + map.put("has_error", JSON.getDefault().getMapper().writeValueAsString(hasError)); + } } + if (filesUrl != null) { + if (isFileTypeOrListOfFiles(filesUrl)) { + fileTypeFound = true; + } - public SignatureRequestResponse addResponseDataItem( - SignatureRequestResponseDataBase responseDataItem) { - if (this.responseData == null) { - this.responseData = new ArrayList<>(); + if (filesUrl.getClass().equals(java.io.File.class) || + filesUrl.getClass().equals(Integer.class) || + filesUrl.getClass().equals(String.class) || + filesUrl.getClass().isEnum()) { + map.put("files_url", filesUrl); + } else if (isListOfFile(filesUrl)) { + for(int i = 0; i< getListSize(filesUrl); i++) { + map.put("files_url[" + i + "]", getFromList(filesUrl, i)); + } + } + else { + map.put("files_url", JSON.getDefault().getMapper().writeValueAsString(filesUrl)); } - this.responseData.add(responseDataItem); - return this; } + if (signingUrl != null) { + if (isFileTypeOrListOfFiles(signingUrl)) { + fileTypeFound = true; + } - /** - * An array of form field objects containing the name, value, and type of each textbox or - * checkmark field filled in by the signers. - * - * @return responseData - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getResponseData() { - return responseData; + if (signingUrl.getClass().equals(java.io.File.class) || + signingUrl.getClass().equals(Integer.class) || + signingUrl.getClass().equals(String.class) || + signingUrl.getClass().isEnum()) { + map.put("signing_url", signingUrl); + } else if (isListOfFile(signingUrl)) { + for(int i = 0; i< getListSize(signingUrl); i++) { + map.put("signing_url[" + i + "]", getFromList(signingUrl, i)); + } + } + else { + map.put("signing_url", JSON.getDefault().getMapper().writeValueAsString(signingUrl)); + } } + if (detailsUrl != null) { + if (isFileTypeOrListOfFiles(detailsUrl)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setResponseData( - @javax.annotation.Nullable List responseData) { - this.responseData = responseData; + if (detailsUrl.getClass().equals(java.io.File.class) || + detailsUrl.getClass().equals(Integer.class) || + detailsUrl.getClass().equals(String.class) || + detailsUrl.getClass().isEnum()) { + map.put("details_url", detailsUrl); + } else if (isListOfFile(detailsUrl)) { + for(int i = 0; i< getListSize(detailsUrl); i++) { + map.put("details_url[" + i + "]", getFromList(detailsUrl, i)); + } + } + else { + map.put("details_url", JSON.getDefault().getMapper().writeValueAsString(detailsUrl)); + } } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } - public SignatureRequestResponse signatures( - @javax.annotation.Nullable List signatures) { - this.signatures = signatures; - return this; + if (ccEmailAddresses.getClass().equals(java.io.File.class) || + ccEmailAddresses.getClass().equals(Integer.class) || + ccEmailAddresses.getClass().equals(String.class) || + ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for(int i = 0; i< getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } + else { + map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - public SignatureRequestResponse addSignaturesItem( - SignatureRequestResponseSignatures signaturesItem) { - if (this.signatures == null) { - this.signatures = new ArrayList<>(); + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); } - this.signatures.add(signaturesItem); - return this; } + if (finalCopyUri != null) { + if (isFileTypeOrListOfFiles(finalCopyUri)) { + fileTypeFound = true; + } - /** - * An array of signature objects, 1 for each signer. - * - * @return signatures - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSignatures() { - return signatures; + if (finalCopyUri.getClass().equals(java.io.File.class) || + finalCopyUri.getClass().equals(Integer.class) || + finalCopyUri.getClass().equals(String.class) || + finalCopyUri.getClass().isEnum()) { + map.put("final_copy_uri", finalCopyUri); + } else if (isListOfFile(finalCopyUri)) { + for(int i = 0; i< getListSize(finalCopyUri); i++) { + map.put("final_copy_uri[" + i + "]", getFromList(finalCopyUri, i)); + } + } + else { + map.put("final_copy_uri", JSON.getDefault().getMapper().writeValueAsString(finalCopyUri)); + } } + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNATURES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatures( - @javax.annotation.Nullable List signatures) { - this.signatures = signatures; + if (templateIds.getClass().equals(java.io.File.class) || + templateIds.getClass().equals(Integer.class) || + templateIds.getClass().equals(String.class) || + templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for(int i = 0; i< getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } + else { + map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - public SignatureRequestResponse bulkSendJobId(@javax.annotation.Nullable String bulkSendJobId) { - this.bulkSendJobId = bulkSendJobId; - return this; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } - /** - * The ID of the Bulk Send job which sent the signature request, if applicable. - * - * @return bulkSendJobId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBulkSendJobId() { - return bulkSendJobId; + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + } } + if (responseData != null) { + if (isFileTypeOrListOfFiles(responseData)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBulkSendJobId(@javax.annotation.Nullable String bulkSendJobId) { - this.bulkSendJobId = bulkSendJobId; + if (responseData.getClass().equals(java.io.File.class) || + responseData.getClass().equals(Integer.class) || + responseData.getClass().equals(String.class) || + responseData.getClass().isEnum()) { + map.put("response_data", responseData); + } else if (isListOfFile(responseData)) { + for(int i = 0; i< getListSize(responseData); i++) { + map.put("response_data[" + i + "]", getFromList(responseData, i)); + } + } + else { + map.put("response_data", JSON.getDefault().getMapper().writeValueAsString(responseData)); + } } + if (signatures != null) { + if (isFileTypeOrListOfFiles(signatures)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponse signatureRequestResponse = (SignatureRequestResponse) o; - return Objects.equals(this.testMode, signatureRequestResponse.testMode) - && Objects.equals( - this.signatureRequestId, signatureRequestResponse.signatureRequestId) - && Objects.equals( - this.requesterEmailAddress, signatureRequestResponse.requesterEmailAddress) - && Objects.equals(this.title, signatureRequestResponse.title) - && Objects.equals(this.originalTitle, signatureRequestResponse.originalTitle) - && Objects.equals(this.subject, signatureRequestResponse.subject) - && Objects.equals(this.message, signatureRequestResponse.message) - && Objects.equals(this.metadata, signatureRequestResponse.metadata) - && Objects.equals(this.createdAt, signatureRequestResponse.createdAt) - && Objects.equals(this.expiresAt, signatureRequestResponse.expiresAt) - && Objects.equals(this.isComplete, signatureRequestResponse.isComplete) - && Objects.equals(this.isDeclined, signatureRequestResponse.isDeclined) - && Objects.equals(this.hasError, signatureRequestResponse.hasError) - && Objects.equals(this.filesUrl, signatureRequestResponse.filesUrl) - && Objects.equals(this.signingUrl, signatureRequestResponse.signingUrl) - && Objects.equals(this.detailsUrl, signatureRequestResponse.detailsUrl) - && Objects.equals(this.ccEmailAddresses, signatureRequestResponse.ccEmailAddresses) - && Objects.equals( - this.signingRedirectUrl, signatureRequestResponse.signingRedirectUrl) - && Objects.equals(this.finalCopyUri, signatureRequestResponse.finalCopyUri) - && Objects.equals(this.templateIds, signatureRequestResponse.templateIds) - && Objects.equals(this.customFields, signatureRequestResponse.customFields) - && Objects.equals(this.attachments, signatureRequestResponse.attachments) - && Objects.equals(this.responseData, signatureRequestResponse.responseData) - && Objects.equals(this.signatures, signatureRequestResponse.signatures) - && Objects.equals(this.bulkSendJobId, signatureRequestResponse.bulkSendJobId); + if (signatures.getClass().equals(java.io.File.class) || + signatures.getClass().equals(Integer.class) || + signatures.getClass().equals(String.class) || + signatures.getClass().isEnum()) { + map.put("signatures", signatures); + } else if (isListOfFile(signatures)) { + for(int i = 0; i< getListSize(signatures); i++) { + map.put("signatures[" + i + "]", getFromList(signatures, i)); + } + } + else { + map.put("signatures", JSON.getDefault().getMapper().writeValueAsString(signatures)); + } } + if (bulkSendJobId != null) { + if (isFileTypeOrListOfFiles(bulkSendJobId)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - testMode, - signatureRequestId, - requesterEmailAddress, - title, - originalTitle, - subject, - message, - metadata, - createdAt, - expiresAt, - isComplete, - isDeclined, - hasError, - filesUrl, - signingUrl, - detailsUrl, - ccEmailAddresses, - signingRedirectUrl, - finalCopyUri, - templateIds, - customFields, - attachments, - responseData, - signatures, - bulkSendJobId); + if (bulkSendJobId.getClass().equals(java.io.File.class) || + bulkSendJobId.getClass().equals(Integer.class) || + bulkSendJobId.getClass().equals(String.class) || + bulkSendJobId.getClass().isEnum()) { + map.put("bulk_send_job_id", bulkSendJobId); + } else if (isListOfFile(bulkSendJobId)) { + for(int i = 0; i< getListSize(bulkSendJobId); i++) { + map.put("bulk_send_job_id[" + i + "]", getFromList(bulkSendJobId, i)); + } + } + else { + map.put("bulk_send_job_id", JSON.getDefault().getMapper().writeValueAsString(bulkSendJobId)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponse {\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" signatureRequestId: ") - .append(toIndentedString(signatureRequestId)) - .append("\n"); - sb.append(" requesterEmailAddress: ") - .append(toIndentedString(requesterEmailAddress)) - .append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append(" isComplete: ").append(toIndentedString(isComplete)).append("\n"); - sb.append(" isDeclined: ").append(toIndentedString(isDeclined)).append("\n"); - sb.append(" hasError: ").append(toIndentedString(hasError)).append("\n"); - sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); - sb.append(" signingUrl: ").append(toIndentedString(signingUrl)).append("\n"); - sb.append(" detailsUrl: ").append(toIndentedString(detailsUrl)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" finalCopyUri: ").append(toIndentedString(finalCopyUri)).append("\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" responseData: ").append(toIndentedString(responseData)).append("\n"); - sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); - sb.append(" bulkSendJobId: ").append(toIndentedString(bulkSendJobId)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (signatureRequestId != null) { - if (isFileTypeOrListOfFiles(signatureRequestId)) { - fileTypeFound = true; - } - - if (signatureRequestId.getClass().equals(java.io.File.class) - || signatureRequestId.getClass().equals(Integer.class) - || signatureRequestId.getClass().equals(String.class) - || signatureRequestId.getClass().isEnum()) { - map.put("signature_request_id", signatureRequestId); - } else if (isListOfFile(signatureRequestId)) { - for (int i = 0; i < getListSize(signatureRequestId); i++) { - map.put( - "signature_request_id[" + i + "]", - getFromList(signatureRequestId, i)); - } - } else { - map.put( - "signature_request_id", - JSON.getDefault().getMapper().writeValueAsString(signatureRequestId)); - } - } - if (requesterEmailAddress != null) { - if (isFileTypeOrListOfFiles(requesterEmailAddress)) { - fileTypeFound = true; - } - - if (requesterEmailAddress.getClass().equals(java.io.File.class) - || requesterEmailAddress.getClass().equals(Integer.class) - || requesterEmailAddress.getClass().equals(String.class) - || requesterEmailAddress.getClass().isEnum()) { - map.put("requester_email_address", requesterEmailAddress); - } else if (isListOfFile(requesterEmailAddress)) { - for (int i = 0; i < getListSize(requesterEmailAddress); i++) { - map.put( - "requester_email_address[" + i + "]", - getFromList(requesterEmailAddress, i)); - } - } else { - map.put( - "requester_email_address", - JSON.getDefault() - .getMapper() - .writeValueAsString(requesterEmailAddress)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (originalTitle != null) { - if (isFileTypeOrListOfFiles(originalTitle)) { - fileTypeFound = true; - } - - if (originalTitle.getClass().equals(java.io.File.class) - || originalTitle.getClass().equals(Integer.class) - || originalTitle.getClass().equals(String.class) - || originalTitle.getClass().isEnum()) { - map.put("original_title", originalTitle); - } else if (isListOfFile(originalTitle)) { - for (int i = 0; i < getListSize(originalTitle); i++) { - map.put("original_title[" + i + "]", getFromList(originalTitle, i)); - } - } else { - map.put( - "original_title", - JSON.getDefault().getMapper().writeValueAsString(originalTitle)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (createdAt != null) { - if (isFileTypeOrListOfFiles(createdAt)) { - fileTypeFound = true; - } - - if (createdAt.getClass().equals(java.io.File.class) - || createdAt.getClass().equals(Integer.class) - || createdAt.getClass().equals(String.class) - || createdAt.getClass().isEnum()) { - map.put("created_at", createdAt); - } else if (isListOfFile(createdAt)) { - for (int i = 0; i < getListSize(createdAt); i++) { - map.put("created_at[" + i + "]", getFromList(createdAt, i)); - } - } else { - map.put( - "created_at", - JSON.getDefault().getMapper().writeValueAsString(createdAt)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - if (isComplete != null) { - if (isFileTypeOrListOfFiles(isComplete)) { - fileTypeFound = true; - } - - if (isComplete.getClass().equals(java.io.File.class) - || isComplete.getClass().equals(Integer.class) - || isComplete.getClass().equals(String.class) - || isComplete.getClass().isEnum()) { - map.put("is_complete", isComplete); - } else if (isListOfFile(isComplete)) { - for (int i = 0; i < getListSize(isComplete); i++) { - map.put("is_complete[" + i + "]", getFromList(isComplete, i)); - } - } else { - map.put( - "is_complete", - JSON.getDefault().getMapper().writeValueAsString(isComplete)); - } - } - if (isDeclined != null) { - if (isFileTypeOrListOfFiles(isDeclined)) { - fileTypeFound = true; - } - - if (isDeclined.getClass().equals(java.io.File.class) - || isDeclined.getClass().equals(Integer.class) - || isDeclined.getClass().equals(String.class) - || isDeclined.getClass().isEnum()) { - map.put("is_declined", isDeclined); - } else if (isListOfFile(isDeclined)) { - for (int i = 0; i < getListSize(isDeclined); i++) { - map.put("is_declined[" + i + "]", getFromList(isDeclined, i)); - } - } else { - map.put( - "is_declined", - JSON.getDefault().getMapper().writeValueAsString(isDeclined)); - } - } - if (hasError != null) { - if (isFileTypeOrListOfFiles(hasError)) { - fileTypeFound = true; - } - - if (hasError.getClass().equals(java.io.File.class) - || hasError.getClass().equals(Integer.class) - || hasError.getClass().equals(String.class) - || hasError.getClass().isEnum()) { - map.put("has_error", hasError); - } else if (isListOfFile(hasError)) { - for (int i = 0; i < getListSize(hasError); i++) { - map.put("has_error[" + i + "]", getFromList(hasError, i)); - } - } else { - map.put( - "has_error", - JSON.getDefault().getMapper().writeValueAsString(hasError)); - } - } - if (filesUrl != null) { - if (isFileTypeOrListOfFiles(filesUrl)) { - fileTypeFound = true; - } - - if (filesUrl.getClass().equals(java.io.File.class) - || filesUrl.getClass().equals(Integer.class) - || filesUrl.getClass().equals(String.class) - || filesUrl.getClass().isEnum()) { - map.put("files_url", filesUrl); - } else if (isListOfFile(filesUrl)) { - for (int i = 0; i < getListSize(filesUrl); i++) { - map.put("files_url[" + i + "]", getFromList(filesUrl, i)); - } - } else { - map.put( - "files_url", - JSON.getDefault().getMapper().writeValueAsString(filesUrl)); - } - } - if (signingUrl != null) { - if (isFileTypeOrListOfFiles(signingUrl)) { - fileTypeFound = true; - } - - if (signingUrl.getClass().equals(java.io.File.class) - || signingUrl.getClass().equals(Integer.class) - || signingUrl.getClass().equals(String.class) - || signingUrl.getClass().isEnum()) { - map.put("signing_url", signingUrl); - } else if (isListOfFile(signingUrl)) { - for (int i = 0; i < getListSize(signingUrl); i++) { - map.put("signing_url[" + i + "]", getFromList(signingUrl, i)); - } - } else { - map.put( - "signing_url", - JSON.getDefault().getMapper().writeValueAsString(signingUrl)); - } - } - if (detailsUrl != null) { - if (isFileTypeOrListOfFiles(detailsUrl)) { - fileTypeFound = true; - } - - if (detailsUrl.getClass().equals(java.io.File.class) - || detailsUrl.getClass().equals(Integer.class) - || detailsUrl.getClass().equals(String.class) - || detailsUrl.getClass().isEnum()) { - map.put("details_url", detailsUrl); - } else if (isListOfFile(detailsUrl)) { - for (int i = 0; i < getListSize(detailsUrl); i++) { - map.put("details_url[" + i + "]", getFromList(detailsUrl, i)); - } - } else { - map.put( - "details_url", - JSON.getDefault().getMapper().writeValueAsString(detailsUrl)); - } - } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - - if (ccEmailAddresses.getClass().equals(java.io.File.class) - || ccEmailAddresses.getClass().equals(Integer.class) - || ccEmailAddresses.getClass().equals(String.class) - || ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for (int i = 0; i < getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } else { - map.put( - "cc_email_addresses", - JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (finalCopyUri != null) { - if (isFileTypeOrListOfFiles(finalCopyUri)) { - fileTypeFound = true; - } - - if (finalCopyUri.getClass().equals(java.io.File.class) - || finalCopyUri.getClass().equals(Integer.class) - || finalCopyUri.getClass().equals(String.class) - || finalCopyUri.getClass().isEnum()) { - map.put("final_copy_uri", finalCopyUri); - } else if (isListOfFile(finalCopyUri)) { - for (int i = 0; i < getListSize(finalCopyUri); i++) { - map.put("final_copy_uri[" + i + "]", getFromList(finalCopyUri, i)); - } - } else { - map.put( - "final_copy_uri", - JSON.getDefault().getMapper().writeValueAsString(finalCopyUri)); - } - } - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } - - if (templateIds.getClass().equals(java.io.File.class) - || templateIds.getClass().equals(Integer.class) - || templateIds.getClass().equals(String.class) - || templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for (int i = 0; i < getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } else { - map.put( - "template_ids", - JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - - if (attachments.getClass().equals(java.io.File.class) - || attachments.getClass().equals(Integer.class) - || attachments.getClass().equals(String.class) - || attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for (int i = 0; i < getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } else { - map.put( - "attachments", - JSON.getDefault().getMapper().writeValueAsString(attachments)); - } - } - if (responseData != null) { - if (isFileTypeOrListOfFiles(responseData)) { - fileTypeFound = true; - } - - if (responseData.getClass().equals(java.io.File.class) - || responseData.getClass().equals(Integer.class) - || responseData.getClass().equals(String.class) - || responseData.getClass().isEnum()) { - map.put("response_data", responseData); - } else if (isListOfFile(responseData)) { - for (int i = 0; i < getListSize(responseData); i++) { - map.put("response_data[" + i + "]", getFromList(responseData, i)); - } - } else { - map.put( - "response_data", - JSON.getDefault().getMapper().writeValueAsString(responseData)); - } - } - if (signatures != null) { - if (isFileTypeOrListOfFiles(signatures)) { - fileTypeFound = true; - } - - if (signatures.getClass().equals(java.io.File.class) - || signatures.getClass().equals(Integer.class) - || signatures.getClass().equals(String.class) - || signatures.getClass().isEnum()) { - map.put("signatures", signatures); - } else if (isListOfFile(signatures)) { - for (int i = 0; i < getListSize(signatures); i++) { - map.put("signatures[" + i + "]", getFromList(signatures, i)); - } - } else { - map.put( - "signatures", - JSON.getDefault().getMapper().writeValueAsString(signatures)); - } - } - if (bulkSendJobId != null) { - if (isFileTypeOrListOfFiles(bulkSendJobId)) { - fileTypeFound = true; - } - - if (bulkSendJobId.getClass().equals(java.io.File.class) - || bulkSendJobId.getClass().equals(Integer.class) - || bulkSendJobId.getClass().equals(String.class) - || bulkSendJobId.getClass().isEnum()) { - map.put("bulk_send_job_id", bulkSendJobId); - } else if (isListOfFile(bulkSendJobId)) { - for (int i = 0; i < getListSize(bulkSendJobId); i++) { - map.put("bulk_send_job_id[" + i + "]", getFromList(bulkSendJobId, i)); - } - } else { - map.put( - "bulk_send_job_id", - JSON.getDefault().getMapper().writeValueAsString(bulkSendJobId)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java index 8c0486a26..153372722 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java @@ -10,411 +10,433 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** Signer attachments. */ + +import com.dropbox.sign.ApiException; +/** + * Signer attachments. + */ @JsonPropertyOrder({ - SignatureRequestResponseAttachment.JSON_PROPERTY_ID, - SignatureRequestResponseAttachment.JSON_PROPERTY_SIGNER, - SignatureRequestResponseAttachment.JSON_PROPERTY_NAME, - SignatureRequestResponseAttachment.JSON_PROPERTY_REQUIRED, - SignatureRequestResponseAttachment.JSON_PROPERTY_INSTRUCTIONS, - SignatureRequestResponseAttachment.JSON_PROPERTY_UPLOADED_AT + SignatureRequestResponseAttachment.JSON_PROPERTY_ID, + SignatureRequestResponseAttachment.JSON_PROPERTY_SIGNER, + SignatureRequestResponseAttachment.JSON_PROPERTY_NAME, + SignatureRequestResponseAttachment.JSON_PROPERTY_REQUIRED, + SignatureRequestResponseAttachment.JSON_PROPERTY_INSTRUCTIONS, + SignatureRequestResponseAttachment.JSON_PROPERTY_UPLOADED_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestResponseAttachment { - public static final String JSON_PROPERTY_ID = "id"; - @javax.annotation.Nonnull private String id; - - public static final String JSON_PROPERTY_SIGNER = "signer"; - @javax.annotation.Nonnull private String signer; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull private String name; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - @javax.annotation.Nonnull private Boolean required; - - public static final String JSON_PROPERTY_INSTRUCTIONS = "instructions"; - @javax.annotation.Nullable private String instructions; - - public static final String JSON_PROPERTY_UPLOADED_AT = "uploaded_at"; - @javax.annotation.Nullable private Integer uploadedAt; - - public SignatureRequestResponseAttachment() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseAttachment init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseAttachment.class); - } - - public static SignatureRequestResponseAttachment init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseAttachment.class); - } - - public SignatureRequestResponseAttachment id(@javax.annotation.Nonnull String id) { - this.id = id; - return this; - } - - /** - * The unique ID for this attachment. - * - * @return id - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setId(@javax.annotation.Nonnull String id) { - this.id = id; - } - - public SignatureRequestResponseAttachment signer(@javax.annotation.Nonnull String signer) { - this.signer = signer; - return this; - } - - public SignatureRequestResponseAttachment signer(Integer signer) { - this.signer = String.valueOf(signer); - return this; - } - - /** - * The Signer this attachment is assigned to. - * - * @return signer - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getSigner() { - return signer; - } - - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSigner(@javax.annotation.Nonnull String signer) { - this.signer = signer; - } - - public void setSigner(Integer signer) { - this.signer = String.valueOf(signer); - } - - public SignatureRequestResponseAttachment name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name of this attachment. - * - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public SignatureRequestResponseAttachment required(@javax.annotation.Nonnull Boolean required) { - this.required = required; - return this; - } - - /** - * A boolean value denoting if this attachment is required. - * - * @return required - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getRequired() { - return required; - } - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRequired(@javax.annotation.Nonnull Boolean required) { - this.required = required; - } - - public SignatureRequestResponseAttachment instructions( - @javax.annotation.Nullable String instructions) { - this.instructions = instructions; - return this; - } - - /** - * Instructions for Signer. - * - * @return instructions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getInstructions() { - return instructions; - } + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nonnull + private String id; + + public static final String JSON_PROPERTY_SIGNER = "signer"; + @javax.annotation.Nonnull + private String signer; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + @javax.annotation.Nonnull + private Boolean required; + + public static final String JSON_PROPERTY_INSTRUCTIONS = "instructions"; + @javax.annotation.Nullable + private String instructions; + + public static final String JSON_PROPERTY_UPLOADED_AT = "uploaded_at"; + @javax.annotation.Nullable + private Integer uploadedAt; + + public SignatureRequestResponseAttachment() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseAttachment init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseAttachment.class); + } + + static public SignatureRequestResponseAttachment init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseAttachment.class + ); + } + + public SignatureRequestResponseAttachment id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * The unique ID for this attachment. + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public SignatureRequestResponseAttachment signer(@javax.annotation.Nonnull String signer) { + this.signer = signer; + return this; + } + public SignatureRequestResponseAttachment signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } + + /** + * The Signer this attachment is assigned to. + * @return signer + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSigner() { + return signer; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigner(@javax.annotation.Nonnull String signer) { + this.signer = signer; + } + + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + + + public SignatureRequestResponseAttachment name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of this attachment. + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SignatureRequestResponseAttachment required(@javax.annotation.Nonnull Boolean required) { + this.required = required; + return this; + } + + /** + * A boolean value denoting if this attachment is required. + * @return required + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getRequired() { + return required; + } + + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequired(@javax.annotation.Nonnull Boolean required) { + this.required = required; + } + + + public SignatureRequestResponseAttachment instructions(@javax.annotation.Nullable String instructions) { + this.instructions = instructions; + return this; + } + + /** + * Instructions for Signer. + * @return instructions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getInstructions() { + return instructions; + } + + + @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstructions(@javax.annotation.Nullable String instructions) { + this.instructions = instructions; + } + + + public SignatureRequestResponseAttachment uploadedAt(@javax.annotation.Nullable Integer uploadedAt) { + this.uploadedAt = uploadedAt; + return this; + } + + /** + * Timestamp when attachment was uploaded by Signer. + * @return uploadedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOADED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadedAt() { + return uploadedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPLOADED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadedAt(@javax.annotation.Nullable Integer uploadedAt) { + this.uploadedAt = uploadedAt; + } + + + /** + * Return true if this SignatureRequestResponseAttachment object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponseAttachment signatureRequestResponseAttachment = (SignatureRequestResponseAttachment) o; + return Objects.equals(this.id, signatureRequestResponseAttachment.id) && + Objects.equals(this.signer, signatureRequestResponseAttachment.signer) && + Objects.equals(this.name, signatureRequestResponseAttachment.name) && + Objects.equals(this.required, signatureRequestResponseAttachment.required) && + Objects.equals(this.instructions, signatureRequestResponseAttachment.instructions) && + Objects.equals(this.uploadedAt, signatureRequestResponseAttachment.uploadedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, signer, name, required, instructions, uploadedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseAttachment {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); + sb.append(" uploadedAt: ").append(toIndentedString(uploadedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (id != null) { + if (isFileTypeOrListOfFiles(id)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInstructions(@javax.annotation.Nullable String instructions) { - this.instructions = instructions; + if (id.getClass().equals(java.io.File.class) || + id.getClass().equals(Integer.class) || + id.getClass().equals(String.class) || + id.getClass().isEnum()) { + map.put("id", id); + } else if (isListOfFile(id)) { + for(int i = 0; i< getListSize(id); i++) { + map.put("id[" + i + "]", getFromList(id, i)); + } + } + else { + map.put("id", JSON.getDefault().getMapper().writeValueAsString(id)); + } } + if (signer != null) { + if (isFileTypeOrListOfFiles(signer)) { + fileTypeFound = true; + } - public SignatureRequestResponseAttachment uploadedAt( - @javax.annotation.Nullable Integer uploadedAt) { - this.uploadedAt = uploadedAt; - return this; + if (signer.getClass().equals(java.io.File.class) || + signer.getClass().equals(Integer.class) || + signer.getClass().equals(String.class) || + signer.getClass().isEnum()) { + map.put("signer", signer); + } else if (isListOfFile(signer)) { + for(int i = 0; i< getListSize(signer); i++) { + map.put("signer[" + i + "]", getFromList(signer, i)); + } + } + else { + map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** - * Timestamp when attachment was uploaded by Signer. - * - * @return uploadedAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UPLOADED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getUploadedAt() { - return uploadedAt; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_UPLOADED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUploadedAt(@javax.annotation.Nullable Integer uploadedAt) { - this.uploadedAt = uploadedAt; + if (required.getClass().equals(java.io.File.class) || + required.getClass().equals(Integer.class) || + required.getClass().equals(String.class) || + required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for(int i = 0; i< getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } + else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } } + if (instructions != null) { + if (isFileTypeOrListOfFiles(instructions)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseAttachment object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (instructions.getClass().equals(java.io.File.class) || + instructions.getClass().equals(Integer.class) || + instructions.getClass().equals(String.class) || + instructions.getClass().isEnum()) { + map.put("instructions", instructions); + } else if (isListOfFile(instructions)) { + for(int i = 0; i< getListSize(instructions); i++) { + map.put("instructions[" + i + "]", getFromList(instructions, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("instructions", JSON.getDefault().getMapper().writeValueAsString(instructions)); } - SignatureRequestResponseAttachment signatureRequestResponseAttachment = - (SignatureRequestResponseAttachment) o; - return Objects.equals(this.id, signatureRequestResponseAttachment.id) - && Objects.equals(this.signer, signatureRequestResponseAttachment.signer) - && Objects.equals(this.name, signatureRequestResponseAttachment.name) - && Objects.equals(this.required, signatureRequestResponseAttachment.required) - && Objects.equals( - this.instructions, signatureRequestResponseAttachment.instructions) - && Objects.equals(this.uploadedAt, signatureRequestResponseAttachment.uploadedAt); } + if (uploadedAt != null) { + if (isFileTypeOrListOfFiles(uploadedAt)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(id, signer, name, required, instructions, uploadedAt); + if (uploadedAt.getClass().equals(java.io.File.class) || + uploadedAt.getClass().equals(Integer.class) || + uploadedAt.getClass().equals(String.class) || + uploadedAt.getClass().isEnum()) { + map.put("uploaded_at", uploadedAt); + } else if (isListOfFile(uploadedAt)) { + for(int i = 0; i< getListSize(uploadedAt); i++) { + map.put("uploaded_at[" + i + "]", getFromList(uploadedAt, i)); + } + } + else { + map.put("uploaded_at", JSON.getDefault().getMapper().writeValueAsString(uploadedAt)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseAttachment {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); - sb.append(" uploadedAt: ").append(toIndentedString(uploadedAt)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (id != null) { - if (isFileTypeOrListOfFiles(id)) { - fileTypeFound = true; - } - - if (id.getClass().equals(java.io.File.class) - || id.getClass().equals(Integer.class) - || id.getClass().equals(String.class) - || id.getClass().isEnum()) { - map.put("id", id); - } else if (isListOfFile(id)) { - for (int i = 0; i < getListSize(id); i++) { - map.put("id[" + i + "]", getFromList(id, i)); - } - } else { - map.put("id", JSON.getDefault().getMapper().writeValueAsString(id)); - } - } - if (signer != null) { - if (isFileTypeOrListOfFiles(signer)) { - fileTypeFound = true; - } - - if (signer.getClass().equals(java.io.File.class) - || signer.getClass().equals(Integer.class) - || signer.getClass().equals(String.class) - || signer.getClass().isEnum()) { - map.put("signer", signer); - } else if (isListOfFile(signer)) { - for (int i = 0; i < getListSize(signer); i++) { - map.put("signer[" + i + "]", getFromList(signer, i)); - } - } else { - map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - - if (required.getClass().equals(java.io.File.class) - || required.getClass().equals(Integer.class) - || required.getClass().equals(String.class) - || required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for (int i = 0; i < getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } - } - if (instructions != null) { - if (isFileTypeOrListOfFiles(instructions)) { - fileTypeFound = true; - } - - if (instructions.getClass().equals(java.io.File.class) - || instructions.getClass().equals(Integer.class) - || instructions.getClass().equals(String.class) - || instructions.getClass().isEnum()) { - map.put("instructions", instructions); - } else if (isListOfFile(instructions)) { - for (int i = 0; i < getListSize(instructions); i++) { - map.put("instructions[" + i + "]", getFromList(instructions, i)); - } - } else { - map.put( - "instructions", - JSON.getDefault().getMapper().writeValueAsString(instructions)); - } - } - if (uploadedAt != null) { - if (isFileTypeOrListOfFiles(uploadedAt)) { - fileTypeFound = true; - } - - if (uploadedAt.getClass().equals(java.io.File.class) - || uploadedAt.getClass().equals(Integer.class) - || uploadedAt.getClass().equals(String.class) - || uploadedAt.getClass().isEnum()) { - map.put("uploaded_at", uploadedAt); - } else if (isListOfFile(uploadedAt)) { - for (int i = 0; i < getListSize(uploadedAt); i++) { - map.put("uploaded_at[" + i + "]", getFromList(uploadedAt, i)); - } - } else { - map.put( - "uploaded_at", - JSON.getDefault().getMapper().writeValueAsString(uploadedAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java index 4eb96aa4d..2939fac4c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java @@ -10,381 +10,394 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; + +import com.dropbox.sign.ApiException; /** - * An array of Custom Field objects containing the name and type of each custom field. * Text Field - * uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses - * `SignatureRequestResponseCustomFieldCheckbox` + * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` */ @JsonPropertyOrder({ - SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_TYPE, - SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_NAME, - SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_REQUIRED, - SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_API_ID, - SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_EDITOR + SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_TYPE, + SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_NAME, + SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_REQUIRED, + SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_API_ID, + SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_EDITOR }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type( - value = SignatureRequestResponseCustomFieldCheckbox.class, - name = "checkbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldText.class, name = "text"), + @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldCheckbox.class, name = "checkbox"), + @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldText.class, name = "text"), }) -public class SignatureRequestResponseCustomFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull private String name; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - @javax.annotation.Nullable private Boolean required; - - public static final String JSON_PROPERTY_API_ID = "api_id"; - @javax.annotation.Nullable private String apiId; - - public static final String JSON_PROPERTY_EDITOR = "editor"; - @javax.annotation.Nullable private String editor; - - public SignatureRequestResponseCustomFieldBase() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseCustomFieldBase init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestResponseCustomFieldBase.class); - } - - public static SignatureRequestResponseCustomFieldBase init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseCustomFieldBase.class); - } - - public SignatureRequestResponseCustomFieldBase type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this Custom Field. Only 'text' and 'checkbox' are currently - * supported. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public SignatureRequestResponseCustomFieldBase name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name of the Custom Field. - * - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public SignatureRequestResponseCustomFieldBase required( - @javax.annotation.Nullable Boolean required) { - this.required = required; - return this; - } - - /** - * A boolean value denoting if this field is required. - * - * @return required - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getRequired() { - return required; - } - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(@javax.annotation.Nullable Boolean required) { - this.required = required; - } - - public SignatureRequestResponseCustomFieldBase apiId(@javax.annotation.Nullable String apiId) { - this.apiId = apiId; - return this; - } - - /** - * The unique ID for this field. - * - * @return apiId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getApiId() { - return apiId; - } - - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiId(@javax.annotation.Nullable String apiId) { - this.apiId = apiId; - } - - public SignatureRequestResponseCustomFieldBase editor( - @javax.annotation.Nullable String editor) { - this.editor = editor; - return this; +public class SignatureRequestResponseCustomFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + @javax.annotation.Nullable + private Boolean required; + + public static final String JSON_PROPERTY_API_ID = "api_id"; + @javax.annotation.Nullable + private String apiId; + + public static final String JSON_PROPERTY_EDITOR = "editor"; + @javax.annotation.Nullable + private String editor; + + public SignatureRequestResponseCustomFieldBase() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseCustomFieldBase init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseCustomFieldBase.class); + } + + static public SignatureRequestResponseCustomFieldBase init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseCustomFieldBase.class + ); + } + + public SignatureRequestResponseCustomFieldBase type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SignatureRequestResponseCustomFieldBase name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the Custom Field. + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SignatureRequestResponseCustomFieldBase required(@javax.annotation.Nullable Boolean required) { + this.required = required; + return this; + } + + /** + * A boolean value denoting if this field is required. + * @return required + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRequired() { + return required; + } + + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(@javax.annotation.Nullable Boolean required) { + this.required = required; + } + + + public SignatureRequestResponseCustomFieldBase apiId(@javax.annotation.Nullable String apiId) { + this.apiId = apiId; + return this; + } + + /** + * The unique ID for this field. + * @return apiId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getApiId() { + return apiId; + } + + + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiId(@javax.annotation.Nullable String apiId) { + this.apiId = apiId; + } + + + public SignatureRequestResponseCustomFieldBase editor(@javax.annotation.Nullable String editor) { + this.editor = editor; + return this; + } + + /** + * The name of the Role that is able to edit this field. + * @return editor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EDITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEditor() { + return editor; + } + + + @JsonProperty(JSON_PROPERTY_EDITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditor(@javax.annotation.Nullable String editor) { + this.editor = editor; + } + + + /** + * Return true if this SignatureRequestResponseCustomFieldBase object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * The name of the Role that is able to edit this field. - * - * @return editor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEditor() { - return editor; + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseCustomFieldBase signatureRequestResponseCustomFieldBase = (SignatureRequestResponseCustomFieldBase) o; + return Objects.equals(this.type, signatureRequestResponseCustomFieldBase.type) && + Objects.equals(this.name, signatureRequestResponseCustomFieldBase.name) && + Objects.equals(this.required, signatureRequestResponseCustomFieldBase.required) && + Objects.equals(this.apiId, signatureRequestResponseCustomFieldBase.apiId) && + Objects.equals(this.editor, signatureRequestResponseCustomFieldBase.editor); + } + + @Override + public int hashCode() { + return Objects.hash(type, name, required, apiId, editor); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseCustomFieldBase {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); + sb.append(" editor: ").append(toIndentedString(editor)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EDITOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditor(@javax.annotation.Nullable String editor) { - this.editor = editor; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseCustomFieldBase object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); } - SignatureRequestResponseCustomFieldBase signatureRequestResponseCustomFieldBase = - (SignatureRequestResponseCustomFieldBase) o; - return Objects.equals(this.type, signatureRequestResponseCustomFieldBase.type) - && Objects.equals(this.name, signatureRequestResponseCustomFieldBase.name) - && Objects.equals(this.required, signatureRequestResponseCustomFieldBase.required) - && Objects.equals(this.apiId, signatureRequestResponseCustomFieldBase.apiId) - && Objects.equals(this.editor, signatureRequestResponseCustomFieldBase.editor); } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(type, name, required, apiId, editor); + if (required.getClass().equals(java.io.File.class) || + required.getClass().equals(Integer.class) || + required.getClass().equals(String.class) || + required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for(int i = 0; i< getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } + else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } } + if (apiId != null) { + if (isFileTypeOrListOfFiles(apiId)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseCustomFieldBase {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); - sb.append(" editor: ").append(toIndentedString(editor)).append("\n"); - sb.append("}"); - return sb.toString(); + if (apiId.getClass().equals(java.io.File.class) || + apiId.getClass().equals(Integer.class) || + apiId.getClass().equals(String.class) || + apiId.getClass().isEnum()) { + map.put("api_id", apiId); + } else if (isListOfFile(apiId)) { + for(int i = 0; i< getListSize(apiId); i++) { + map.put("api_id[" + i + "]", getFromList(apiId, i)); + } + } + else { + map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + } } + if (editor != null) { + if (isFileTypeOrListOfFiles(editor)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + if (editor.getClass().equals(java.io.File.class) || + editor.getClass().equals(Integer.class) || + editor.getClass().equals(String.class) || + editor.getClass().isEnum()) { + map.put("editor", editor); + } else if (isListOfFile(editor)) { + for(int i = 0; i< getListSize(editor); i++) { + map.put("editor[" + i + "]", getFromList(editor, i)); } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - - if (required.getClass().equals(java.io.File.class) - || required.getClass().equals(Integer.class) - || required.getClass().equals(String.class) - || required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for (int i = 0; i < getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } - } - if (apiId != null) { - if (isFileTypeOrListOfFiles(apiId)) { - fileTypeFound = true; - } - - if (apiId.getClass().equals(java.io.File.class) - || apiId.getClass().equals(Integer.class) - || apiId.getClass().equals(String.class) - || apiId.getClass().isEnum()) { - map.put("api_id", apiId); - } else if (isListOfFile(apiId)) { - for (int i = 0; i < getListSize(apiId); i++) { - map.put("api_id[" + i + "]", getFromList(apiId, i)); - } - } else { - map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); - } - } - if (editor != null) { - if (isFileTypeOrListOfFiles(editor)) { - fileTypeFound = true; - } - - if (editor.getClass().equals(java.io.File.class) - || editor.getClass().equals(Integer.class) - || editor.getClass().equals(String.class) - || editor.getClass().isEnum()) { - map.put("editor", editor); - } else if (isListOfFile(editor)) { - for (int i = 0; i < getListSize(editor); i++) { - map.put("editor[" + i + "]", getFromList(editor, i)); - } - } else { - map.put("editor", JSON.getDefault().getMapper().writeValueAsString(editor)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("editor", JSON.getDefault().getMapper().writeValueAsString(editor)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("checkbox", SignatureRequestResponseCustomFieldCheckbox.class); - mappings.put("text", SignatureRequestResponseCustomFieldText.class); - mappings.put( - "SignatureRequestResponseCustomFieldBase", - SignatureRequestResponseCustomFieldBase.class); - JSON.registerDiscriminator(SignatureRequestResponseCustomFieldBase.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("checkbox", SignatureRequestResponseCustomFieldCheckbox.class); + mappings.put("text", SignatureRequestResponseCustomFieldText.class); + mappings.put("SignatureRequestResponseCustomFieldBase", SignatureRequestResponseCustomFieldBase.class); + JSON.registerDiscriminator(SignatureRequestResponseCustomFieldBase.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java index 8e0952e3d..ca8b39630 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java @@ -10,234 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseCustomFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `SignatureRequestResponseCustomFieldBase`. */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `SignatureRequestResponseCustomFieldBase`. + */ @JsonPropertyOrder({ - SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_TYPE, - SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_VALUE + SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_TYPE, + SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SignatureRequestResponseCustomFieldCheckbox - extends SignatureRequestResponseCustomFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "checkbox"; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private Boolean value; - - public SignatureRequestResponseCustomFieldCheckbox() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseCustomFieldCheckbox init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestResponseCustomFieldCheckbox.class); - } - - public static SignatureRequestResponseCustomFieldCheckbox init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseCustomFieldCheckbox.class); - } - - public SignatureRequestResponseCustomFieldCheckbox type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this Custom Field. Only 'text' and 'checkbox' are currently - * supported. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public SignatureRequestResponseCustomFieldCheckbox value( - @javax.annotation.Nullable Boolean value) { - this.value = value; - return this; - } - - /** - * A true/false for checkbox fields - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable Boolean value) { - this.value = value; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestResponseCustomFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "checkbox"; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private Boolean value; + + public SignatureRequestResponseCustomFieldCheckbox() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseCustomFieldCheckbox init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseCustomFieldCheckbox.class); + } + + static public SignatureRequestResponseCustomFieldCheckbox init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseCustomFieldCheckbox.class + ); + } + + public SignatureRequestResponseCustomFieldCheckbox type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SignatureRequestResponseCustomFieldCheckbox value(@javax.annotation.Nullable Boolean value) { + this.value = value; + return this; + } + + /** + * A true/false for checkbox fields + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable Boolean value) { + this.value = value; + } + + + /** + * Return true if this SignatureRequestResponseCustomFieldCheckbox object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponseCustomFieldCheckbox signatureRequestResponseCustomFieldCheckbox = (SignatureRequestResponseCustomFieldCheckbox) o; + return Objects.equals(this.type, signatureRequestResponseCustomFieldCheckbox.type) && + Objects.equals(this.value, signatureRequestResponseCustomFieldCheckbox.value) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseCustomFieldCheckbox {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseCustomFieldCheckbox object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SignatureRequestResponseCustomFieldCheckbox signatureRequestResponseCustomFieldCheckbox = - (SignatureRequestResponseCustomFieldCheckbox) o; - return Objects.equals(this.type, signatureRequestResponseCustomFieldCheckbox.type) - && Objects.equals(this.value, signatureRequestResponseCustomFieldCheckbox.value) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseCustomFieldCheckbox {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SignatureRequestResponseCustomFieldCheckbox", - SignatureRequestResponseCustomFieldCheckbox.class); - JSON.registerDiscriminator( - SignatureRequestResponseCustomFieldCheckbox.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseCustomFieldCheckbox", SignatureRequestResponseCustomFieldCheckbox.class); + JSON.registerDiscriminator(SignatureRequestResponseCustomFieldCheckbox.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java index bb882571a..8cce8639f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java @@ -10,231 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseCustomFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `SignatureRequestResponseCustomFieldBase`. */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `SignatureRequestResponseCustomFieldBase`. + */ @JsonPropertyOrder({ - SignatureRequestResponseCustomFieldText.JSON_PROPERTY_TYPE, - SignatureRequestResponseCustomFieldText.JSON_PROPERTY_VALUE + SignatureRequestResponseCustomFieldText.JSON_PROPERTY_TYPE, + SignatureRequestResponseCustomFieldText.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SignatureRequestResponseCustomFieldText - extends SignatureRequestResponseCustomFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "text"; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private String value; - - public SignatureRequestResponseCustomFieldText() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseCustomFieldText init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestResponseCustomFieldText.class); - } - - public static SignatureRequestResponseCustomFieldText init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseCustomFieldText.class); - } - - public SignatureRequestResponseCustomFieldText type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this Custom Field. Only 'text' and 'checkbox' are currently - * supported. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public SignatureRequestResponseCustomFieldText value(@javax.annotation.Nullable String value) { - this.value = value; - return this; - } - - /** - * A text string for text fields - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCustomFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "text"; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private String value; + + public SignatureRequestResponseCustomFieldText() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseCustomFieldText init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseCustomFieldText.class); + } + + static public SignatureRequestResponseCustomFieldText init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseCustomFieldText.class + ); + } + + public SignatureRequestResponseCustomFieldText type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SignatureRequestResponseCustomFieldText value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * A text string for text fields + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + /** + * Return true if this SignatureRequestResponseCustomFieldText object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponseCustomFieldText signatureRequestResponseCustomFieldText = (SignatureRequestResponseCustomFieldText) o; + return Objects.equals(this.type, signatureRequestResponseCustomFieldText.type) && + Objects.equals(this.value, signatureRequestResponseCustomFieldText.value) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseCustomFieldText {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseCustomFieldText object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SignatureRequestResponseCustomFieldText signatureRequestResponseCustomFieldText = - (SignatureRequestResponseCustomFieldText) o; - return Objects.equals(this.type, signatureRequestResponseCustomFieldText.type) - && Objects.equals(this.value, signatureRequestResponseCustomFieldText.value) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseCustomFieldText {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SignatureRequestResponseCustomFieldText", - SignatureRequestResponseCustomFieldText.class); - JSON.registerDiscriminator(SignatureRequestResponseCustomFieldText.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseCustomFieldText", SignatureRequestResponseCustomFieldText.class); + JSON.registerDiscriminator(SignatureRequestResponseCustomFieldText.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java index 356385d32..c4ae5b305 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java @@ -10,41 +10,54 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets SignatureRequestResponseCustomFieldTypeEnum */ +/** + * Gets or Sets SignatureRequestResponseCustomFieldTypeEnum + */ public enum SignatureRequestResponseCustomFieldTypeEnum { - TEXT("text"), - - CHECKBOX("checkbox"); - - private String value; - - SignatureRequestResponseCustomFieldTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SignatureRequestResponseCustomFieldTypeEnum fromValue(String value) { - for (SignatureRequestResponseCustomFieldTypeEnum b : - SignatureRequestResponseCustomFieldTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + + TEXT("text"), + + CHECKBOX("checkbox"); + + private String value; + + SignatureRequestResponseCustomFieldTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SignatureRequestResponseCustomFieldTypeEnum fromValue(String value) { + for (SignatureRequestResponseCustomFieldTypeEnum b : SignatureRequestResponseCustomFieldTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java index e50d2024f..e0ccb86ba 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java @@ -10,395 +10,408 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; + +import com.dropbox.sign.ApiException; /** - * An array of form field objects containing the name, value, and type of each textbox or checkmark - * field filled in by the signers. + * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. */ @JsonPropertyOrder({ - SignatureRequestResponseDataBase.JSON_PROPERTY_API_ID, - SignatureRequestResponseDataBase.JSON_PROPERTY_SIGNATURE_ID, - SignatureRequestResponseDataBase.JSON_PROPERTY_NAME, - SignatureRequestResponseDataBase.JSON_PROPERTY_REQUIRED, - SignatureRequestResponseDataBase.JSON_PROPERTY_TYPE + SignatureRequestResponseDataBase.JSON_PROPERTY_API_ID, + SignatureRequestResponseDataBase.JSON_PROPERTY_SIGNATURE_ID, + SignatureRequestResponseDataBase.JSON_PROPERTY_NAME, + SignatureRequestResponseDataBase.JSON_PROPERTY_REQUIRED, + SignatureRequestResponseDataBase.JSON_PROPERTY_TYPE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type( - value = SignatureRequestResponseDataValueCheckboxMerge.class, - name = "checkbox-merge"), - @JsonSubTypes.Type( - value = SignatureRequestResponseDataValueDateSigned.class, - name = "date_signed"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueRadio.class, name = "radio"), - @JsonSubTypes.Type( - value = SignatureRequestResponseDataValueSignature.class, - name = "signature"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueText.class, name = "text"), - @JsonSubTypes.Type( - value = SignatureRequestResponseDataValueTextMerge.class, - name = "text-merge"), + @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), + @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckboxMerge.class, name = "checkbox-merge"), + @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDateSigned.class, name = "date_signed"), + @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDropdown.class, name = "dropdown"), + @JsonSubTypes.Type(value = SignatureRequestResponseDataValueInitials.class, name = "initials"), + @JsonSubTypes.Type(value = SignatureRequestResponseDataValueRadio.class, name = "radio"), + @JsonSubTypes.Type(value = SignatureRequestResponseDataValueSignature.class, name = "signature"), + @JsonSubTypes.Type(value = SignatureRequestResponseDataValueText.class, name = "text"), + @JsonSubTypes.Type(value = SignatureRequestResponseDataValueTextMerge.class, name = "text-merge"), }) -public class SignatureRequestResponseDataBase { - public static final String JSON_PROPERTY_API_ID = "api_id"; - @javax.annotation.Nullable private String apiId; - - public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; - @javax.annotation.Nullable private String signatureId; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - @javax.annotation.Nullable private Boolean required; - - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable private String type; - - public SignatureRequestResponseDataBase() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseDataBase init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataBase.class); - } - - public static SignatureRequestResponseDataBase init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataBase.class); - } - - public SignatureRequestResponseDataBase apiId(@javax.annotation.Nullable String apiId) { - this.apiId = apiId; - return this; - } - - /** - * The unique ID for this field. - * - * @return apiId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getApiId() { - return apiId; - } - - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiId(@javax.annotation.Nullable String apiId) { - this.apiId = apiId; - } - - public SignatureRequestResponseDataBase signatureId( - @javax.annotation.Nullable String signatureId) { - this.signatureId = signatureId; - return this; - } - - /** - * The ID of the signature to which this response is linked. - * - * @return signatureId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSignatureId() { - return signatureId; - } - - @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatureId(@javax.annotation.Nullable String signatureId) { - this.signatureId = signatureId; - } - - public SignatureRequestResponseDataBase name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of the form field. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public SignatureRequestResponseDataBase required(@javax.annotation.Nullable Boolean required) { - this.required = required; - return this; - } - - /** - * A boolean value denoting if this field is required. - * - * @return required - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getRequired() { - return required; - } - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(@javax.annotation.Nullable Boolean required) { - this.required = required; - } - - public SignatureRequestResponseDataBase type(@javax.annotation.Nullable String type) { - this.type = type; - return this; +public class SignatureRequestResponseDataBase { + public static final String JSON_PROPERTY_API_ID = "api_id"; + @javax.annotation.Nullable + private String apiId; + + public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; + @javax.annotation.Nullable + private String signatureId; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + @javax.annotation.Nullable + private Boolean required; + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type; + + public SignatureRequestResponseDataBase() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseDataBase init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataBase.class); + } + + static public SignatureRequestResponseDataBase init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataBase.class + ); + } + + public SignatureRequestResponseDataBase apiId(@javax.annotation.Nullable String apiId) { + this.apiId = apiId; + return this; + } + + /** + * The unique ID for this field. + * @return apiId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getApiId() { + return apiId; + } + + + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiId(@javax.annotation.Nullable String apiId) { + this.apiId = apiId; + } + + + public SignatureRequestResponseDataBase signatureId(@javax.annotation.Nullable String signatureId) { + this.signatureId = signatureId; + return this; + } + + /** + * The ID of the signature to which this response is linked. + * @return signatureId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSignatureId() { + return signatureId; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatureId(@javax.annotation.Nullable String signatureId) { + this.signatureId = signatureId; + } + + + public SignatureRequestResponseDataBase name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the form field. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SignatureRequestResponseDataBase required(@javax.annotation.Nullable Boolean required) { + this.required = required; + return this; + } + + /** + * A boolean value denoting if this field is required. + * @return required + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRequired() { + return required; + } + + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(@javax.annotation.Nullable Boolean required) { + this.required = required; + } + + + public SignatureRequestResponseDataBase type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + /** + * Return true if this SignatureRequestResponseDataBase object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { - return type; + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataBase signatureRequestResponseDataBase = (SignatureRequestResponseDataBase) o; + return Objects.equals(this.apiId, signatureRequestResponseDataBase.apiId) && + Objects.equals(this.signatureId, signatureRequestResponseDataBase.signatureId) && + Objects.equals(this.name, signatureRequestResponseDataBase.name) && + Objects.equals(this.required, signatureRequestResponseDataBase.required) && + Objects.equals(this.type, signatureRequestResponseDataBase.type); + } + + @Override + public int hashCode() { + return Objects.hash(apiId, signatureId, name, required, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataBase {\n"); + sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); + sb.append(" signatureId: ").append(toIndentedString(signatureId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (apiId != null) { + if (isFileTypeOrListOfFiles(apiId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable String type) { - this.type = type; + if (apiId.getClass().equals(java.io.File.class) || + apiId.getClass().equals(Integer.class) || + apiId.getClass().equals(String.class) || + apiId.getClass().isEnum()) { + map.put("api_id", apiId); + } else if (isListOfFile(apiId)) { + for(int i = 0; i< getListSize(apiId); i++) { + map.put("api_id[" + i + "]", getFromList(apiId, i)); + } + } + else { + map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + } } + if (signatureId != null) { + if (isFileTypeOrListOfFiles(signatureId)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseDataBase object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (signatureId.getClass().equals(java.io.File.class) || + signatureId.getClass().equals(Integer.class) || + signatureId.getClass().equals(String.class) || + signatureId.getClass().isEnum()) { + map.put("signature_id", signatureId); + } else if (isListOfFile(signatureId)) { + for(int i = 0; i< getListSize(signatureId); i++) { + map.put("signature_id[" + i + "]", getFromList(signatureId, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("signature_id", JSON.getDefault().getMapper().writeValueAsString(signatureId)); } - SignatureRequestResponseDataBase signatureRequestResponseDataBase = - (SignatureRequestResponseDataBase) o; - return Objects.equals(this.apiId, signatureRequestResponseDataBase.apiId) - && Objects.equals(this.signatureId, signatureRequestResponseDataBase.signatureId) - && Objects.equals(this.name, signatureRequestResponseDataBase.name) - && Objects.equals(this.required, signatureRequestResponseDataBase.required) - && Objects.equals(this.type, signatureRequestResponseDataBase.type); } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(apiId, signatureId, name, required, type); + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataBase {\n"); - sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); - sb.append(" signatureId: ").append(toIndentedString(signatureId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); + if (required.getClass().equals(java.io.File.class) || + required.getClass().equals(Integer.class) || + required.getClass().equals(String.class) || + required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for(int i = 0; i< getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } + else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } } + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (apiId != null) { - if (isFileTypeOrListOfFiles(apiId)) { - fileTypeFound = true; - } - - if (apiId.getClass().equals(java.io.File.class) - || apiId.getClass().equals(Integer.class) - || apiId.getClass().equals(String.class) - || apiId.getClass().isEnum()) { - map.put("api_id", apiId); - } else if (isListOfFile(apiId)) { - for (int i = 0; i < getListSize(apiId); i++) { - map.put("api_id[" + i + "]", getFromList(apiId, i)); - } - } else { - map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); - } + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); } - if (signatureId != null) { - if (isFileTypeOrListOfFiles(signatureId)) { - fileTypeFound = true; - } - - if (signatureId.getClass().equals(java.io.File.class) - || signatureId.getClass().equals(Integer.class) - || signatureId.getClass().equals(String.class) - || signatureId.getClass().isEnum()) { - map.put("signature_id", signatureId); - } else if (isListOfFile(signatureId)) { - for (int i = 0; i < getListSize(signatureId); i++) { - map.put("signature_id[" + i + "]", getFromList(signatureId, i)); - } - } else { - map.put( - "signature_id", - JSON.getDefault().getMapper().writeValueAsString(signatureId)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - - if (required.getClass().equals(java.io.File.class) - || required.getClass().equals(Integer.class) - || required.getClass().equals(String.class) - || required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for (int i = 0; i < getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } - } - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); - mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); - mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); - mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); - mappings.put("initials", SignatureRequestResponseDataValueInitials.class); - mappings.put("radio", SignatureRequestResponseDataValueRadio.class); - mappings.put("signature", SignatureRequestResponseDataValueSignature.class); - mappings.put("text", SignatureRequestResponseDataValueText.class); - mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); - mappings.put("SignatureRequestResponseDataBase", SignatureRequestResponseDataBase.class); - JSON.registerDiscriminator(SignatureRequestResponseDataBase.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); + mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); + mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); + mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); + mappings.put("initials", SignatureRequestResponseDataValueInitials.class); + mappings.put("radio", SignatureRequestResponseDataValueRadio.class); + mappings.put("signature", SignatureRequestResponseDataValueSignature.class); + mappings.put("text", SignatureRequestResponseDataValueText.class); + mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); + mappings.put("SignatureRequestResponseDataBase", SignatureRequestResponseDataBase.class); + JSON.registerDiscriminator(SignatureRequestResponseDataBase.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java index 35e89e061..b2e629584 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java @@ -10,55 +10,68 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets SignatureRequestResponseDataTypeEnum */ +/** + * Gets or Sets SignatureRequestResponseDataTypeEnum + */ public enum SignatureRequestResponseDataTypeEnum { - TEXT("text"), - - CHECKBOX("checkbox"), - - DATE_SIGNED("date_signed"), - - DROPDOWN("dropdown"), - - INITIALS("initials"), - - RADIO("radio"), - - SIGNATURE("signature"), - - TEXT_MERGE("text-merge"), - - CHECKBOX_MERGE("checkbox-merge"); - - private String value; - - SignatureRequestResponseDataTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SignatureRequestResponseDataTypeEnum fromValue(String value) { - for (SignatureRequestResponseDataTypeEnum b : - SignatureRequestResponseDataTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + + TEXT("text"), + + CHECKBOX("checkbox"), + + DATE_SIGNED("date_signed"), + + DROPDOWN("dropdown"), + + INITIALS("initials"), + + RADIO("radio"), + + SIGNATURE("signature"), + + TEXT_MERGE("text-merge"), + + CHECKBOX_MERGE("checkbox-merge"); + + private String value; + + SignatureRequestResponseDataTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SignatureRequestResponseDataTypeEnum fromValue(String value) { + for (SignatureRequestResponseDataTypeEnum b : SignatureRequestResponseDataTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java index aa196e173..e04df37e2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java @@ -10,230 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseDataBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SignatureRequestResponseDataValueCheckbox */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestResponseDataValueCheckbox + */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponseDataBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable private String type = "checkbox"; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private Boolean value; - - public SignatureRequestResponseDataValueCheckbox() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseDataValueCheckbox init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestResponseDataValueCheckbox.class); - } - - public static SignatureRequestResponseDataValueCheckbox init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueCheckbox.class); - } - - public SignatureRequestResponseDataValueCheckbox type(@javax.annotation.Nullable String type) { - this.type = type; - return this; - } - - /** - * A yes/no checkbox - * - * @return type - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable String type) { - this.type = type; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - public SignatureRequestResponseDataValueCheckbox value( - @javax.annotation.Nullable Boolean value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable Boolean value) { - this.value = value; - } +public class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponseDataBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type = "checkbox"; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private Boolean value; + + public SignatureRequestResponseDataValueCheckbox() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseDataValueCheckbox init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueCheckbox.class); + } + + static public SignatureRequestResponseDataValueCheckbox init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueCheckbox.class + ); + } + + public SignatureRequestResponseDataValueCheckbox type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * A yes/no checkbox + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SignatureRequestResponseDataValueCheckbox value(@javax.annotation.Nullable Boolean value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable Boolean value) { + this.value = value; + } + + + /** + * Return true if this SignatureRequestResponseDataValueCheckbox object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponseDataValueCheckbox signatureRequestResponseDataValueCheckbox = (SignatureRequestResponseDataValueCheckbox) o; + return Objects.equals(this.type, signatureRequestResponseDataValueCheckbox.type) && + Objects.equals(this.value, signatureRequestResponseDataValueCheckbox.value) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueCheckbox {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseDataValueCheckbox object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SignatureRequestResponseDataValueCheckbox signatureRequestResponseDataValueCheckbox = - (SignatureRequestResponseDataValueCheckbox) o; - return Objects.equals(this.type, signatureRequestResponseDataValueCheckbox.type) - && Objects.equals(this.value, signatureRequestResponseDataValueCheckbox.value) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueCheckbox {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SignatureRequestResponseDataValueCheckbox", - SignatureRequestResponseDataValueCheckbox.class); - JSON.registerDiscriminator( - SignatureRequestResponseDataValueCheckbox.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueCheckbox", SignatureRequestResponseDataValueCheckbox.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueCheckbox.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java index 99139c870..55f2df900 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java @@ -10,235 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseDataBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SignatureRequestResponseDataValueCheckboxMerge */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestResponseDataValueCheckboxMerge + */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SignatureRequestResponseDataValueCheckboxMerge - extends SignatureRequestResponseDataBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable private String type = "checkbox-merge"; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private String value; - - public SignatureRequestResponseDataValueCheckboxMerge() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseDataValueCheckboxMerge init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestResponseDataValueCheckboxMerge.class); - } - - public static SignatureRequestResponseDataValueCheckboxMerge init(HashMap data) - throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueCheckboxMerge.class); - } - - public SignatureRequestResponseDataValueCheckboxMerge type( - @javax.annotation.Nullable String type) { - this.type = type; - return this; - } - - /** - * A checkbox field that has default value set by the api - * - * @return type - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable String type) { - this.type = type; - } - - public SignatureRequestResponseDataValueCheckboxMerge value( - @javax.annotation.Nullable String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestResponseDataBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type = "checkbox-merge"; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private String value; + + public SignatureRequestResponseDataValueCheckboxMerge() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseDataValueCheckboxMerge init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueCheckboxMerge.class); + } + + static public SignatureRequestResponseDataValueCheckboxMerge init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueCheckboxMerge.class + ); + } + + public SignatureRequestResponseDataValueCheckboxMerge type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * A checkbox field that has default value set by the api + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SignatureRequestResponseDataValueCheckboxMerge value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + /** + * Return true if this SignatureRequestResponseDataValueCheckboxMerge object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponseDataValueCheckboxMerge signatureRequestResponseDataValueCheckboxMerge = (SignatureRequestResponseDataValueCheckboxMerge) o; + return Objects.equals(this.type, signatureRequestResponseDataValueCheckboxMerge.type) && + Objects.equals(this.value, signatureRequestResponseDataValueCheckboxMerge.value) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueCheckboxMerge {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseDataValueCheckboxMerge object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SignatureRequestResponseDataValueCheckboxMerge - signatureRequestResponseDataValueCheckboxMerge = - (SignatureRequestResponseDataValueCheckboxMerge) o; - return Objects.equals(this.type, signatureRequestResponseDataValueCheckboxMerge.type) - && Objects.equals(this.value, signatureRequestResponseDataValueCheckboxMerge.value) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueCheckboxMerge {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SignatureRequestResponseDataValueCheckboxMerge", - SignatureRequestResponseDataValueCheckboxMerge.class); - JSON.registerDiscriminator( - SignatureRequestResponseDataValueCheckboxMerge.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueCheckboxMerge", SignatureRequestResponseDataValueCheckboxMerge.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueCheckboxMerge.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java index 038a3cc60..1d744752c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java @@ -10,232 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseDataBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SignatureRequestResponseDataValueDateSigned */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestResponseDataValueDateSigned + */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SignatureRequestResponseDataValueDateSigned extends SignatureRequestResponseDataBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable private String type = "date_signed"; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private String value; - - public SignatureRequestResponseDataValueDateSigned() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseDataValueDateSigned init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestResponseDataValueDateSigned.class); - } - - public static SignatureRequestResponseDataValueDateSigned init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueDateSigned.class); - } - - public SignatureRequestResponseDataValueDateSigned type( - @javax.annotation.Nullable String type) { - this.type = type; - return this; - } - - /** - * A date - * - * @return type - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable String type) { - this.type = type; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - public SignatureRequestResponseDataValueDateSigned value( - @javax.annotation.Nullable String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; - } +public class SignatureRequestResponseDataValueDateSigned extends SignatureRequestResponseDataBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type = "date_signed"; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private String value; + + public SignatureRequestResponseDataValueDateSigned() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseDataValueDateSigned init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueDateSigned.class); + } + + static public SignatureRequestResponseDataValueDateSigned init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueDateSigned.class + ); + } + + public SignatureRequestResponseDataValueDateSigned type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * A date + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SignatureRequestResponseDataValueDateSigned value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + /** + * Return true if this SignatureRequestResponseDataValueDateSigned object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponseDataValueDateSigned signatureRequestResponseDataValueDateSigned = (SignatureRequestResponseDataValueDateSigned) o; + return Objects.equals(this.type, signatureRequestResponseDataValueDateSigned.type) && + Objects.equals(this.value, signatureRequestResponseDataValueDateSigned.value) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueDateSigned {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseDataValueDateSigned object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SignatureRequestResponseDataValueDateSigned signatureRequestResponseDataValueDateSigned = - (SignatureRequestResponseDataValueDateSigned) o; - return Objects.equals(this.type, signatureRequestResponseDataValueDateSigned.type) - && Objects.equals(this.value, signatureRequestResponseDataValueDateSigned.value) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueDateSigned {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SignatureRequestResponseDataValueDateSigned", - SignatureRequestResponseDataValueDateSigned.class); - JSON.registerDiscriminator( - SignatureRequestResponseDataValueDateSigned.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueDateSigned", SignatureRequestResponseDataValueDateSigned.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueDateSigned.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java index e702df116..1fcc9ea85 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java @@ -10,230 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseDataBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SignatureRequestResponseDataValueDropdown */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestResponseDataValueDropdown + */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponseDataBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable private String type = "dropdown"; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private String value; - - public SignatureRequestResponseDataValueDropdown() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseDataValueDropdown init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestResponseDataValueDropdown.class); - } - - public static SignatureRequestResponseDataValueDropdown init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueDropdown.class); - } - - public SignatureRequestResponseDataValueDropdown type(@javax.annotation.Nullable String type) { - this.type = type; - return this; - } - - /** - * An input field for dropdowns - * - * @return type - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable String type) { - this.type = type; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - public SignatureRequestResponseDataValueDropdown value( - @javax.annotation.Nullable String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; - } +public class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponseDataBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type = "dropdown"; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private String value; + + public SignatureRequestResponseDataValueDropdown() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseDataValueDropdown init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueDropdown.class); + } + + static public SignatureRequestResponseDataValueDropdown init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueDropdown.class + ); + } + + public SignatureRequestResponseDataValueDropdown type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * An input field for dropdowns + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SignatureRequestResponseDataValueDropdown value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + /** + * Return true if this SignatureRequestResponseDataValueDropdown object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponseDataValueDropdown signatureRequestResponseDataValueDropdown = (SignatureRequestResponseDataValueDropdown) o; + return Objects.equals(this.type, signatureRequestResponseDataValueDropdown.type) && + Objects.equals(this.value, signatureRequestResponseDataValueDropdown.value) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueDropdown {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseDataValueDropdown object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SignatureRequestResponseDataValueDropdown signatureRequestResponseDataValueDropdown = - (SignatureRequestResponseDataValueDropdown) o; - return Objects.equals(this.type, signatureRequestResponseDataValueDropdown.type) - && Objects.equals(this.value, signatureRequestResponseDataValueDropdown.value) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueDropdown {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SignatureRequestResponseDataValueDropdown", - SignatureRequestResponseDataValueDropdown.class); - JSON.registerDiscriminator( - SignatureRequestResponseDataValueDropdown.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueDropdown", SignatureRequestResponseDataValueDropdown.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueDropdown.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java index bd936ff8d..d6e9d2eaf 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java @@ -10,279 +10,290 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseDataBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SignatureRequestResponseDataValueInitials */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestResponseDataValueInitials + */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueInitials.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueInitials.JSON_PROPERTY_VALUE, - SignatureRequestResponseDataValueInitials.JSON_PROPERTY_IS_SIGNED + SignatureRequestResponseDataValueInitials.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueInitials.JSON_PROPERTY_VALUE, + SignatureRequestResponseDataValueInitials.JSON_PROPERTY_IS_SIGNED }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SignatureRequestResponseDataValueInitials extends SignatureRequestResponseDataBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable private String type = "initials"; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private String value; - - public static final String JSON_PROPERTY_IS_SIGNED = "is_signed"; - @javax.annotation.Nullable private Boolean isSigned; - - public SignatureRequestResponseDataValueInitials() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseDataValueInitials init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestResponseDataValueInitials.class); - } - - public static SignatureRequestResponseDataValueInitials init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueInitials.class); - } - - public SignatureRequestResponseDataValueInitials type(@javax.annotation.Nullable String type) { - this.type = type; - return this; - } - - /** - * An input field for initials - * - * @return type - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable String type) { - this.type = type; - } - - public SignatureRequestResponseDataValueInitials value( - @javax.annotation.Nullable String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; - } - - public SignatureRequestResponseDataValueInitials isSigned( - @javax.annotation.Nullable Boolean isSigned) { - this.isSigned = isSigned; - return this; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - /** - * This field contains the boolean true if the field is signed. - * - * @return isSigned - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_SIGNED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsSigned() { - return isSigned; +public class SignatureRequestResponseDataValueInitials extends SignatureRequestResponseDataBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type = "initials"; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private String value; + + public static final String JSON_PROPERTY_IS_SIGNED = "is_signed"; + @javax.annotation.Nullable + private Boolean isSigned; + + public SignatureRequestResponseDataValueInitials() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseDataValueInitials init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueInitials.class); + } + + static public SignatureRequestResponseDataValueInitials init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueInitials.class + ); + } + + public SignatureRequestResponseDataValueInitials type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * An input field for initials + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SignatureRequestResponseDataValueInitials value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + public SignatureRequestResponseDataValueInitials isSigned(@javax.annotation.Nullable Boolean isSigned) { + this.isSigned = isSigned; + return this; + } + + /** + * This field contains the boolean true if the field is signed. + * @return isSigned + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_SIGNED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsSigned() { + return isSigned; + } + + + @JsonProperty(JSON_PROPERTY_IS_SIGNED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsSigned(@javax.annotation.Nullable Boolean isSigned) { + this.isSigned = isSigned; + } + + + /** + * Return true if this SignatureRequestResponseDataValueInitials object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_IS_SIGNED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsSigned(@javax.annotation.Nullable Boolean isSigned) { - this.isSigned = isSigned; + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataValueInitials signatureRequestResponseDataValueInitials = (SignatureRequestResponseDataValueInitials) o; + return Objects.equals(this.type, signatureRequestResponseDataValueInitials.type) && + Objects.equals(this.value, signatureRequestResponseDataValueInitials.value) && + Objects.equals(this.isSigned, signatureRequestResponseDataValueInitials.isSigned) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, isSigned, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueInitials {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" isSigned: ").append(toIndentedString(isSigned)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseDataValueInitials object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SignatureRequestResponseDataValueInitials signatureRequestResponseDataValueInitials = - (SignatureRequestResponseDataValueInitials) o; - return Objects.equals(this.type, signatureRequestResponseDataValueInitials.type) - && Objects.equals(this.value, signatureRequestResponseDataValueInitials.value) - && Objects.equals(this.isSigned, signatureRequestResponseDataValueInitials.isSigned) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, isSigned, super.hashCode()); } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueInitials {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" isSigned: ").append(toIndentedString(isSigned)).append("\n"); - sb.append("}"); - return sb.toString(); + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } } + if (isSigned != null) { + if (isFileTypeOrListOfFiles(isSigned)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } - } - if (isSigned != null) { - if (isFileTypeOrListOfFiles(isSigned)) { - fileTypeFound = true; - } - - if (isSigned.getClass().equals(java.io.File.class) - || isSigned.getClass().equals(Integer.class) - || isSigned.getClass().equals(String.class) - || isSigned.getClass().isEnum()) { - map.put("is_signed", isSigned); - } else if (isListOfFile(isSigned)) { - for (int i = 0; i < getListSize(isSigned); i++) { - map.put("is_signed[" + i + "]", getFromList(isSigned, i)); - } - } else { - map.put( - "is_signed", - JSON.getDefault().getMapper().writeValueAsString(isSigned)); - } + if (isSigned.getClass().equals(java.io.File.class) || + isSigned.getClass().equals(Integer.class) || + isSigned.getClass().equals(String.class) || + isSigned.getClass().isEnum()) { + map.put("is_signed", isSigned); + } else if (isListOfFile(isSigned)) { + for(int i = 0; i< getListSize(isSigned); i++) { + map.put("is_signed[" + i + "]", getFromList(isSigned, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("is_signed", JSON.getDefault().getMapper().writeValueAsString(isSigned)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SignatureRequestResponseDataValueInitials", - SignatureRequestResponseDataValueInitials.class); - JSON.registerDiscriminator( - SignatureRequestResponseDataValueInitials.class, "type", mappings); + /** + * 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 "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueInitials", SignatureRequestResponseDataValueInitials.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueInitials.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java index 58eb6518c..4dd25fa40 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java @@ -10,227 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseDataBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SignatureRequestResponseDataValueRadio */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestResponseDataValueRadio + */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueRadio.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueRadio.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueRadio.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueRadio.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDataBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable private String type = "radio"; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private Boolean value; - - public SignatureRequestResponseDataValueRadio() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseDataValueRadio init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueRadio.class); - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - public static SignatureRequestResponseDataValueRadio init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueRadio.class); - } - - public SignatureRequestResponseDataValueRadio type(@javax.annotation.Nullable String type) { - this.type = type; - return this; - } - - /** - * An input field for radios - * - * @return type - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable String type) { - this.type = type; - } - - public SignatureRequestResponseDataValueRadio value(@javax.annotation.Nullable Boolean value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable Boolean value) { - this.value = value; - } +public class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDataBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type = "radio"; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private Boolean value; + + public SignatureRequestResponseDataValueRadio() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseDataValueRadio init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueRadio.class); + } + + static public SignatureRequestResponseDataValueRadio init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueRadio.class + ); + } + + public SignatureRequestResponseDataValueRadio type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * An input field for radios + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SignatureRequestResponseDataValueRadio value(@javax.annotation.Nullable Boolean value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable Boolean value) { + this.value = value; + } + + + /** + * Return true if this SignatureRequestResponseDataValueRadio object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponseDataValueRadio signatureRequestResponseDataValueRadio = (SignatureRequestResponseDataValueRadio) o; + return Objects.equals(this.type, signatureRequestResponseDataValueRadio.type) && + Objects.equals(this.value, signatureRequestResponseDataValueRadio.value) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueRadio {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseDataValueRadio object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SignatureRequestResponseDataValueRadio signatureRequestResponseDataValueRadio = - (SignatureRequestResponseDataValueRadio) o; - return Objects.equals(this.type, signatureRequestResponseDataValueRadio.type) - && Objects.equals(this.value, signatureRequestResponseDataValueRadio.value) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueRadio {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SignatureRequestResponseDataValueRadio", - SignatureRequestResponseDataValueRadio.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueRadio.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueRadio", SignatureRequestResponseDataValueRadio.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueRadio.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java index e08d208d0..cb434cb73 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java @@ -10,281 +10,290 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseDataBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SignatureRequestResponseDataValueSignature */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestResponseDataValueSignature + */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueSignature.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueSignature.JSON_PROPERTY_VALUE, - SignatureRequestResponseDataValueSignature.JSON_PROPERTY_IS_SIGNED + SignatureRequestResponseDataValueSignature.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueSignature.JSON_PROPERTY_VALUE, + SignatureRequestResponseDataValueSignature.JSON_PROPERTY_IS_SIGNED }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SignatureRequestResponseDataValueSignature extends SignatureRequestResponseDataBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable private String type = "signature"; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private String value; - - public static final String JSON_PROPERTY_IS_SIGNED = "is_signed"; - @javax.annotation.Nullable private Boolean isSigned; - - public SignatureRequestResponseDataValueSignature() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseDataValueSignature init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestResponseDataValueSignature.class); - } - - public static SignatureRequestResponseDataValueSignature init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueSignature.class); - } - - public SignatureRequestResponseDataValueSignature type(@javax.annotation.Nullable String type) { - this.type = type; - return this; - } - - /** - * A signature input field - * - * @return type - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable String type) { - this.type = type; - } - - public SignatureRequestResponseDataValueSignature value( - @javax.annotation.Nullable String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; - } - - public SignatureRequestResponseDataValueSignature isSigned( - @javax.annotation.Nullable Boolean isSigned) { - this.isSigned = isSigned; - return this; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - /** - * This field contains the boolean true if the field is signed. - * - * @return isSigned - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_SIGNED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsSigned() { - return isSigned; +public class SignatureRequestResponseDataValueSignature extends SignatureRequestResponseDataBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type = "signature"; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private String value; + + public static final String JSON_PROPERTY_IS_SIGNED = "is_signed"; + @javax.annotation.Nullable + private Boolean isSigned; + + public SignatureRequestResponseDataValueSignature() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseDataValueSignature init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueSignature.class); + } + + static public SignatureRequestResponseDataValueSignature init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueSignature.class + ); + } + + public SignatureRequestResponseDataValueSignature type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * A signature input field + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SignatureRequestResponseDataValueSignature value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + public SignatureRequestResponseDataValueSignature isSigned(@javax.annotation.Nullable Boolean isSigned) { + this.isSigned = isSigned; + return this; + } + + /** + * This field contains the boolean true if the field is signed. + * @return isSigned + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_SIGNED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsSigned() { + return isSigned; + } + + + @JsonProperty(JSON_PROPERTY_IS_SIGNED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsSigned(@javax.annotation.Nullable Boolean isSigned) { + this.isSigned = isSigned; + } + + + /** + * Return true if this SignatureRequestResponseDataValueSignature object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_IS_SIGNED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsSigned(@javax.annotation.Nullable Boolean isSigned) { - this.isSigned = isSigned; + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataValueSignature signatureRequestResponseDataValueSignature = (SignatureRequestResponseDataValueSignature) o; + return Objects.equals(this.type, signatureRequestResponseDataValueSignature.type) && + Objects.equals(this.value, signatureRequestResponseDataValueSignature.value) && + Objects.equals(this.isSigned, signatureRequestResponseDataValueSignature.isSigned) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, isSigned, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueSignature {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" isSigned: ").append(toIndentedString(isSigned)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseDataValueSignature object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SignatureRequestResponseDataValueSignature signatureRequestResponseDataValueSignature = - (SignatureRequestResponseDataValueSignature) o; - return Objects.equals(this.type, signatureRequestResponseDataValueSignature.type) - && Objects.equals(this.value, signatureRequestResponseDataValueSignature.value) - && Objects.equals( - this.isSigned, signatureRequestResponseDataValueSignature.isSigned) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, isSigned, super.hashCode()); } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueSignature {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" isSigned: ").append(toIndentedString(isSigned)).append("\n"); - sb.append("}"); - return sb.toString(); + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } } + if (isSigned != null) { + if (isFileTypeOrListOfFiles(isSigned)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } + if (isSigned.getClass().equals(java.io.File.class) || + isSigned.getClass().equals(Integer.class) || + isSigned.getClass().equals(String.class) || + isSigned.getClass().isEnum()) { + map.put("is_signed", isSigned); + } else if (isListOfFile(isSigned)) { + for(int i = 0; i< getListSize(isSigned); i++) { + map.put("is_signed[" + i + "]", getFromList(isSigned, i)); } - if (isSigned != null) { - if (isFileTypeOrListOfFiles(isSigned)) { - fileTypeFound = true; - } - - if (isSigned.getClass().equals(java.io.File.class) - || isSigned.getClass().equals(Integer.class) - || isSigned.getClass().equals(String.class) - || isSigned.getClass().isEnum()) { - map.put("is_signed", isSigned); - } else if (isListOfFile(isSigned)) { - for (int i = 0; i < getListSize(isSigned); i++) { - map.put("is_signed[" + i + "]", getFromList(isSigned, i)); - } - } else { - map.put( - "is_signed", - JSON.getDefault().getMapper().writeValueAsString(isSigned)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("is_signed", JSON.getDefault().getMapper().writeValueAsString(isSigned)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SignatureRequestResponseDataValueSignature", - SignatureRequestResponseDataValueSignature.class); - JSON.registerDiscriminator( - SignatureRequestResponseDataValueSignature.class, "type", mappings); + /** + * 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 "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueSignature", SignatureRequestResponseDataValueSignature.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueSignature.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java index ea517a79b..8a70c2f84 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java @@ -10,227 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseDataBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SignatureRequestResponseDataValueText */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestResponseDataValueText + */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueText.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueText.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueText.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueText.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SignatureRequestResponseDataValueText extends SignatureRequestResponseDataBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable private String type = "text"; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private String value; - - public SignatureRequestResponseDataValueText() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseDataValueText init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueText.class); - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - public static SignatureRequestResponseDataValueText init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueText.class); - } - - public SignatureRequestResponseDataValueText type(@javax.annotation.Nullable String type) { - this.type = type; - return this; - } - - /** - * A text input field - * - * @return type - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable String type) { - this.type = type; - } - - public SignatureRequestResponseDataValueText value(@javax.annotation.Nullable String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; - } +public class SignatureRequestResponseDataValueText extends SignatureRequestResponseDataBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type = "text"; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private String value; + + public SignatureRequestResponseDataValueText() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseDataValueText init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueText.class); + } + + static public SignatureRequestResponseDataValueText init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueText.class + ); + } + + public SignatureRequestResponseDataValueText type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * A text input field + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SignatureRequestResponseDataValueText value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + /** + * Return true if this SignatureRequestResponseDataValueText object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponseDataValueText signatureRequestResponseDataValueText = (SignatureRequestResponseDataValueText) o; + return Objects.equals(this.type, signatureRequestResponseDataValueText.type) && + Objects.equals(this.value, signatureRequestResponseDataValueText.value) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueText {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseDataValueText object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SignatureRequestResponseDataValueText signatureRequestResponseDataValueText = - (SignatureRequestResponseDataValueText) o; - return Objects.equals(this.type, signatureRequestResponseDataValueText.type) - && Objects.equals(this.value, signatureRequestResponseDataValueText.value) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueText {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SignatureRequestResponseDataValueText", - SignatureRequestResponseDataValueText.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueText.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueText", SignatureRequestResponseDataValueText.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueText.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java index 0c3deed89..be8315a09 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java @@ -10,231 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseDataBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SignatureRequestResponseDataValueTextMerge */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestResponseDataValueTextMerge + */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SignatureRequestResponseDataValueTextMerge extends SignatureRequestResponseDataBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable private String type = "text-merge"; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private String value; - - public SignatureRequestResponseDataValueTextMerge() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseDataValueTextMerge init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestResponseDataValueTextMerge.class); - } - - public static SignatureRequestResponseDataValueTextMerge init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueTextMerge.class); - } - - public SignatureRequestResponseDataValueTextMerge type(@javax.annotation.Nullable String type) { - this.type = type; - return this; - } - - /** - * A text field that has default text set by the api - * - * @return type - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable String type) { - this.type = type; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - public SignatureRequestResponseDataValueTextMerge value( - @javax.annotation.Nullable String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValue() { - return value; - } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; - } +public class SignatureRequestResponseDataValueTextMerge extends SignatureRequestResponseDataBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type = "text-merge"; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private String value; + + public SignatureRequestResponseDataValueTextMerge() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseDataValueTextMerge init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueTextMerge.class); + } + + static public SignatureRequestResponseDataValueTextMerge init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueTextMerge.class + ); + } + + public SignatureRequestResponseDataValueTextMerge type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * A text field that has default text set by the api + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SignatureRequestResponseDataValueTextMerge value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + /** + * Return true if this SignatureRequestResponseDataValueTextMerge object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponseDataValueTextMerge signatureRequestResponseDataValueTextMerge = (SignatureRequestResponseDataValueTextMerge) o; + return Objects.equals(this.type, signatureRequestResponseDataValueTextMerge.type) && + Objects.equals(this.value, signatureRequestResponseDataValueTextMerge.value) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueTextMerge {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseDataValueTextMerge object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SignatureRequestResponseDataValueTextMerge signatureRequestResponseDataValueTextMerge = - (SignatureRequestResponseDataValueTextMerge) o; - return Objects.equals(this.type, signatureRequestResponseDataValueTextMerge.type) - && Objects.equals(this.value, signatureRequestResponseDataValueTextMerge.value) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueTextMerge {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SignatureRequestResponseDataValueTextMerge", - SignatureRequestResponseDataValueTextMerge.class); - JSON.registerDiscriminator( - SignatureRequestResponseDataValueTextMerge.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueTextMerge", SignatureRequestResponseDataValueTextMerge.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueTextMerge.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java index ede6ebb32..e06d2655f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java @@ -10,1076 +10,1088 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** An array of signature objects, 1 for each signer. */ + +import com.dropbox.sign.ApiException; +/** + * An array of signature objects, 1 for each signer. + */ @JsonPropertyOrder({ - SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNATURE_ID, - SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_GROUP_GUID, - SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_EMAIL_ADDRESS, - SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_NAME, - SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_ROLE, - SignatureRequestResponseSignatures.JSON_PROPERTY_ORDER, - SignatureRequestResponseSignatures.JSON_PROPERTY_STATUS_CODE, - SignatureRequestResponseSignatures.JSON_PROPERTY_DECLINE_REASON, - SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNED_AT, - SignatureRequestResponseSignatures.JSON_PROPERTY_LAST_VIEWED_AT, - SignatureRequestResponseSignatures.JSON_PROPERTY_LAST_REMINDED_AT, - SignatureRequestResponseSignatures.JSON_PROPERTY_HAS_PIN, - SignatureRequestResponseSignatures.JSON_PROPERTY_HAS_SMS_AUTH, - SignatureRequestResponseSignatures.JSON_PROPERTY_HAS_SMS_DELIVERY, - SignatureRequestResponseSignatures.JSON_PROPERTY_SMS_PHONE_NUMBER, - SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNED_BY, - SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNMENT_REASON, - SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNED_FROM, - SignatureRequestResponseSignatures.JSON_PROPERTY_ERROR + SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNATURE_ID, + SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_GROUP_GUID, + SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_EMAIL_ADDRESS, + SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_NAME, + SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_ROLE, + SignatureRequestResponseSignatures.JSON_PROPERTY_ORDER, + SignatureRequestResponseSignatures.JSON_PROPERTY_STATUS_CODE, + SignatureRequestResponseSignatures.JSON_PROPERTY_DECLINE_REASON, + SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNED_AT, + SignatureRequestResponseSignatures.JSON_PROPERTY_LAST_VIEWED_AT, + SignatureRequestResponseSignatures.JSON_PROPERTY_LAST_REMINDED_AT, + SignatureRequestResponseSignatures.JSON_PROPERTY_HAS_PIN, + SignatureRequestResponseSignatures.JSON_PROPERTY_HAS_SMS_AUTH, + SignatureRequestResponseSignatures.JSON_PROPERTY_HAS_SMS_DELIVERY, + SignatureRequestResponseSignatures.JSON_PROPERTY_SMS_PHONE_NUMBER, + SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNED_BY, + SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNMENT_REASON, + SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNED_FROM, + SignatureRequestResponseSignatures.JSON_PROPERTY_ERROR }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestResponseSignatures { - public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; - @javax.annotation.Nullable private String signatureId; - - public static final String JSON_PROPERTY_SIGNER_GROUP_GUID = "signer_group_guid"; - @javax.annotation.Nullable private String signerGroupGuid; - - public static final String JSON_PROPERTY_SIGNER_EMAIL_ADDRESS = "signer_email_address"; - @javax.annotation.Nullable private String signerEmailAddress; - - public static final String JSON_PROPERTY_SIGNER_NAME = "signer_name"; - @javax.annotation.Nullable private String signerName; - - public static final String JSON_PROPERTY_SIGNER_ROLE = "signer_role"; - @javax.annotation.Nullable private String signerRole; - - public static final String JSON_PROPERTY_ORDER = "order"; - @javax.annotation.Nullable private Integer order; - - public static final String JSON_PROPERTY_STATUS_CODE = "status_code"; - @javax.annotation.Nullable private String statusCode; - - public static final String JSON_PROPERTY_DECLINE_REASON = "decline_reason"; - @javax.annotation.Nullable private String declineReason; - - public static final String JSON_PROPERTY_SIGNED_AT = "signed_at"; - @javax.annotation.Nullable private Integer signedAt; - - public static final String JSON_PROPERTY_LAST_VIEWED_AT = "last_viewed_at"; - @javax.annotation.Nullable private Integer lastViewedAt; - - public static final String JSON_PROPERTY_LAST_REMINDED_AT = "last_reminded_at"; - @javax.annotation.Nullable private Integer lastRemindedAt; - - public static final String JSON_PROPERTY_HAS_PIN = "has_pin"; - @javax.annotation.Nullable private Boolean hasPin; - - public static final String JSON_PROPERTY_HAS_SMS_AUTH = "has_sms_auth"; - @javax.annotation.Nullable private Boolean hasSmsAuth; - - public static final String JSON_PROPERTY_HAS_SMS_DELIVERY = "has_sms_delivery"; - @javax.annotation.Nullable private Boolean hasSmsDelivery; - - public static final String JSON_PROPERTY_SMS_PHONE_NUMBER = "sms_phone_number"; - @javax.annotation.Nullable private String smsPhoneNumber; - - public static final String JSON_PROPERTY_REASSIGNED_BY = "reassigned_by"; - @javax.annotation.Nullable private String reassignedBy; - - public static final String JSON_PROPERTY_REASSIGNMENT_REASON = "reassignment_reason"; - @javax.annotation.Nullable private String reassignmentReason; - - public static final String JSON_PROPERTY_REASSIGNED_FROM = "reassigned_from"; - @javax.annotation.Nullable private String reassignedFrom; - - public static final String JSON_PROPERTY_ERROR = "error"; - @javax.annotation.Nullable private String error; - - public SignatureRequestResponseSignatures() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestResponseSignatures init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseSignatures.class); - } - - public static SignatureRequestResponseSignatures init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseSignatures.class); - } - - public SignatureRequestResponseSignatures signatureId( - @javax.annotation.Nullable String signatureId) { - this.signatureId = signatureId; - return this; - } - - /** - * Signature identifier. - * - * @return signatureId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSignatureId() { - return signatureId; - } - - @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatureId(@javax.annotation.Nullable String signatureId) { - this.signatureId = signatureId; - } - - public SignatureRequestResponseSignatures signerGroupGuid( - @javax.annotation.Nullable String signerGroupGuid) { - this.signerGroupGuid = signerGroupGuid; - return this; - } - - /** - * Signer Group GUID - * - * @return signerGroupGuid - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_GROUP_GUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSignerGroupGuid() { - return signerGroupGuid; - } - - @JsonProperty(JSON_PROPERTY_SIGNER_GROUP_GUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerGroupGuid(@javax.annotation.Nullable String signerGroupGuid) { - this.signerGroupGuid = signerGroupGuid; - } - - public SignatureRequestResponseSignatures signerEmailAddress( - @javax.annotation.Nullable String signerEmailAddress) { - this.signerEmailAddress = signerEmailAddress; - return this; - } - - /** - * The email address of the signer. - * - * @return signerEmailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSignerEmailAddress() { - return signerEmailAddress; - } - - @JsonProperty(JSON_PROPERTY_SIGNER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerEmailAddress(@javax.annotation.Nullable String signerEmailAddress) { - this.signerEmailAddress = signerEmailAddress; - } - - public SignatureRequestResponseSignatures signerName( - @javax.annotation.Nullable String signerName) { - this.signerName = signerName; - return this; - } - - /** - * The name of the signer. - * - * @return signerName - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSignerName() { - return signerName; - } - - @JsonProperty(JSON_PROPERTY_SIGNER_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerName(@javax.annotation.Nullable String signerName) { - this.signerName = signerName; - } - - public SignatureRequestResponseSignatures signerRole( - @javax.annotation.Nullable String signerRole) { - this.signerRole = signerRole; - return this; - } - - /** - * The role of the signer. - * - * @return signerRole - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSignerRole() { - return signerRole; - } - - @JsonProperty(JSON_PROPERTY_SIGNER_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerRole(@javax.annotation.Nullable String signerRole) { - this.signerRole = signerRole; - } - - public SignatureRequestResponseSignatures order(@javax.annotation.Nullable Integer order) { - this.order = order; - return this; - } - - /** - * If signer order is assigned this is the 0-based index for this signer. - * - * @return order - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getOrder() { - return order; - } - - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrder(@javax.annotation.Nullable Integer order) { - this.order = order; - } - - public SignatureRequestResponseSignatures statusCode( - @javax.annotation.Nullable String statusCode) { - this.statusCode = statusCode; - return this; - } - - /** - * The current status of the signature. eg: awaiting_signature, signed, declined. - * - * @return statusCode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getStatusCode() { - return statusCode; - } - - @JsonProperty(JSON_PROPERTY_STATUS_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatusCode(@javax.annotation.Nullable String statusCode) { - this.statusCode = statusCode; - } - - public SignatureRequestResponseSignatures declineReason( - @javax.annotation.Nullable String declineReason) { - this.declineReason = declineReason; - return this; - } - - /** - * The reason provided by the signer for declining the request. - * - * @return declineReason - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLINE_REASON) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getDeclineReason() { - return declineReason; - } - - @JsonProperty(JSON_PROPERTY_DECLINE_REASON) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeclineReason(@javax.annotation.Nullable String declineReason) { - this.declineReason = declineReason; - } - - public SignatureRequestResponseSignatures signedAt( - @javax.annotation.Nullable Integer signedAt) { - this.signedAt = signedAt; - return this; - } - - /** - * Time that the document was signed or null. - * - * @return signedAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getSignedAt() { - return signedAt; - } - - @JsonProperty(JSON_PROPERTY_SIGNED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignedAt(@javax.annotation.Nullable Integer signedAt) { - this.signedAt = signedAt; - } - - public SignatureRequestResponseSignatures lastViewedAt( - @javax.annotation.Nullable Integer lastViewedAt) { - this.lastViewedAt = lastViewedAt; - return this; - } - - /** - * The time that the document was last viewed by this signer or null. - * - * @return lastViewedAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_VIEWED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getLastViewedAt() { - return lastViewedAt; - } - - @JsonProperty(JSON_PROPERTY_LAST_VIEWED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLastViewedAt(@javax.annotation.Nullable Integer lastViewedAt) { - this.lastViewedAt = lastViewedAt; - } - - public SignatureRequestResponseSignatures lastRemindedAt( - @javax.annotation.Nullable Integer lastRemindedAt) { - this.lastRemindedAt = lastRemindedAt; - return this; - } - - /** - * The time the last reminder email was sent to the signer or null. - * - * @return lastRemindedAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_REMINDED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getLastRemindedAt() { - return lastRemindedAt; - } - - @JsonProperty(JSON_PROPERTY_LAST_REMINDED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLastRemindedAt(@javax.annotation.Nullable Integer lastRemindedAt) { - this.lastRemindedAt = lastRemindedAt; - } - - public SignatureRequestResponseSignatures hasPin(@javax.annotation.Nullable Boolean hasPin) { - this.hasPin = hasPin; - return this; - } - - /** - * Boolean to indicate whether this signature requires a PIN to access. - * - * @return hasPin - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_PIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHasPin() { - return hasPin; - } - - @JsonProperty(JSON_PROPERTY_HAS_PIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasPin(@javax.annotation.Nullable Boolean hasPin) { - this.hasPin = hasPin; - } - - public SignatureRequestResponseSignatures hasSmsAuth( - @javax.annotation.Nullable Boolean hasSmsAuth) { - this.hasSmsAuth = hasSmsAuth; - return this; - } - - /** - * Boolean to indicate whether this signature has SMS authentication enabled. - * - * @return hasSmsAuth - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_SMS_AUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHasSmsAuth() { - return hasSmsAuth; - } - - @JsonProperty(JSON_PROPERTY_HAS_SMS_AUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasSmsAuth(@javax.annotation.Nullable Boolean hasSmsAuth) { - this.hasSmsAuth = hasSmsAuth; - } - - public SignatureRequestResponseSignatures hasSmsDelivery( - @javax.annotation.Nullable Boolean hasSmsDelivery) { - this.hasSmsDelivery = hasSmsDelivery; - return this; - } + public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; + @javax.annotation.Nullable + private String signatureId; + + public static final String JSON_PROPERTY_SIGNER_GROUP_GUID = "signer_group_guid"; + @javax.annotation.Nullable + private String signerGroupGuid; + + public static final String JSON_PROPERTY_SIGNER_EMAIL_ADDRESS = "signer_email_address"; + @javax.annotation.Nullable + private String signerEmailAddress; + + public static final String JSON_PROPERTY_SIGNER_NAME = "signer_name"; + @javax.annotation.Nullable + private String signerName; + + public static final String JSON_PROPERTY_SIGNER_ROLE = "signer_role"; + @javax.annotation.Nullable + private String signerRole; + + public static final String JSON_PROPERTY_ORDER = "order"; + @javax.annotation.Nullable + private Integer order; + + public static final String JSON_PROPERTY_STATUS_CODE = "status_code"; + @javax.annotation.Nullable + private String statusCode; + + public static final String JSON_PROPERTY_DECLINE_REASON = "decline_reason"; + @javax.annotation.Nullable + private String declineReason; + + public static final String JSON_PROPERTY_SIGNED_AT = "signed_at"; + @javax.annotation.Nullable + private Integer signedAt; + + public static final String JSON_PROPERTY_LAST_VIEWED_AT = "last_viewed_at"; + @javax.annotation.Nullable + private Integer lastViewedAt; + + public static final String JSON_PROPERTY_LAST_REMINDED_AT = "last_reminded_at"; + @javax.annotation.Nullable + private Integer lastRemindedAt; + + public static final String JSON_PROPERTY_HAS_PIN = "has_pin"; + @javax.annotation.Nullable + private Boolean hasPin; + + public static final String JSON_PROPERTY_HAS_SMS_AUTH = "has_sms_auth"; + @javax.annotation.Nullable + private Boolean hasSmsAuth; + + public static final String JSON_PROPERTY_HAS_SMS_DELIVERY = "has_sms_delivery"; + @javax.annotation.Nullable + private Boolean hasSmsDelivery; + + public static final String JSON_PROPERTY_SMS_PHONE_NUMBER = "sms_phone_number"; + @javax.annotation.Nullable + private String smsPhoneNumber; + + public static final String JSON_PROPERTY_REASSIGNED_BY = "reassigned_by"; + @javax.annotation.Nullable + private String reassignedBy; + + public static final String JSON_PROPERTY_REASSIGNMENT_REASON = "reassignment_reason"; + @javax.annotation.Nullable + private String reassignmentReason; + + public static final String JSON_PROPERTY_REASSIGNED_FROM = "reassigned_from"; + @javax.annotation.Nullable + private String reassignedFrom; + + public static final String JSON_PROPERTY_ERROR = "error"; + @javax.annotation.Nullable + private String error; + + public SignatureRequestResponseSignatures() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestResponseSignatures init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseSignatures.class); + } + + static public SignatureRequestResponseSignatures init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseSignatures.class + ); + } + + public SignatureRequestResponseSignatures signatureId(@javax.annotation.Nullable String signatureId) { + this.signatureId = signatureId; + return this; + } + + /** + * Signature identifier. + * @return signatureId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSignatureId() { + return signatureId; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatureId(@javax.annotation.Nullable String signatureId) { + this.signatureId = signatureId; + } + + + public SignatureRequestResponseSignatures signerGroupGuid(@javax.annotation.Nullable String signerGroupGuid) { + this.signerGroupGuid = signerGroupGuid; + return this; + } + + /** + * Signer Group GUID + * @return signerGroupGuid + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER_GROUP_GUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSignerGroupGuid() { + return signerGroupGuid; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER_GROUP_GUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerGroupGuid(@javax.annotation.Nullable String signerGroupGuid) { + this.signerGroupGuid = signerGroupGuid; + } + + + public SignatureRequestResponseSignatures signerEmailAddress(@javax.annotation.Nullable String signerEmailAddress) { + this.signerEmailAddress = signerEmailAddress; + return this; + } + + /** + * The email address of the signer. + * @return signerEmailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSignerEmailAddress() { + return signerEmailAddress; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerEmailAddress(@javax.annotation.Nullable String signerEmailAddress) { + this.signerEmailAddress = signerEmailAddress; + } + + + public SignatureRequestResponseSignatures signerName(@javax.annotation.Nullable String signerName) { + this.signerName = signerName; + return this; + } + + /** + * The name of the signer. + * @return signerName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSignerName() { + return signerName; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerName(@javax.annotation.Nullable String signerName) { + this.signerName = signerName; + } + + + public SignatureRequestResponseSignatures signerRole(@javax.annotation.Nullable String signerRole) { + this.signerRole = signerRole; + return this; + } + + /** + * The role of the signer. + * @return signerRole + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSignerRole() { + return signerRole; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerRole(@javax.annotation.Nullable String signerRole) { + this.signerRole = signerRole; + } + + + public SignatureRequestResponseSignatures order(@javax.annotation.Nullable Integer order) { + this.order = order; + return this; + } + + /** + * If signer order is assigned this is the 0-based index for this signer. + * @return order + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getOrder() { + return order; + } + + + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(@javax.annotation.Nullable Integer order) { + this.order = order; + } + + + public SignatureRequestResponseSignatures statusCode(@javax.annotation.Nullable String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * The current status of the signature. eg: awaiting_signature, signed, declined. + * @return statusCode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStatusCode() { + return statusCode; + } + + + @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatusCode(@javax.annotation.Nullable String statusCode) { + this.statusCode = statusCode; + } + + + public SignatureRequestResponseSignatures declineReason(@javax.annotation.Nullable String declineReason) { + this.declineReason = declineReason; + return this; + } + + /** + * The reason provided by the signer for declining the request. + * @return declineReason + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DECLINE_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDeclineReason() { + return declineReason; + } + + + @JsonProperty(JSON_PROPERTY_DECLINE_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclineReason(@javax.annotation.Nullable String declineReason) { + this.declineReason = declineReason; + } + + + public SignatureRequestResponseSignatures signedAt(@javax.annotation.Nullable Integer signedAt) { + this.signedAt = signedAt; + return this; + } + + /** + * Time that the document was signed or null. + * @return signedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSignedAt() { + return signedAt; + } + + + @JsonProperty(JSON_PROPERTY_SIGNED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignedAt(@javax.annotation.Nullable Integer signedAt) { + this.signedAt = signedAt; + } + + + public SignatureRequestResponseSignatures lastViewedAt(@javax.annotation.Nullable Integer lastViewedAt) { + this.lastViewedAt = lastViewedAt; + return this; + } + + /** + * The time that the document was last viewed by this signer or null. + * @return lastViewedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_VIEWED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getLastViewedAt() { + return lastViewedAt; + } + + + @JsonProperty(JSON_PROPERTY_LAST_VIEWED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastViewedAt(@javax.annotation.Nullable Integer lastViewedAt) { + this.lastViewedAt = lastViewedAt; + } + + + public SignatureRequestResponseSignatures lastRemindedAt(@javax.annotation.Nullable Integer lastRemindedAt) { + this.lastRemindedAt = lastRemindedAt; + return this; + } + + /** + * The time the last reminder email was sent to the signer or null. + * @return lastRemindedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_REMINDED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getLastRemindedAt() { + return lastRemindedAt; + } + + + @JsonProperty(JSON_PROPERTY_LAST_REMINDED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastRemindedAt(@javax.annotation.Nullable Integer lastRemindedAt) { + this.lastRemindedAt = lastRemindedAt; + } + + + public SignatureRequestResponseSignatures hasPin(@javax.annotation.Nullable Boolean hasPin) { + this.hasPin = hasPin; + return this; + } + + /** + * Boolean to indicate whether this signature requires a PIN to access. + * @return hasPin + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_PIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHasPin() { + return hasPin; + } + + + @JsonProperty(JSON_PROPERTY_HAS_PIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasPin(@javax.annotation.Nullable Boolean hasPin) { + this.hasPin = hasPin; + } + + + public SignatureRequestResponseSignatures hasSmsAuth(@javax.annotation.Nullable Boolean hasSmsAuth) { + this.hasSmsAuth = hasSmsAuth; + return this; + } + + /** + * Boolean to indicate whether this signature has SMS authentication enabled. + * @return hasSmsAuth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_SMS_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHasSmsAuth() { + return hasSmsAuth; + } + + + @JsonProperty(JSON_PROPERTY_HAS_SMS_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasSmsAuth(@javax.annotation.Nullable Boolean hasSmsAuth) { + this.hasSmsAuth = hasSmsAuth; + } + + + public SignatureRequestResponseSignatures hasSmsDelivery(@javax.annotation.Nullable Boolean hasSmsDelivery) { + this.hasSmsDelivery = hasSmsDelivery; + return this; + } + + /** + * Boolean to indicate whether this signature has SMS delivery enabled. + * @return hasSmsDelivery + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_SMS_DELIVERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHasSmsDelivery() { + return hasSmsDelivery; + } + + + @JsonProperty(JSON_PROPERTY_HAS_SMS_DELIVERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasSmsDelivery(@javax.annotation.Nullable Boolean hasSmsDelivery) { + this.hasSmsDelivery = hasSmsDelivery; + } + + + public SignatureRequestResponseSignatures smsPhoneNumber(@javax.annotation.Nullable String smsPhoneNumber) { + this.smsPhoneNumber = smsPhoneNumber; + return this; + } + + /** + * The SMS phone number used for authentication or signature request delivery. + * @return smsPhoneNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSmsPhoneNumber() { + return smsPhoneNumber; + } + + + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsPhoneNumber(@javax.annotation.Nullable String smsPhoneNumber) { + this.smsPhoneNumber = smsPhoneNumber; + } + + + public SignatureRequestResponseSignatures reassignedBy(@javax.annotation.Nullable String reassignedBy) { + this.reassignedBy = reassignedBy; + return this; + } + + /** + * Email address of original signer who reassigned to this signer. + * @return reassignedBy + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REASSIGNED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReassignedBy() { + return reassignedBy; + } + + + @JsonProperty(JSON_PROPERTY_REASSIGNED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReassignedBy(@javax.annotation.Nullable String reassignedBy) { + this.reassignedBy = reassignedBy; + } + + + public SignatureRequestResponseSignatures reassignmentReason(@javax.annotation.Nullable String reassignmentReason) { + this.reassignmentReason = reassignmentReason; + return this; + } + + /** + * Reason provided by original signer who reassigned to this signer. + * @return reassignmentReason + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REASSIGNMENT_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReassignmentReason() { + return reassignmentReason; + } + + + @JsonProperty(JSON_PROPERTY_REASSIGNMENT_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReassignmentReason(@javax.annotation.Nullable String reassignmentReason) { + this.reassignmentReason = reassignmentReason; + } + + + public SignatureRequestResponseSignatures reassignedFrom(@javax.annotation.Nullable String reassignedFrom) { + this.reassignedFrom = reassignedFrom; + return this; + } + + /** + * Previous signature identifier. + * @return reassignedFrom + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REASSIGNED_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReassignedFrom() { + return reassignedFrom; + } + + + @JsonProperty(JSON_PROPERTY_REASSIGNED_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReassignedFrom(@javax.annotation.Nullable String reassignedFrom) { + this.reassignedFrom = reassignedFrom; + } + + + public SignatureRequestResponseSignatures error(@javax.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * Error message pertaining to this signer, or null. + * @return error + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getError() { + return error; + } + + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(@javax.annotation.Nullable String error) { + this.error = error; + } + + + /** + * Return true if this SignatureRequestResponseSignatures object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponseSignatures signatureRequestResponseSignatures = (SignatureRequestResponseSignatures) o; + return Objects.equals(this.signatureId, signatureRequestResponseSignatures.signatureId) && + Objects.equals(this.signerGroupGuid, signatureRequestResponseSignatures.signerGroupGuid) && + Objects.equals(this.signerEmailAddress, signatureRequestResponseSignatures.signerEmailAddress) && + Objects.equals(this.signerName, signatureRequestResponseSignatures.signerName) && + Objects.equals(this.signerRole, signatureRequestResponseSignatures.signerRole) && + Objects.equals(this.order, signatureRequestResponseSignatures.order) && + Objects.equals(this.statusCode, signatureRequestResponseSignatures.statusCode) && + Objects.equals(this.declineReason, signatureRequestResponseSignatures.declineReason) && + Objects.equals(this.signedAt, signatureRequestResponseSignatures.signedAt) && + Objects.equals(this.lastViewedAt, signatureRequestResponseSignatures.lastViewedAt) && + Objects.equals(this.lastRemindedAt, signatureRequestResponseSignatures.lastRemindedAt) && + Objects.equals(this.hasPin, signatureRequestResponseSignatures.hasPin) && + Objects.equals(this.hasSmsAuth, signatureRequestResponseSignatures.hasSmsAuth) && + Objects.equals(this.hasSmsDelivery, signatureRequestResponseSignatures.hasSmsDelivery) && + Objects.equals(this.smsPhoneNumber, signatureRequestResponseSignatures.smsPhoneNumber) && + Objects.equals(this.reassignedBy, signatureRequestResponseSignatures.reassignedBy) && + Objects.equals(this.reassignmentReason, signatureRequestResponseSignatures.reassignmentReason) && + Objects.equals(this.reassignedFrom, signatureRequestResponseSignatures.reassignedFrom) && + Objects.equals(this.error, signatureRequestResponseSignatures.error); + } + + @Override + public int hashCode() { + return Objects.hash(signatureId, signerGroupGuid, signerEmailAddress, signerName, signerRole, order, statusCode, declineReason, signedAt, lastViewedAt, lastRemindedAt, hasPin, hasSmsAuth, hasSmsDelivery, smsPhoneNumber, reassignedBy, reassignmentReason, reassignedFrom, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseSignatures {\n"); + sb.append(" signatureId: ").append(toIndentedString(signatureId)).append("\n"); + sb.append(" signerGroupGuid: ").append(toIndentedString(signerGroupGuid)).append("\n"); + sb.append(" signerEmailAddress: ").append(toIndentedString(signerEmailAddress)).append("\n"); + sb.append(" signerName: ").append(toIndentedString(signerName)).append("\n"); + sb.append(" signerRole: ").append(toIndentedString(signerRole)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" declineReason: ").append(toIndentedString(declineReason)).append("\n"); + sb.append(" signedAt: ").append(toIndentedString(signedAt)).append("\n"); + sb.append(" lastViewedAt: ").append(toIndentedString(lastViewedAt)).append("\n"); + sb.append(" lastRemindedAt: ").append(toIndentedString(lastRemindedAt)).append("\n"); + sb.append(" hasPin: ").append(toIndentedString(hasPin)).append("\n"); + sb.append(" hasSmsAuth: ").append(toIndentedString(hasSmsAuth)).append("\n"); + sb.append(" hasSmsDelivery: ").append(toIndentedString(hasSmsDelivery)).append("\n"); + sb.append(" smsPhoneNumber: ").append(toIndentedString(smsPhoneNumber)).append("\n"); + sb.append(" reassignedBy: ").append(toIndentedString(reassignedBy)).append("\n"); + sb.append(" reassignmentReason: ").append(toIndentedString(reassignmentReason)).append("\n"); + sb.append(" reassignedFrom: ").append(toIndentedString(reassignedFrom)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (signatureId != null) { + if (isFileTypeOrListOfFiles(signatureId)) { + fileTypeFound = true; + } - /** - * Boolean to indicate whether this signature has SMS delivery enabled. - * - * @return hasSmsDelivery - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_SMS_DELIVERY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHasSmsDelivery() { - return hasSmsDelivery; + if (signatureId.getClass().equals(java.io.File.class) || + signatureId.getClass().equals(Integer.class) || + signatureId.getClass().equals(String.class) || + signatureId.getClass().isEnum()) { + map.put("signature_id", signatureId); + } else if (isListOfFile(signatureId)) { + for(int i = 0; i< getListSize(signatureId); i++) { + map.put("signature_id[" + i + "]", getFromList(signatureId, i)); + } + } + else { + map.put("signature_id", JSON.getDefault().getMapper().writeValueAsString(signatureId)); + } } + if (signerGroupGuid != null) { + if (isFileTypeOrListOfFiles(signerGroupGuid)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_HAS_SMS_DELIVERY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasSmsDelivery(@javax.annotation.Nullable Boolean hasSmsDelivery) { - this.hasSmsDelivery = hasSmsDelivery; + if (signerGroupGuid.getClass().equals(java.io.File.class) || + signerGroupGuid.getClass().equals(Integer.class) || + signerGroupGuid.getClass().equals(String.class) || + signerGroupGuid.getClass().isEnum()) { + map.put("signer_group_guid", signerGroupGuid); + } else if (isListOfFile(signerGroupGuid)) { + for(int i = 0; i< getListSize(signerGroupGuid); i++) { + map.put("signer_group_guid[" + i + "]", getFromList(signerGroupGuid, i)); + } + } + else { + map.put("signer_group_guid", JSON.getDefault().getMapper().writeValueAsString(signerGroupGuid)); + } } + if (signerEmailAddress != null) { + if (isFileTypeOrListOfFiles(signerEmailAddress)) { + fileTypeFound = true; + } - public SignatureRequestResponseSignatures smsPhoneNumber( - @javax.annotation.Nullable String smsPhoneNumber) { - this.smsPhoneNumber = smsPhoneNumber; - return this; + if (signerEmailAddress.getClass().equals(java.io.File.class) || + signerEmailAddress.getClass().equals(Integer.class) || + signerEmailAddress.getClass().equals(String.class) || + signerEmailAddress.getClass().isEnum()) { + map.put("signer_email_address", signerEmailAddress); + } else if (isListOfFile(signerEmailAddress)) { + for(int i = 0; i< getListSize(signerEmailAddress); i++) { + map.put("signer_email_address[" + i + "]", getFromList(signerEmailAddress, i)); + } + } + else { + map.put("signer_email_address", JSON.getDefault().getMapper().writeValueAsString(signerEmailAddress)); + } } + if (signerName != null) { + if (isFileTypeOrListOfFiles(signerName)) { + fileTypeFound = true; + } - /** - * The SMS phone number used for authentication or signature request delivery. - * - * @return smsPhoneNumber - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmsPhoneNumber() { - return smsPhoneNumber; + if (signerName.getClass().equals(java.io.File.class) || + signerName.getClass().equals(Integer.class) || + signerName.getClass().equals(String.class) || + signerName.getClass().isEnum()) { + map.put("signer_name", signerName); + } else if (isListOfFile(signerName)) { + for(int i = 0; i< getListSize(signerName); i++) { + map.put("signer_name[" + i + "]", getFromList(signerName, i)); + } + } + else { + map.put("signer_name", JSON.getDefault().getMapper().writeValueAsString(signerName)); + } } + if (signerRole != null) { + if (isFileTypeOrListOfFiles(signerRole)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsPhoneNumber(@javax.annotation.Nullable String smsPhoneNumber) { - this.smsPhoneNumber = smsPhoneNumber; + if (signerRole.getClass().equals(java.io.File.class) || + signerRole.getClass().equals(Integer.class) || + signerRole.getClass().equals(String.class) || + signerRole.getClass().isEnum()) { + map.put("signer_role", signerRole); + } else if (isListOfFile(signerRole)) { + for(int i = 0; i< getListSize(signerRole); i++) { + map.put("signer_role[" + i + "]", getFromList(signerRole, i)); + } + } + else { + map.put("signer_role", JSON.getDefault().getMapper().writeValueAsString(signerRole)); + } } + if (order != null) { + if (isFileTypeOrListOfFiles(order)) { + fileTypeFound = true; + } - public SignatureRequestResponseSignatures reassignedBy( - @javax.annotation.Nullable String reassignedBy) { - this.reassignedBy = reassignedBy; - return this; + if (order.getClass().equals(java.io.File.class) || + order.getClass().equals(Integer.class) || + order.getClass().equals(String.class) || + order.getClass().isEnum()) { + map.put("order", order); + } else if (isListOfFile(order)) { + for(int i = 0; i< getListSize(order); i++) { + map.put("order[" + i + "]", getFromList(order, i)); + } + } + else { + map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + } } + if (statusCode != null) { + if (isFileTypeOrListOfFiles(statusCode)) { + fileTypeFound = true; + } - /** - * Email address of original signer who reassigned to this signer. - * - * @return reassignedBy - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REASSIGNED_BY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getReassignedBy() { - return reassignedBy; + if (statusCode.getClass().equals(java.io.File.class) || + statusCode.getClass().equals(Integer.class) || + statusCode.getClass().equals(String.class) || + statusCode.getClass().isEnum()) { + map.put("status_code", statusCode); + } else if (isListOfFile(statusCode)) { + for(int i = 0; i< getListSize(statusCode); i++) { + map.put("status_code[" + i + "]", getFromList(statusCode, i)); + } + } + else { + map.put("status_code", JSON.getDefault().getMapper().writeValueAsString(statusCode)); + } } + if (declineReason != null) { + if (isFileTypeOrListOfFiles(declineReason)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_REASSIGNED_BY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReassignedBy(@javax.annotation.Nullable String reassignedBy) { - this.reassignedBy = reassignedBy; + if (declineReason.getClass().equals(java.io.File.class) || + declineReason.getClass().equals(Integer.class) || + declineReason.getClass().equals(String.class) || + declineReason.getClass().isEnum()) { + map.put("decline_reason", declineReason); + } else if (isListOfFile(declineReason)) { + for(int i = 0; i< getListSize(declineReason); i++) { + map.put("decline_reason[" + i + "]", getFromList(declineReason, i)); + } + } + else { + map.put("decline_reason", JSON.getDefault().getMapper().writeValueAsString(declineReason)); + } } + if (signedAt != null) { + if (isFileTypeOrListOfFiles(signedAt)) { + fileTypeFound = true; + } - public SignatureRequestResponseSignatures reassignmentReason( - @javax.annotation.Nullable String reassignmentReason) { - this.reassignmentReason = reassignmentReason; - return this; + if (signedAt.getClass().equals(java.io.File.class) || + signedAt.getClass().equals(Integer.class) || + signedAt.getClass().equals(String.class) || + signedAt.getClass().isEnum()) { + map.put("signed_at", signedAt); + } else if (isListOfFile(signedAt)) { + for(int i = 0; i< getListSize(signedAt); i++) { + map.put("signed_at[" + i + "]", getFromList(signedAt, i)); + } + } + else { + map.put("signed_at", JSON.getDefault().getMapper().writeValueAsString(signedAt)); + } } + if (lastViewedAt != null) { + if (isFileTypeOrListOfFiles(lastViewedAt)) { + fileTypeFound = true; + } - /** - * Reason provided by original signer who reassigned to this signer. - * - * @return reassignmentReason - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REASSIGNMENT_REASON) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getReassignmentReason() { - return reassignmentReason; + if (lastViewedAt.getClass().equals(java.io.File.class) || + lastViewedAt.getClass().equals(Integer.class) || + lastViewedAt.getClass().equals(String.class) || + lastViewedAt.getClass().isEnum()) { + map.put("last_viewed_at", lastViewedAt); + } else if (isListOfFile(lastViewedAt)) { + for(int i = 0; i< getListSize(lastViewedAt); i++) { + map.put("last_viewed_at[" + i + "]", getFromList(lastViewedAt, i)); + } + } + else { + map.put("last_viewed_at", JSON.getDefault().getMapper().writeValueAsString(lastViewedAt)); + } } + if (lastRemindedAt != null) { + if (isFileTypeOrListOfFiles(lastRemindedAt)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_REASSIGNMENT_REASON) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReassignmentReason(@javax.annotation.Nullable String reassignmentReason) { - this.reassignmentReason = reassignmentReason; + if (lastRemindedAt.getClass().equals(java.io.File.class) || + lastRemindedAt.getClass().equals(Integer.class) || + lastRemindedAt.getClass().equals(String.class) || + lastRemindedAt.getClass().isEnum()) { + map.put("last_reminded_at", lastRemindedAt); + } else if (isListOfFile(lastRemindedAt)) { + for(int i = 0; i< getListSize(lastRemindedAt); i++) { + map.put("last_reminded_at[" + i + "]", getFromList(lastRemindedAt, i)); + } + } + else { + map.put("last_reminded_at", JSON.getDefault().getMapper().writeValueAsString(lastRemindedAt)); + } } + if (hasPin != null) { + if (isFileTypeOrListOfFiles(hasPin)) { + fileTypeFound = true; + } - public SignatureRequestResponseSignatures reassignedFrom( - @javax.annotation.Nullable String reassignedFrom) { - this.reassignedFrom = reassignedFrom; - return this; + if (hasPin.getClass().equals(java.io.File.class) || + hasPin.getClass().equals(Integer.class) || + hasPin.getClass().equals(String.class) || + hasPin.getClass().isEnum()) { + map.put("has_pin", hasPin); + } else if (isListOfFile(hasPin)) { + for(int i = 0; i< getListSize(hasPin); i++) { + map.put("has_pin[" + i + "]", getFromList(hasPin, i)); + } + } + else { + map.put("has_pin", JSON.getDefault().getMapper().writeValueAsString(hasPin)); + } } + if (hasSmsAuth != null) { + if (isFileTypeOrListOfFiles(hasSmsAuth)) { + fileTypeFound = true; + } - /** - * Previous signature identifier. - * - * @return reassignedFrom - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REASSIGNED_FROM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getReassignedFrom() { - return reassignedFrom; + if (hasSmsAuth.getClass().equals(java.io.File.class) || + hasSmsAuth.getClass().equals(Integer.class) || + hasSmsAuth.getClass().equals(String.class) || + hasSmsAuth.getClass().isEnum()) { + map.put("has_sms_auth", hasSmsAuth); + } else if (isListOfFile(hasSmsAuth)) { + for(int i = 0; i< getListSize(hasSmsAuth); i++) { + map.put("has_sms_auth[" + i + "]", getFromList(hasSmsAuth, i)); + } + } + else { + map.put("has_sms_auth", JSON.getDefault().getMapper().writeValueAsString(hasSmsAuth)); + } } + if (hasSmsDelivery != null) { + if (isFileTypeOrListOfFiles(hasSmsDelivery)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_REASSIGNED_FROM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReassignedFrom(@javax.annotation.Nullable String reassignedFrom) { - this.reassignedFrom = reassignedFrom; + if (hasSmsDelivery.getClass().equals(java.io.File.class) || + hasSmsDelivery.getClass().equals(Integer.class) || + hasSmsDelivery.getClass().equals(String.class) || + hasSmsDelivery.getClass().isEnum()) { + map.put("has_sms_delivery", hasSmsDelivery); + } else if (isListOfFile(hasSmsDelivery)) { + for(int i = 0; i< getListSize(hasSmsDelivery); i++) { + map.put("has_sms_delivery[" + i + "]", getFromList(hasSmsDelivery, i)); + } + } + else { + map.put("has_sms_delivery", JSON.getDefault().getMapper().writeValueAsString(hasSmsDelivery)); + } } + if (smsPhoneNumber != null) { + if (isFileTypeOrListOfFiles(smsPhoneNumber)) { + fileTypeFound = true; + } - public SignatureRequestResponseSignatures error(@javax.annotation.Nullable String error) { - this.error = error; - return this; + if (smsPhoneNumber.getClass().equals(java.io.File.class) || + smsPhoneNumber.getClass().equals(Integer.class) || + smsPhoneNumber.getClass().equals(String.class) || + smsPhoneNumber.getClass().isEnum()) { + map.put("sms_phone_number", smsPhoneNumber); + } else if (isListOfFile(smsPhoneNumber)) { + for(int i = 0; i< getListSize(smsPhoneNumber); i++) { + map.put("sms_phone_number[" + i + "]", getFromList(smsPhoneNumber, i)); + } + } + else { + map.put("sms_phone_number", JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumber)); + } } + if (reassignedBy != null) { + if (isFileTypeOrListOfFiles(reassignedBy)) { + fileTypeFound = true; + } - /** - * Error message pertaining to this signer, or null. - * - * @return error - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getError() { - return error; + if (reassignedBy.getClass().equals(java.io.File.class) || + reassignedBy.getClass().equals(Integer.class) || + reassignedBy.getClass().equals(String.class) || + reassignedBy.getClass().isEnum()) { + map.put("reassigned_by", reassignedBy); + } else if (isListOfFile(reassignedBy)) { + for(int i = 0; i< getListSize(reassignedBy); i++) { + map.put("reassigned_by[" + i + "]", getFromList(reassignedBy, i)); + } + } + else { + map.put("reassigned_by", JSON.getDefault().getMapper().writeValueAsString(reassignedBy)); + } } + if (reassignmentReason != null) { + if (isFileTypeOrListOfFiles(reassignmentReason)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setError(@javax.annotation.Nullable String error) { - this.error = error; + if (reassignmentReason.getClass().equals(java.io.File.class) || + reassignmentReason.getClass().equals(Integer.class) || + reassignmentReason.getClass().equals(String.class) || + reassignmentReason.getClass().isEnum()) { + map.put("reassignment_reason", reassignmentReason); + } else if (isListOfFile(reassignmentReason)) { + for(int i = 0; i< getListSize(reassignmentReason); i++) { + map.put("reassignment_reason[" + i + "]", getFromList(reassignmentReason, i)); + } + } + else { + map.put("reassignment_reason", JSON.getDefault().getMapper().writeValueAsString(reassignmentReason)); + } } + if (reassignedFrom != null) { + if (isFileTypeOrListOfFiles(reassignedFrom)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestResponseSignatures object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (reassignedFrom.getClass().equals(java.io.File.class) || + reassignedFrom.getClass().equals(Integer.class) || + reassignedFrom.getClass().equals(String.class) || + reassignedFrom.getClass().isEnum()) { + map.put("reassigned_from", reassignedFrom); + } else if (isListOfFile(reassignedFrom)) { + for(int i = 0; i< getListSize(reassignedFrom); i++) { + map.put("reassigned_from[" + i + "]", getFromList(reassignedFrom, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("reassigned_from", JSON.getDefault().getMapper().writeValueAsString(reassignedFrom)); } - SignatureRequestResponseSignatures signatureRequestResponseSignatures = - (SignatureRequestResponseSignatures) o; - return Objects.equals(this.signatureId, signatureRequestResponseSignatures.signatureId) - && Objects.equals( - this.signerGroupGuid, signatureRequestResponseSignatures.signerGroupGuid) - && Objects.equals( - this.signerEmailAddress, - signatureRequestResponseSignatures.signerEmailAddress) - && Objects.equals(this.signerName, signatureRequestResponseSignatures.signerName) - && Objects.equals(this.signerRole, signatureRequestResponseSignatures.signerRole) - && Objects.equals(this.order, signatureRequestResponseSignatures.order) - && Objects.equals(this.statusCode, signatureRequestResponseSignatures.statusCode) - && Objects.equals( - this.declineReason, signatureRequestResponseSignatures.declineReason) - && Objects.equals(this.signedAt, signatureRequestResponseSignatures.signedAt) - && Objects.equals( - this.lastViewedAt, signatureRequestResponseSignatures.lastViewedAt) - && Objects.equals( - this.lastRemindedAt, signatureRequestResponseSignatures.lastRemindedAt) - && Objects.equals(this.hasPin, signatureRequestResponseSignatures.hasPin) - && Objects.equals(this.hasSmsAuth, signatureRequestResponseSignatures.hasSmsAuth) - && Objects.equals( - this.hasSmsDelivery, signatureRequestResponseSignatures.hasSmsDelivery) - && Objects.equals( - this.smsPhoneNumber, signatureRequestResponseSignatures.smsPhoneNumber) - && Objects.equals( - this.reassignedBy, signatureRequestResponseSignatures.reassignedBy) - && Objects.equals( - this.reassignmentReason, - signatureRequestResponseSignatures.reassignmentReason) - && Objects.equals( - this.reassignedFrom, signatureRequestResponseSignatures.reassignedFrom) - && Objects.equals(this.error, signatureRequestResponseSignatures.error); } + if (error != null) { + if (isFileTypeOrListOfFiles(error)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - signatureId, - signerGroupGuid, - signerEmailAddress, - signerName, - signerRole, - order, - statusCode, - declineReason, - signedAt, - lastViewedAt, - lastRemindedAt, - hasPin, - hasSmsAuth, - hasSmsDelivery, - smsPhoneNumber, - reassignedBy, - reassignmentReason, - reassignedFrom, - error); + if (error.getClass().equals(java.io.File.class) || + error.getClass().equals(Integer.class) || + error.getClass().equals(String.class) || + error.getClass().isEnum()) { + map.put("error", error); + } else if (isListOfFile(error)) { + for(int i = 0; i< getListSize(error); i++) { + map.put("error[" + i + "]", getFromList(error, i)); + } + } + else { + map.put("error", JSON.getDefault().getMapper().writeValueAsString(error)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseSignatures {\n"); - sb.append(" signatureId: ").append(toIndentedString(signatureId)).append("\n"); - sb.append(" signerGroupGuid: ").append(toIndentedString(signerGroupGuid)).append("\n"); - sb.append(" signerEmailAddress: ") - .append(toIndentedString(signerEmailAddress)) - .append("\n"); - sb.append(" signerName: ").append(toIndentedString(signerName)).append("\n"); - sb.append(" signerRole: ").append(toIndentedString(signerRole)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); - sb.append(" declineReason: ").append(toIndentedString(declineReason)).append("\n"); - sb.append(" signedAt: ").append(toIndentedString(signedAt)).append("\n"); - sb.append(" lastViewedAt: ").append(toIndentedString(lastViewedAt)).append("\n"); - sb.append(" lastRemindedAt: ").append(toIndentedString(lastRemindedAt)).append("\n"); - sb.append(" hasPin: ").append(toIndentedString(hasPin)).append("\n"); - sb.append(" hasSmsAuth: ").append(toIndentedString(hasSmsAuth)).append("\n"); - sb.append(" hasSmsDelivery: ").append(toIndentedString(hasSmsDelivery)).append("\n"); - sb.append(" smsPhoneNumber: ").append(toIndentedString(smsPhoneNumber)).append("\n"); - sb.append(" reassignedBy: ").append(toIndentedString(reassignedBy)).append("\n"); - sb.append(" reassignmentReason: ") - .append(toIndentedString(reassignmentReason)) - .append("\n"); - sb.append(" reassignedFrom: ").append(toIndentedString(reassignedFrom)).append("\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (signatureId != null) { - if (isFileTypeOrListOfFiles(signatureId)) { - fileTypeFound = true; - } - - if (signatureId.getClass().equals(java.io.File.class) - || signatureId.getClass().equals(Integer.class) - || signatureId.getClass().equals(String.class) - || signatureId.getClass().isEnum()) { - map.put("signature_id", signatureId); - } else if (isListOfFile(signatureId)) { - for (int i = 0; i < getListSize(signatureId); i++) { - map.put("signature_id[" + i + "]", getFromList(signatureId, i)); - } - } else { - map.put( - "signature_id", - JSON.getDefault().getMapper().writeValueAsString(signatureId)); - } - } - if (signerGroupGuid != null) { - if (isFileTypeOrListOfFiles(signerGroupGuid)) { - fileTypeFound = true; - } - - if (signerGroupGuid.getClass().equals(java.io.File.class) - || signerGroupGuid.getClass().equals(Integer.class) - || signerGroupGuid.getClass().equals(String.class) - || signerGroupGuid.getClass().isEnum()) { - map.put("signer_group_guid", signerGroupGuid); - } else if (isListOfFile(signerGroupGuid)) { - for (int i = 0; i < getListSize(signerGroupGuid); i++) { - map.put("signer_group_guid[" + i + "]", getFromList(signerGroupGuid, i)); - } - } else { - map.put( - "signer_group_guid", - JSON.getDefault().getMapper().writeValueAsString(signerGroupGuid)); - } - } - if (signerEmailAddress != null) { - if (isFileTypeOrListOfFiles(signerEmailAddress)) { - fileTypeFound = true; - } - - if (signerEmailAddress.getClass().equals(java.io.File.class) - || signerEmailAddress.getClass().equals(Integer.class) - || signerEmailAddress.getClass().equals(String.class) - || signerEmailAddress.getClass().isEnum()) { - map.put("signer_email_address", signerEmailAddress); - } else if (isListOfFile(signerEmailAddress)) { - for (int i = 0; i < getListSize(signerEmailAddress); i++) { - map.put( - "signer_email_address[" + i + "]", - getFromList(signerEmailAddress, i)); - } - } else { - map.put( - "signer_email_address", - JSON.getDefault().getMapper().writeValueAsString(signerEmailAddress)); - } - } - if (signerName != null) { - if (isFileTypeOrListOfFiles(signerName)) { - fileTypeFound = true; - } - - if (signerName.getClass().equals(java.io.File.class) - || signerName.getClass().equals(Integer.class) - || signerName.getClass().equals(String.class) - || signerName.getClass().isEnum()) { - map.put("signer_name", signerName); - } else if (isListOfFile(signerName)) { - for (int i = 0; i < getListSize(signerName); i++) { - map.put("signer_name[" + i + "]", getFromList(signerName, i)); - } - } else { - map.put( - "signer_name", - JSON.getDefault().getMapper().writeValueAsString(signerName)); - } - } - if (signerRole != null) { - if (isFileTypeOrListOfFiles(signerRole)) { - fileTypeFound = true; - } - - if (signerRole.getClass().equals(java.io.File.class) - || signerRole.getClass().equals(Integer.class) - || signerRole.getClass().equals(String.class) - || signerRole.getClass().isEnum()) { - map.put("signer_role", signerRole); - } else if (isListOfFile(signerRole)) { - for (int i = 0; i < getListSize(signerRole); i++) { - map.put("signer_role[" + i + "]", getFromList(signerRole, i)); - } - } else { - map.put( - "signer_role", - JSON.getDefault().getMapper().writeValueAsString(signerRole)); - } - } - if (order != null) { - if (isFileTypeOrListOfFiles(order)) { - fileTypeFound = true; - } - - if (order.getClass().equals(java.io.File.class) - || order.getClass().equals(Integer.class) - || order.getClass().equals(String.class) - || order.getClass().isEnum()) { - map.put("order", order); - } else if (isListOfFile(order)) { - for (int i = 0; i < getListSize(order); i++) { - map.put("order[" + i + "]", getFromList(order, i)); - } - } else { - map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); - } - } - if (statusCode != null) { - if (isFileTypeOrListOfFiles(statusCode)) { - fileTypeFound = true; - } - - if (statusCode.getClass().equals(java.io.File.class) - || statusCode.getClass().equals(Integer.class) - || statusCode.getClass().equals(String.class) - || statusCode.getClass().isEnum()) { - map.put("status_code", statusCode); - } else if (isListOfFile(statusCode)) { - for (int i = 0; i < getListSize(statusCode); i++) { - map.put("status_code[" + i + "]", getFromList(statusCode, i)); - } - } else { - map.put( - "status_code", - JSON.getDefault().getMapper().writeValueAsString(statusCode)); - } - } - if (declineReason != null) { - if (isFileTypeOrListOfFiles(declineReason)) { - fileTypeFound = true; - } - - if (declineReason.getClass().equals(java.io.File.class) - || declineReason.getClass().equals(Integer.class) - || declineReason.getClass().equals(String.class) - || declineReason.getClass().isEnum()) { - map.put("decline_reason", declineReason); - } else if (isListOfFile(declineReason)) { - for (int i = 0; i < getListSize(declineReason); i++) { - map.put("decline_reason[" + i + "]", getFromList(declineReason, i)); - } - } else { - map.put( - "decline_reason", - JSON.getDefault().getMapper().writeValueAsString(declineReason)); - } - } - if (signedAt != null) { - if (isFileTypeOrListOfFiles(signedAt)) { - fileTypeFound = true; - } - - if (signedAt.getClass().equals(java.io.File.class) - || signedAt.getClass().equals(Integer.class) - || signedAt.getClass().equals(String.class) - || signedAt.getClass().isEnum()) { - map.put("signed_at", signedAt); - } else if (isListOfFile(signedAt)) { - for (int i = 0; i < getListSize(signedAt); i++) { - map.put("signed_at[" + i + "]", getFromList(signedAt, i)); - } - } else { - map.put( - "signed_at", - JSON.getDefault().getMapper().writeValueAsString(signedAt)); - } - } - if (lastViewedAt != null) { - if (isFileTypeOrListOfFiles(lastViewedAt)) { - fileTypeFound = true; - } - - if (lastViewedAt.getClass().equals(java.io.File.class) - || lastViewedAt.getClass().equals(Integer.class) - || lastViewedAt.getClass().equals(String.class) - || lastViewedAt.getClass().isEnum()) { - map.put("last_viewed_at", lastViewedAt); - } else if (isListOfFile(lastViewedAt)) { - for (int i = 0; i < getListSize(lastViewedAt); i++) { - map.put("last_viewed_at[" + i + "]", getFromList(lastViewedAt, i)); - } - } else { - map.put( - "last_viewed_at", - JSON.getDefault().getMapper().writeValueAsString(lastViewedAt)); - } - } - if (lastRemindedAt != null) { - if (isFileTypeOrListOfFiles(lastRemindedAt)) { - fileTypeFound = true; - } - - if (lastRemindedAt.getClass().equals(java.io.File.class) - || lastRemindedAt.getClass().equals(Integer.class) - || lastRemindedAt.getClass().equals(String.class) - || lastRemindedAt.getClass().isEnum()) { - map.put("last_reminded_at", lastRemindedAt); - } else if (isListOfFile(lastRemindedAt)) { - for (int i = 0; i < getListSize(lastRemindedAt); i++) { - map.put("last_reminded_at[" + i + "]", getFromList(lastRemindedAt, i)); - } - } else { - map.put( - "last_reminded_at", - JSON.getDefault().getMapper().writeValueAsString(lastRemindedAt)); - } - } - if (hasPin != null) { - if (isFileTypeOrListOfFiles(hasPin)) { - fileTypeFound = true; - } - - if (hasPin.getClass().equals(java.io.File.class) - || hasPin.getClass().equals(Integer.class) - || hasPin.getClass().equals(String.class) - || hasPin.getClass().isEnum()) { - map.put("has_pin", hasPin); - } else if (isListOfFile(hasPin)) { - for (int i = 0; i < getListSize(hasPin); i++) { - map.put("has_pin[" + i + "]", getFromList(hasPin, i)); - } - } else { - map.put("has_pin", JSON.getDefault().getMapper().writeValueAsString(hasPin)); - } - } - if (hasSmsAuth != null) { - if (isFileTypeOrListOfFiles(hasSmsAuth)) { - fileTypeFound = true; - } - - if (hasSmsAuth.getClass().equals(java.io.File.class) - || hasSmsAuth.getClass().equals(Integer.class) - || hasSmsAuth.getClass().equals(String.class) - || hasSmsAuth.getClass().isEnum()) { - map.put("has_sms_auth", hasSmsAuth); - } else if (isListOfFile(hasSmsAuth)) { - for (int i = 0; i < getListSize(hasSmsAuth); i++) { - map.put("has_sms_auth[" + i + "]", getFromList(hasSmsAuth, i)); - } - } else { - map.put( - "has_sms_auth", - JSON.getDefault().getMapper().writeValueAsString(hasSmsAuth)); - } - } - if (hasSmsDelivery != null) { - if (isFileTypeOrListOfFiles(hasSmsDelivery)) { - fileTypeFound = true; - } - - if (hasSmsDelivery.getClass().equals(java.io.File.class) - || hasSmsDelivery.getClass().equals(Integer.class) - || hasSmsDelivery.getClass().equals(String.class) - || hasSmsDelivery.getClass().isEnum()) { - map.put("has_sms_delivery", hasSmsDelivery); - } else if (isListOfFile(hasSmsDelivery)) { - for (int i = 0; i < getListSize(hasSmsDelivery); i++) { - map.put("has_sms_delivery[" + i + "]", getFromList(hasSmsDelivery, i)); - } - } else { - map.put( - "has_sms_delivery", - JSON.getDefault().getMapper().writeValueAsString(hasSmsDelivery)); - } - } - if (smsPhoneNumber != null) { - if (isFileTypeOrListOfFiles(smsPhoneNumber)) { - fileTypeFound = true; - } - - if (smsPhoneNumber.getClass().equals(java.io.File.class) - || smsPhoneNumber.getClass().equals(Integer.class) - || smsPhoneNumber.getClass().equals(String.class) - || smsPhoneNumber.getClass().isEnum()) { - map.put("sms_phone_number", smsPhoneNumber); - } else if (isListOfFile(smsPhoneNumber)) { - for (int i = 0; i < getListSize(smsPhoneNumber); i++) { - map.put("sms_phone_number[" + i + "]", getFromList(smsPhoneNumber, i)); - } - } else { - map.put( - "sms_phone_number", - JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumber)); - } - } - if (reassignedBy != null) { - if (isFileTypeOrListOfFiles(reassignedBy)) { - fileTypeFound = true; - } - - if (reassignedBy.getClass().equals(java.io.File.class) - || reassignedBy.getClass().equals(Integer.class) - || reassignedBy.getClass().equals(String.class) - || reassignedBy.getClass().isEnum()) { - map.put("reassigned_by", reassignedBy); - } else if (isListOfFile(reassignedBy)) { - for (int i = 0; i < getListSize(reassignedBy); i++) { - map.put("reassigned_by[" + i + "]", getFromList(reassignedBy, i)); - } - } else { - map.put( - "reassigned_by", - JSON.getDefault().getMapper().writeValueAsString(reassignedBy)); - } - } - if (reassignmentReason != null) { - if (isFileTypeOrListOfFiles(reassignmentReason)) { - fileTypeFound = true; - } - - if (reassignmentReason.getClass().equals(java.io.File.class) - || reassignmentReason.getClass().equals(Integer.class) - || reassignmentReason.getClass().equals(String.class) - || reassignmentReason.getClass().isEnum()) { - map.put("reassignment_reason", reassignmentReason); - } else if (isListOfFile(reassignmentReason)) { - for (int i = 0; i < getListSize(reassignmentReason); i++) { - map.put( - "reassignment_reason[" + i + "]", - getFromList(reassignmentReason, i)); - } - } else { - map.put( - "reassignment_reason", - JSON.getDefault().getMapper().writeValueAsString(reassignmentReason)); - } - } - if (reassignedFrom != null) { - if (isFileTypeOrListOfFiles(reassignedFrom)) { - fileTypeFound = true; - } - - if (reassignedFrom.getClass().equals(java.io.File.class) - || reassignedFrom.getClass().equals(Integer.class) - || reassignedFrom.getClass().equals(String.class) - || reassignedFrom.getClass().isEnum()) { - map.put("reassigned_from", reassignedFrom); - } else if (isListOfFile(reassignedFrom)) { - for (int i = 0; i < getListSize(reassignedFrom); i++) { - map.put("reassigned_from[" + i + "]", getFromList(reassignedFrom, i)); - } - } else { - map.put( - "reassigned_from", - JSON.getDefault().getMapper().writeValueAsString(reassignedFrom)); - } - } - if (error != null) { - if (isFileTypeOrListOfFiles(error)) { - fileTypeFound = true; - } - - if (error.getClass().equals(java.io.File.class) - || error.getClass().equals(Integer.class) - || error.getClass().equals(String.class) - || error.getClass().isEnum()) { - map.put("error", error); - } else if (isListOfFile(error)) { - for (int i = 0; i < getListSize(error); i++) { - map.put("error[" + i + "]", getFromList(error, i)); - } - } else { - map.put("error", JSON.getDefault().getMapper().writeValueAsString(error)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java index b12da8906..8fcafff1c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java @@ -10,1621 +10,1603 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubAttachment; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubFieldOptions; +import com.dropbox.sign.model.SubFormFieldGroup; +import com.dropbox.sign.model.SubFormFieldRule; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.model.SubSignatureRequestGroupedSigners; +import com.dropbox.sign.model.SubSignatureRequestSigner; +import com.dropbox.sign.model.SubSigningOptions; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** SignatureRequestSendRequest */ +import com.dropbox.sign.ApiException; +/** + * SignatureRequestSendRequest + */ @JsonPropertyOrder({ - SignatureRequestSendRequest.JSON_PROPERTY_FILES, - SignatureRequestSendRequest.JSON_PROPERTY_FILE_URLS, - SignatureRequestSendRequest.JSON_PROPERTY_SIGNERS, - SignatureRequestSendRequest.JSON_PROPERTY_GROUPED_SIGNERS, - SignatureRequestSendRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestSendRequest.JSON_PROPERTY_ALLOW_REASSIGN, - SignatureRequestSendRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, - SignatureRequestSendRequest.JSON_PROPERTY_ATTACHMENTS, - SignatureRequestSendRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - SignatureRequestSendRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestSendRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestSendRequest.JSON_PROPERTY_FIELD_OPTIONS, - SignatureRequestSendRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - SignatureRequestSendRequest.JSON_PROPERTY_FORM_FIELD_RULES, - SignatureRequestSendRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - SignatureRequestSendRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, - SignatureRequestSendRequest.JSON_PROPERTY_IS_QUALIFIED_SIGNATURE, - SignatureRequestSendRequest.JSON_PROPERTY_IS_EID, - SignatureRequestSendRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestSendRequest.JSON_PROPERTY_METADATA, - SignatureRequestSendRequest.JSON_PROPERTY_SIGNING_OPTIONS, - SignatureRequestSendRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - SignatureRequestSendRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestSendRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestSendRequest.JSON_PROPERTY_TITLE, - SignatureRequestSendRequest.JSON_PROPERTY_USE_TEXT_TAGS, - SignatureRequestSendRequest.JSON_PROPERTY_EXPIRES_AT + SignatureRequestSendRequest.JSON_PROPERTY_FILES, + SignatureRequestSendRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestSendRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestSendRequest.JSON_PROPERTY_GROUPED_SIGNERS, + SignatureRequestSendRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestSendRequest.JSON_PROPERTY_ALLOW_REASSIGN, + SignatureRequestSendRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, + SignatureRequestSendRequest.JSON_PROPERTY_ATTACHMENTS, + SignatureRequestSendRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + SignatureRequestSendRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestSendRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestSendRequest.JSON_PROPERTY_FIELD_OPTIONS, + SignatureRequestSendRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + SignatureRequestSendRequest.JSON_PROPERTY_FORM_FIELD_RULES, + SignatureRequestSendRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + SignatureRequestSendRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + SignatureRequestSendRequest.JSON_PROPERTY_IS_QUALIFIED_SIGNATURE, + SignatureRequestSendRequest.JSON_PROPERTY_IS_EID, + SignatureRequestSendRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestSendRequest.JSON_PROPERTY_METADATA, + SignatureRequestSendRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestSendRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestSendRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestSendRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestSendRequest.JSON_PROPERTY_TITLE, + SignatureRequestSendRequest.JSON_PROPERTY_USE_TEXT_TAGS, + SignatureRequestSendRequest.JSON_PROPERTY_EXPIRES_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestSendRequest { - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; - - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; - - public static final String JSON_PROPERTY_SIGNERS = "signers"; - @javax.annotation.Nullable private List signers = null; - - public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; - - @javax.annotation.Nullable private List groupedSigners = null; - - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; - - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - @javax.annotation.Nullable private Boolean allowReassign = false; - - public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; - @javax.annotation.Nullable private Boolean allowFormView = false; - - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - @javax.annotation.Nullable private List attachments = null; - - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - @javax.annotation.Nullable private List ccEmailAddresses = null; - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nullable private String clientId; - - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - @javax.annotation.Nullable private SubFieldOptions fieldOptions; - - public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - @javax.annotation.Nullable private List formFieldGroups = null; - - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - @javax.annotation.Nullable private List formFieldRules = null; - - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - - @javax.annotation.Nullable private List formFieldsPerDocument = null; - - public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; - @javax.annotation.Nullable private Boolean hideTextTags = false; - - public static final String JSON_PROPERTY_IS_QUALIFIED_SIGNATURE = "is_qualified_signature"; - @Deprecated @javax.annotation.Nullable private Boolean isQualifiedSignature = false; - - public static final String JSON_PROPERTY_IS_EID = "is_eid"; - @javax.annotation.Nullable private Boolean isEid = false; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - @javax.annotation.Nullable private SubSigningOptions signingOptions; + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nullable + private List signers = null; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; + public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; + @javax.annotation.Nullable + private List groupedSigners = null; + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + @javax.annotation.Nullable + private Boolean allowReassign = false; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @javax.annotation.Nullable + private Boolean allowFormView = false; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + @javax.annotation.Nullable + private List attachments = null; + + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + @javax.annotation.Nullable + private List ccEmailAddresses = null; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + @javax.annotation.Nullable + private SubFieldOptions fieldOptions; + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + @javax.annotation.Nullable + private List formFieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + @javax.annotation.Nullable + private List formFieldRules = null; + + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + @javax.annotation.Nullable + private List formFieldsPerDocument = null; + + public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; + @javax.annotation.Nullable + private Boolean hideTextTags = false; + + public static final String JSON_PROPERTY_IS_QUALIFIED_SIGNATURE = "is_qualified_signature"; + @Deprecated + @javax.annotation.Nullable + private Boolean isQualifiedSignature = false; + + public static final String JSON_PROPERTY_IS_EID = "is_eid"; + @javax.annotation.Nullable + private Boolean isEid = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + @javax.annotation.Nullable + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + @javax.annotation.Nullable + private Boolean useTextTags = false; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public SignatureRequestSendRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestSendRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestSendRequest.class); + } + + static public SignatureRequestSendRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestSendRequest.class + ); + } + + public SignatureRequestSendRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public SignatureRequestSendRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public SignatureRequestSendRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestSendRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public SignatureRequestSendRequest signers(@javax.annotation.Nullable List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestSendRequest addSignersItem(SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * @return signers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(@javax.annotation.Nullable List signers) { + this.signers = signers; + } + + + public SignatureRequestSendRequest groupedSigners(@javax.annotation.Nullable List groupedSigners) { + this.groupedSigners = groupedSigners; + return this; + } + + public SignatureRequestSendRequest addGroupedSignersItem(SubSignatureRequestGroupedSigners groupedSignersItem) { + if (this.groupedSigners == null) { + this.groupedSigners = new ArrayList<>(); + } + this.groupedSigners.add(groupedSignersItem); + return this; + } + + /** + * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. + * @return groupedSigners + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; - @javax.annotation.Nullable private Boolean useTextTags = false; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public SignatureRequestSendRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestSendRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestSendRequest.class); - } - - public static SignatureRequestSendRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestSendRequest.class); - } - - public SignatureRequestSendRequest files(@javax.annotation.Nullable List files) { - this.files = files; - return this; + public List getGroupedSigners() { + return groupedSigners; + } + + + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupedSigners(@javax.annotation.Nullable List groupedSigners) { + this.groupedSigners = groupedSigners; + } + + + public SignatureRequestSendRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestSendRequest allowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } + + /** + * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + * @return allowReassign + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowReassign() { + return allowReassign; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + } + + + public SignatureRequestSendRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. + * @return allowFormView + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + public SignatureRequestSendRequest attachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + return this; + } + + public SignatureRequestSendRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * A list describing the attachments + * @return attachments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + } + + + public SignatureRequestSendRequest ccEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; + } + + public SignatureRequestSendRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } + + /** + * The email addresses that should be CCed. + * @return ccEmailAddresses + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } + + + public SignatureRequestSendRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestSendRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestSendRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } - public SignatureRequestSendRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - /** - * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } + public SignatureRequestSendRequest fieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * @return fieldOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } + + + public SignatureRequestSendRequest formFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } + public SignatureRequestSendRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); + } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } + + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * @return formFieldGroups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldGroups() { + return formFieldGroups; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + + public SignatureRequestSendRequest formFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } + + public SignatureRequestSendRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); + } + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * @return formFieldRules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldRules() { + return formFieldRules; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + + public SignatureRequestSendRequest formFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public SignatureRequestSendRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; + } + + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * @return formFieldsPerDocument + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + + public SignatureRequestSendRequest hideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; + } + + /** + * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. + * @return hideTextTags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHideTextTags() { + return hideTextTags; + } + + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + } + + + @Deprecated + public SignatureRequestSendRequest isQualifiedSignature(@javax.annotation.Nullable Boolean isQualifiedSignature) { + this.isQualifiedSignature = isQualifiedSignature; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br> **NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. + * @return isQualifiedSignature + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsQualifiedSignature() { + return isQualifiedSignature; + } + + + @Deprecated + @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsQualifiedSignature(@javax.annotation.Nullable Boolean isQualifiedSignature) { + this.isQualifiedSignature = isQualifiedSignature; + } + + + public SignatureRequestSendRequest isEid(@javax.annotation.Nullable Boolean isEid) { + this.isEid = isEid; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + * @return isEid + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsEid() { + return isEid; + } + + + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEid(@javax.annotation.Nullable Boolean isEid) { + this.isEid = isEid; + } + + + public SignatureRequestSendRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public SignatureRequestSendRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestSendRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public SignatureRequestSendRequest signingOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * @return signingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public SignatureRequestSendRequest signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } - public SignatureRequestSendRequest fileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; - } + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public SignatureRequestSendRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } - public SignatureRequestSendRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public SignatureRequestSendRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestSendRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public SignatureRequestSendRequest useTextTags(@javax.annotation.Nullable Boolean useTextTags) { + this.useTextTags = useTextTags; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. + * @return useTextTags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseTextTags() { + return useTextTags; + } + + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(@javax.annotation.Nullable Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + + public SignatureRequestSendRequest expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this SignatureRequestSendRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestSendRequest signatureRequestSendRequest = (SignatureRequestSendRequest) o; + return Objects.equals(this.files, signatureRequestSendRequest.files) && + Objects.equals(this.fileUrls, signatureRequestSendRequest.fileUrls) && + Objects.equals(this.signers, signatureRequestSendRequest.signers) && + Objects.equals(this.groupedSigners, signatureRequestSendRequest.groupedSigners) && + Objects.equals(this.allowDecline, signatureRequestSendRequest.allowDecline) && + Objects.equals(this.allowReassign, signatureRequestSendRequest.allowReassign) && + Objects.equals(this.allowFormView, signatureRequestSendRequest.allowFormView) && + Objects.equals(this.attachments, signatureRequestSendRequest.attachments) && + Objects.equals(this.ccEmailAddresses, signatureRequestSendRequest.ccEmailAddresses) && + Objects.equals(this.clientId, signatureRequestSendRequest.clientId) && + Objects.equals(this.customFields, signatureRequestSendRequest.customFields) && + Objects.equals(this.fieldOptions, signatureRequestSendRequest.fieldOptions) && + Objects.equals(this.formFieldGroups, signatureRequestSendRequest.formFieldGroups) && + Objects.equals(this.formFieldRules, signatureRequestSendRequest.formFieldRules) && + Objects.equals(this.formFieldsPerDocument, signatureRequestSendRequest.formFieldsPerDocument) && + Objects.equals(this.hideTextTags, signatureRequestSendRequest.hideTextTags) && + Objects.equals(this.isQualifiedSignature, signatureRequestSendRequest.isQualifiedSignature) && + Objects.equals(this.isEid, signatureRequestSendRequest.isEid) && + Objects.equals(this.message, signatureRequestSendRequest.message) && + Objects.equals(this.metadata, signatureRequestSendRequest.metadata) && + Objects.equals(this.signingOptions, signatureRequestSendRequest.signingOptions) && + Objects.equals(this.signingRedirectUrl, signatureRequestSendRequest.signingRedirectUrl) && + Objects.equals(this.subject, signatureRequestSendRequest.subject) && + Objects.equals(this.testMode, signatureRequestSendRequest.testMode) && + Objects.equals(this.title, signatureRequestSendRequest.title) && + Objects.equals(this.useTextTags, signatureRequestSendRequest.useTextTags) && + Objects.equals(this.expiresAt, signatureRequestSendRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(files, fileUrls, signers, groupedSigners, allowDecline, allowReassign, allowFormView, attachments, ccEmailAddresses, clientId, customFields, fieldOptions, formFieldGroups, formFieldRules, formFieldsPerDocument, hideTextTags, isQualifiedSignature, isEid, message, metadata, signingOptions, signingRedirectUrl, subject, testMode, title, useTextTags, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestSendRequest {\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" isQualifiedSignature: ").append(toIndentedString(isQualifiedSignature)).append("\n"); + sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - * This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - public SignatureRequestSendRequest signers( - @javax.annotation.Nullable List signers) { - this.signers = signers; - return this; - } - - public SignatureRequestSendRequest addSignersItem(SubSignatureRequestSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Signature Request. This endpoint requires either **signers** or - * **grouped_signers**, but not both. - * - * @return signers - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSigners() { - return signers; - } - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners(@javax.annotation.Nullable List signers) { - this.signers = signers; - } - - public SignatureRequestSendRequest groupedSigners( - @javax.annotation.Nullable List groupedSigners) { - this.groupedSigners = groupedSigners; - return this; - } - - public SignatureRequestSendRequest addGroupedSignersItem( - SubSignatureRequestGroupedSigners groupedSignersItem) { - if (this.groupedSigners == null) { - this.groupedSigners = new ArrayList<>(); + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); } - this.groupedSigners.add(groupedSignersItem); - return this; - } - - /** - * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or - * **grouped_signers**, but not both. - * - * @return groupedSigners - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getGroupedSigners() { - return groupedSigners; - } - - @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroupedSigners( - @javax.annotation.Nullable List groupedSigners) { - this.groupedSigners = groupedSigners; - } - - public SignatureRequestSendRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; } - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - public SignatureRequestSendRequest allowReassign( - @javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - return this; - } - - /** - * Allows signers to reassign their signature requests to other signers if set to - * `true`. Defaults to `false`. **NOTE:** Only available for Premium plan - * and higher. - * - * @return allowReassign - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowReassign() { - return allowReassign; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - } - - public SignatureRequestSendRequest allowFormView( - @javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - return this; - } - - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to - * `false`. - * - * @return allowFormView - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowFormView() { - return allowFormView; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - } - - public SignatureRequestSendRequest attachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; - return this; - } - - public SignatureRequestSendRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * - * @return attachments - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAttachments() { - return attachments; - } - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(@javax.annotation.Nullable List attachments) { - this.attachments = attachments; - } - - public SignatureRequestSendRequest ccEmailAddresses( - @javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public SignatureRequestSendRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } } - this.ccEmailAddresses.add(ccEmailAddressesItem); - return this; - } - - /** - * The email addresses that should be CCed. - * - * @return ccEmailAddresses - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } - - public SignatureRequestSendRequest clientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - return this; - } - - /** - * The client id of the API App you want to associate with this request. Used to apply the - * branding and callback url defined for the app. - * - * @return clientId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - } - - public SignatureRequestSendRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestSendRequest addCustomFieldsItem(SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); } - this.customFields.add(customFieldsItem); - return this; } - - /** - * When used together with merge fields, `custom_fields` allows users to add - * pre-filled data to their signature requests. Pre-filled data can be used with - * \"send-once\" signature requests by adding merge fields with - * `form_fields_per_document` or [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values - * back with `custom_fields` together in one API call. For using pre-filled on - * repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or - * by calling - * [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and - * then passing `custom_fields` on subsequent signature requests referencing that - * template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public SignatureRequestSendRequest fieldOptions( - @javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * - * @return fieldOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - public SignatureRequestSendRequest formFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } - - public SignatureRequestSendRequest addFormFieldGroupsItem( - SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; } - this.formFieldGroups.add(formFieldGroupsItem); - return this; - } - - /** - * Group information for fields defined in `form_fields_per_document`. String-indexed - * JSON array with `group_label` and `requirement` keys. - * `form_fields_per_document` must contain fields referencing a group defined in - * `form_field_groups`. - * - * @return formFieldGroups - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldGroups() { - return formFieldGroups; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - public SignatureRequestSendRequest formFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - public SignatureRequestSendRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * - * @return formFieldRules - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldRules() { - return formFieldRules; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - public SignatureRequestSendRequest formFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; - } - - public SignatureRequestSendRequest addFormFieldsPerDocumentItem( - SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); } - this.formFieldsPerDocument.add(formFieldsPerDocumentItem); - return this; - } - - /** - * The fields that should appear on the document, expressed as an array of objects. (For more - * details you can read about it here: [Using Form Fields per - * Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, - * **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and - * optional parameters. Check out the list of [additional - * parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text - * Field use `SubFormFieldsPerDocumentText` * Dropdown Field use - * `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use - * `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use - * `SubFormFieldsPerDocumentCheckbox` * Radio Field use - * `SubFormFieldsPerDocumentRadio` * Signature Field use - * `SubFormFieldsPerDocumentSignature` * Date Signed Field use - * `SubFormFieldsPerDocumentDateSigned` * Initials Field use - * `SubFormFieldsPerDocumentInitials` * Text Merge Field use - * `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use - * `SubFormFieldsPerDocumentCheckboxMerge` - * - * @return formFieldsPerDocument - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } - - public SignatureRequestSendRequest hideTextTags( - @javax.annotation.Nullable Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - return this; - } - - /** - * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way - * can cause unwanted clipping. We recommend leaving this setting on `false` and - * instead hiding your text tags using white text or a similar approach. See the [Text Tags - * Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more - * information. - * - * @return hideTextTags - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHideTextTags() { - return hideTextTags; - } - - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { - this.hideTextTags = hideTextTags; } - - @Deprecated - public SignatureRequestSendRequest isQualifiedSignature( - @javax.annotation.Nullable Boolean isQualifiedSignature) { - this.isQualifiedSignature = isQualifiedSignature; - return this; - } - - /** - * Send with a value of `true` if you wish to enable [Qualified Electronic - * Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which - * requires a face-to-face call to verify the signer's identity.<br> **NOTE:** QES is - * only available on the Premium API plan as an add-on purchase. Cannot be used in - * `test_mode`. Only works on requests with one signer. - * - * @return isQualifiedSignature - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsQualifiedSignature() { - return isQualifiedSignature; - } - - @Deprecated - @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsQualifiedSignature(@javax.annotation.Nullable Boolean isQualifiedSignature) { - this.isQualifiedSignature = isQualifiedSignature; - } - - public SignatureRequestSendRequest isEid(@javax.annotation.Nullable Boolean isEid) { - this.isEid = isEid; - return this; - } - - /** - * Send with a value of `true` if you wish to enable [electronic identification - * (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify - * their identity with an eID provider to sign a document.<br> **NOTE:** eID is only - * available on the Premium API plan. Cannot be used in `test_mode`. Only works on - * requests with one signer. - * - * @return isEid - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_EID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsEid() { - return isEid; - } - - @JsonProperty(JSON_PROPERTY_IS_EID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsEid(@javax.annotation.Nullable Boolean isEid) { - this.isEid = isEid; - } - - public SignatureRequestSendRequest message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public SignatureRequestSendRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestSendRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (groupedSigners != null) { + if (isFileTypeOrListOfFiles(groupedSigners)) { + fileTypeFound = true; } - this.metadata.put(key, metadataItem); - return this; - } - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; + if (groupedSigners.getClass().equals(java.io.File.class) || + groupedSigners.getClass().equals(Integer.class) || + groupedSigners.getClass().equals(String.class) || + groupedSigners.getClass().isEnum()) { + map.put("grouped_signers", groupedSigners); + } else if (isListOfFile(groupedSigners)) { + for(int i = 0; i< getListSize(groupedSigners); i++) { + map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); + } + } + else { + map.put("grouped_signers", JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); + } } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } - public SignatureRequestSendRequest signingOptions( - @javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } - /** - * Get signingOptions - * - * @return signingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubSigningOptions getSigningOptions() { - return signingOptions; + if (allowReassign.getClass().equals(java.io.File.class) || + allowReassign.getClass().equals(Integer.class) || + allowReassign.getClass().equals(String.class) || + allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for(int i = 0; i< getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } + else { + map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } - public SignatureRequestSendRequest signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + } } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } - /** - * The URL you want signers redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; + if (ccEmailAddresses.getClass().equals(java.io.File.class) || + ccEmailAddresses.getClass().equals(Integer.class) || + ccEmailAddresses.getClass().equals(String.class) || + ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for(int i = 0; i< getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } + else { + map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - public SignatureRequestSendRequest subject(@javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (fieldOptions.getClass().equals(java.io.File.class) || + fieldOptions.getClass().equals(Integer.class) || + fieldOptions.getClass().equals(String.class) || + fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for(int i = 0; i< getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } + else { + map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (formFieldGroups.getClass().equals(java.io.File.class) || + formFieldGroups.getClass().equals(Integer.class) || + formFieldGroups.getClass().equals(String.class) || + formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for(int i = 0; i< getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } + else { + map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } - public SignatureRequestSendRequest testMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (formFieldRules.getClass().equals(java.io.File.class) || + formFieldRules.getClass().equals(Integer.class) || + formFieldRules.getClass().equals(String.class) || + formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for(int i = 0; i< getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } + else { + map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request will not be legally binding if set to - * `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (formFieldsPerDocument.getClass().equals(java.io.File.class) || + formFieldsPerDocument.getClass().equals(Integer.class) || + formFieldsPerDocument.getClass().equals(String.class) || + formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { + map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); + } + } + else { + map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); + } } + if (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (hideTextTags.getClass().equals(java.io.File.class) || + hideTextTags.getClass().equals(Integer.class) || + hideTextTags.getClass().equals(String.class) || + hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for(int i = 0; i< getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } + else { + map.put("hide_text_tags", JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } } + if (isQualifiedSignature != null) { + if (isFileTypeOrListOfFiles(isQualifiedSignature)) { + fileTypeFound = true; + } - public SignatureRequestSendRequest title(@javax.annotation.Nullable String title) { - this.title = title; - return this; + if (isQualifiedSignature.getClass().equals(java.io.File.class) || + isQualifiedSignature.getClass().equals(Integer.class) || + isQualifiedSignature.getClass().equals(String.class) || + isQualifiedSignature.getClass().isEnum()) { + map.put("is_qualified_signature", isQualifiedSignature); + } else if (isListOfFile(isQualifiedSignature)) { + for(int i = 0; i< getListSize(isQualifiedSignature); i++) { + map.put("is_qualified_signature[" + i + "]", getFromList(isQualifiedSignature, i)); + } + } + else { + map.put("is_qualified_signature", JSON.getDefault().getMapper().writeValueAsString(isQualifiedSignature)); + } } + if (isEid != null) { + if (isFileTypeOrListOfFiles(isEid)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (isEid.getClass().equals(java.io.File.class) || + isEid.getClass().equals(Integer.class) || + isEid.getClass().equals(String.class) || + isEid.getClass().isEnum()) { + map.put("is_eid", isEid); + } else if (isListOfFile(isEid)) { + for(int i = 0; i< getListSize(isEid); i++) { + map.put("is_eid[" + i + "]", getFromList(isEid, i)); + } + } + else { + map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - public SignatureRequestSendRequest useTextTags(@javax.annotation.Nullable Boolean useTextTags) { - this.useTextTags = useTextTags; - return this; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } - /** - * Send with a value of `true` if you wish to enable [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your - * document. Defaults to disabled, or `false`. - * - * @return useTextTags - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getUseTextTags() { - return useTextTags; + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUseTextTags(@javax.annotation.Nullable Boolean useTextTags) { - this.useTextTags = useTextTags; + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - public SignatureRequestSendRequest expiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - /** - * When the signature request will expire. Unsigned signatures will be moved to the expired - * status, and no longer signable. See [Signature Request Expiration - * Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestSendRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestSendRequest signatureRequestSendRequest = (SignatureRequestSendRequest) o; - return Objects.equals(this.files, signatureRequestSendRequest.files) - && Objects.equals(this.fileUrls, signatureRequestSendRequest.fileUrls) - && Objects.equals(this.signers, signatureRequestSendRequest.signers) - && Objects.equals(this.groupedSigners, signatureRequestSendRequest.groupedSigners) - && Objects.equals(this.allowDecline, signatureRequestSendRequest.allowDecline) - && Objects.equals(this.allowReassign, signatureRequestSendRequest.allowReassign) - && Objects.equals(this.allowFormView, signatureRequestSendRequest.allowFormView) - && Objects.equals(this.attachments, signatureRequestSendRequest.attachments) - && Objects.equals( - this.ccEmailAddresses, signatureRequestSendRequest.ccEmailAddresses) - && Objects.equals(this.clientId, signatureRequestSendRequest.clientId) - && Objects.equals(this.customFields, signatureRequestSendRequest.customFields) - && Objects.equals(this.fieldOptions, signatureRequestSendRequest.fieldOptions) - && Objects.equals(this.formFieldGroups, signatureRequestSendRequest.formFieldGroups) - && Objects.equals(this.formFieldRules, signatureRequestSendRequest.formFieldRules) - && Objects.equals( - this.formFieldsPerDocument, - signatureRequestSendRequest.formFieldsPerDocument) - && Objects.equals(this.hideTextTags, signatureRequestSendRequest.hideTextTags) - && Objects.equals( - this.isQualifiedSignature, signatureRequestSendRequest.isQualifiedSignature) - && Objects.equals(this.isEid, signatureRequestSendRequest.isEid) - && Objects.equals(this.message, signatureRequestSendRequest.message) - && Objects.equals(this.metadata, signatureRequestSendRequest.metadata) - && Objects.equals(this.signingOptions, signatureRequestSendRequest.signingOptions) - && Objects.equals( - this.signingRedirectUrl, signatureRequestSendRequest.signingRedirectUrl) - && Objects.equals(this.subject, signatureRequestSendRequest.subject) - && Objects.equals(this.testMode, signatureRequestSendRequest.testMode) - && Objects.equals(this.title, signatureRequestSendRequest.title) - && Objects.equals(this.useTextTags, signatureRequestSendRequest.useTextTags) - && Objects.equals(this.expiresAt, signatureRequestSendRequest.expiresAt); + if (useTextTags.getClass().equals(java.io.File.class) || + useTextTags.getClass().equals(Integer.class) || + useTextTags.getClass().equals(String.class) || + useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for(int i = 0; i< getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } + else { + map.put("use_text_tags", JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - files, - fileUrls, - signers, - groupedSigners, - allowDecline, - allowReassign, - allowFormView, - attachments, - ccEmailAddresses, - clientId, - customFields, - fieldOptions, - formFieldGroups, - formFieldRules, - formFieldsPerDocument, - hideTextTags, - isQualifiedSignature, - isEid, - message, - metadata, - signingOptions, - signingRedirectUrl, - subject, - testMode, - title, - useTextTags, - expiresAt); + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestSendRequest {\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" formFieldsPerDocument: ") - .append(toIndentedString(formFieldsPerDocument)) - .append("\n"); - sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); - sb.append(" isQualifiedSignature: ") - .append(toIndentedString(isQualifiedSignature)) - .append("\n"); - sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - if (groupedSigners != null) { - if (isFileTypeOrListOfFiles(groupedSigners)) { - fileTypeFound = true; - } - - if (groupedSigners.getClass().equals(java.io.File.class) - || groupedSigners.getClass().equals(Integer.class) - || groupedSigners.getClass().equals(String.class) - || groupedSigners.getClass().isEnum()) { - map.put("grouped_signers", groupedSigners); - } else if (isListOfFile(groupedSigners)) { - for (int i = 0; i < getListSize(groupedSigners); i++) { - map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); - } - } else { - map.put( - "grouped_signers", - JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - - if (allowReassign.getClass().equals(java.io.File.class) - || allowReassign.getClass().equals(Integer.class) - || allowReassign.getClass().equals(String.class) - || allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for (int i = 0; i < getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } else { - map.put( - "allow_reassign", - JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } - } - if (allowFormView != null) { - if (isFileTypeOrListOfFiles(allowFormView)) { - fileTypeFound = true; - } - - if (allowFormView.getClass().equals(java.io.File.class) - || allowFormView.getClass().equals(Integer.class) - || allowFormView.getClass().equals(String.class) - || allowFormView.getClass().isEnum()) { - map.put("allow_form_view", allowFormView); - } else if (isListOfFile(allowFormView)) { - for (int i = 0; i < getListSize(allowFormView); i++) { - map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); - } - } else { - map.put( - "allow_form_view", - JSON.getDefault().getMapper().writeValueAsString(allowFormView)); - } - } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - - if (attachments.getClass().equals(java.io.File.class) - || attachments.getClass().equals(Integer.class) - || attachments.getClass().equals(String.class) - || attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for (int i = 0; i < getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } else { - map.put( - "attachments", - JSON.getDefault().getMapper().writeValueAsString(attachments)); - } - } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - - if (ccEmailAddresses.getClass().equals(java.io.File.class) - || ccEmailAddresses.getClass().equals(Integer.class) - || ccEmailAddresses.getClass().equals(String.class) - || ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for (int i = 0; i < getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } else { - map.put( - "cc_email_addresses", - JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - - if (fieldOptions.getClass().equals(java.io.File.class) - || fieldOptions.getClass().equals(Integer.class) - || fieldOptions.getClass().equals(String.class) - || fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for (int i = 0; i < getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } else { - map.put( - "field_options", - JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } - } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - - if (formFieldGroups.getClass().equals(java.io.File.class) - || formFieldGroups.getClass().equals(Integer.class) - || formFieldGroups.getClass().equals(String.class) - || formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for (int i = 0; i < getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } else { - map.put( - "form_field_groups", - JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } - } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - - if (formFieldRules.getClass().equals(java.io.File.class) - || formFieldRules.getClass().equals(Integer.class) - || formFieldRules.getClass().equals(String.class) - || formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for (int i = 0; i < getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } else { - map.put( - "form_field_rules", - JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } - } - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - - if (formFieldsPerDocument.getClass().equals(java.io.File.class) - || formFieldsPerDocument.getClass().equals(Integer.class) - || formFieldsPerDocument.getClass().equals(String.class) - || formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { - map.put( - "form_fields_per_document[" + i + "]", - getFromList(formFieldsPerDocument, i)); - } - } else { - map.put( - "form_fields_per_document", - JSON.getDefault() - .getMapper() - .writeValueAsString(formFieldsPerDocument)); - } - } - if (hideTextTags != null) { - if (isFileTypeOrListOfFiles(hideTextTags)) { - fileTypeFound = true; - } - - if (hideTextTags.getClass().equals(java.io.File.class) - || hideTextTags.getClass().equals(Integer.class) - || hideTextTags.getClass().equals(String.class) - || hideTextTags.getClass().isEnum()) { - map.put("hide_text_tags", hideTextTags); - } else if (isListOfFile(hideTextTags)) { - for (int i = 0; i < getListSize(hideTextTags); i++) { - map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); - } - } else { - map.put( - "hide_text_tags", - JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); - } - } - if (isQualifiedSignature != null) { - if (isFileTypeOrListOfFiles(isQualifiedSignature)) { - fileTypeFound = true; - } - - if (isQualifiedSignature.getClass().equals(java.io.File.class) - || isQualifiedSignature.getClass().equals(Integer.class) - || isQualifiedSignature.getClass().equals(String.class) - || isQualifiedSignature.getClass().isEnum()) { - map.put("is_qualified_signature", isQualifiedSignature); - } else if (isListOfFile(isQualifiedSignature)) { - for (int i = 0; i < getListSize(isQualifiedSignature); i++) { - map.put( - "is_qualified_signature[" + i + "]", - getFromList(isQualifiedSignature, i)); - } - } else { - map.put( - "is_qualified_signature", - JSON.getDefault().getMapper().writeValueAsString(isQualifiedSignature)); - } - } - if (isEid != null) { - if (isFileTypeOrListOfFiles(isEid)) { - fileTypeFound = true; - } - - if (isEid.getClass().equals(java.io.File.class) - || isEid.getClass().equals(Integer.class) - || isEid.getClass().equals(String.class) - || isEid.getClass().isEnum()) { - map.put("is_eid", isEid); - } else if (isListOfFile(isEid)) { - for (int i = 0; i < getListSize(isEid); i++) { - map.put("is_eid[" + i + "]", getFromList(isEid, i)); - } - } else { - map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - - if (signingOptions.getClass().equals(java.io.File.class) - || signingOptions.getClass().equals(Integer.class) - || signingOptions.getClass().equals(String.class) - || signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for (int i = 0; i < getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } else { - map.put( - "signing_options", - JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (useTextTags != null) { - if (isFileTypeOrListOfFiles(useTextTags)) { - fileTypeFound = true; - } - - if (useTextTags.getClass().equals(java.io.File.class) - || useTextTags.getClass().equals(Integer.class) - || useTextTags.getClass().equals(String.class) - || useTextTags.getClass().isEnum()) { - map.put("use_text_tags", useTextTags); - } else if (isListOfFile(useTextTags)) { - for (int i = 0; i < getListSize(useTextTags); i++) { - map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); - } - } else { - map.put( - "use_text_tags", - JSON.getDefault().getMapper().writeValueAsString(useTextTags)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java index eba4b1488..b696589d4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java @@ -10,1052 +10,1056 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubCC; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubSignatureRequestTemplateSigner; +import com.dropbox.sign.model.SubSigningOptions; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** */ + +import com.dropbox.sign.ApiException; +/** + * + */ @JsonPropertyOrder({ - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNERS, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_CCS, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_FILES, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_FILE_URLS, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_IS_QUALIFIED_SIGNATURE, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_IS_EID, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_METADATA, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_FILES, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_IS_QUALIFIED_SIGNATURE, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_IS_EID, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TITLE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestSendWithTemplateRequest { - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - @javax.annotation.Nonnull private List templateIds = new ArrayList<>(); - - public static final String JSON_PROPERTY_SIGNERS = "signers"; - - @javax.annotation.Nonnull - private List signers = new ArrayList<>(); - - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; - - public static final String JSON_PROPERTY_CCS = "ccs"; - @javax.annotation.Nullable private List ccs = null; - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nullable private String clientId; - - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; - - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; - - public static final String JSON_PROPERTY_IS_QUALIFIED_SIGNATURE = "is_qualified_signature"; - @Deprecated @javax.annotation.Nullable private Boolean isQualifiedSignature = false; - - public static final String JSON_PROPERTY_IS_EID = "is_eid"; - @javax.annotation.Nullable private Boolean isEid = false; + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + @javax.annotation.Nonnull + private List templateIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nonnull + private List signers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_CCS = "ccs"; + @javax.annotation.Nullable + private List ccs = null; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_IS_QUALIFIED_SIGNATURE = "is_qualified_signature"; + @Deprecated + @javax.annotation.Nullable + private Boolean isQualifiedSignature = false; + + public static final String JSON_PROPERTY_IS_EID = "is_eid"; + @javax.annotation.Nullable + private Boolean isEid = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + @javax.annotation.Nullable + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public SignatureRequestSendWithTemplateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestSendWithTemplateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestSendWithTemplateRequest.class); + } + + static public SignatureRequestSendWithTemplateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestSendWithTemplateRequest.class + ); + } + + public SignatureRequestSendWithTemplateRequest templateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + return this; + } + + public SignatureRequestSendWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. + * @return templateIds + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTemplateIds() { + return templateIds; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + } + + + public SignatureRequestSendWithTemplateRequest signers(@javax.annotation.Nonnull List signers) { + this.signers = signers; + return this; + } + + public SignatureRequestSendWithTemplateRequest addSignersItem(SubSignatureRequestTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Templated-based Signature Request. + * @return signers + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigners(@javax.annotation.Nonnull List signers) { + this.signers = signers; + } + + + public SignatureRequestSendWithTemplateRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public SignatureRequestSendWithTemplateRequest ccs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + return this; + } + + public SignatureRequestSendWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); + } + this.ccs.add(ccsItem); + return this; + } + + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * @return ccs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcs() { + return ccs; + } + + + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + } + - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; + public SignatureRequestSendWithTemplateRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public SignatureRequestSendWithTemplateRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - @javax.annotation.Nullable private SubSigningOptions signingOptions; - - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public SignatureRequestSendWithTemplateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestSendWithTemplateRequest init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, SignatureRequestSendWithTemplateRequest.class); - } - - public static SignatureRequestSendWithTemplateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestSendWithTemplateRequest.class); - } - - public SignatureRequestSendWithTemplateRequest templateIds( - @javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - return this; - } - - public SignatureRequestSendWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); + public SignatureRequestSendWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array defining values and options for custom fields. Required when a custom field exists in the Template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + + + public SignatureRequestSendWithTemplateRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public SignatureRequestSendWithTemplateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public SignatureRequestSendWithTemplateRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public SignatureRequestSendWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + @Deprecated + public SignatureRequestSendWithTemplateRequest isQualifiedSignature(@javax.annotation.Nullable Boolean isQualifiedSignature) { + this.isQualifiedSignature = isQualifiedSignature; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br> **NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. + * @return isQualifiedSignature + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsQualifiedSignature() { + return isQualifiedSignature; + } + + + @Deprecated + @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsQualifiedSignature(@javax.annotation.Nullable Boolean isQualifiedSignature) { + this.isQualifiedSignature = isQualifiedSignature; + } + + + public SignatureRequestSendWithTemplateRequest isEid(@javax.annotation.Nullable Boolean isEid) { + this.isEid = isEid; + return this; + } + + /** + * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. + * @return isEid + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsEid() { + return isEid; + } + + + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEid(@javax.annotation.Nullable Boolean isEid) { + this.isEid = isEid; + } + + + public SignatureRequestSendWithTemplateRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public SignatureRequestSendWithTemplateRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestSendWithTemplateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public SignatureRequestSendWithTemplateRequest signingOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * @return signingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public SignatureRequestSendWithTemplateRequest signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public SignatureRequestSendWithTemplateRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public SignatureRequestSendWithTemplateRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public SignatureRequestSendWithTemplateRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + /** + * Return true if this SignatureRequestSendWithTemplateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest = (SignatureRequestSendWithTemplateRequest) o; + return Objects.equals(this.templateIds, signatureRequestSendWithTemplateRequest.templateIds) && + Objects.equals(this.signers, signatureRequestSendWithTemplateRequest.signers) && + Objects.equals(this.allowDecline, signatureRequestSendWithTemplateRequest.allowDecline) && + Objects.equals(this.ccs, signatureRequestSendWithTemplateRequest.ccs) && + Objects.equals(this.clientId, signatureRequestSendWithTemplateRequest.clientId) && + Objects.equals(this.customFields, signatureRequestSendWithTemplateRequest.customFields) && + Objects.equals(this.files, signatureRequestSendWithTemplateRequest.files) && + Objects.equals(this.fileUrls, signatureRequestSendWithTemplateRequest.fileUrls) && + Objects.equals(this.isQualifiedSignature, signatureRequestSendWithTemplateRequest.isQualifiedSignature) && + Objects.equals(this.isEid, signatureRequestSendWithTemplateRequest.isEid) && + Objects.equals(this.message, signatureRequestSendWithTemplateRequest.message) && + Objects.equals(this.metadata, signatureRequestSendWithTemplateRequest.metadata) && + Objects.equals(this.signingOptions, signatureRequestSendWithTemplateRequest.signingOptions) && + Objects.equals(this.signingRedirectUrl, signatureRequestSendWithTemplateRequest.signingRedirectUrl) && + Objects.equals(this.subject, signatureRequestSendWithTemplateRequest.subject) && + Objects.equals(this.testMode, signatureRequestSendWithTemplateRequest.testMode) && + Objects.equals(this.title, signatureRequestSendWithTemplateRequest.title); + } + + @Override + public int hashCode() { + return Objects.hash(templateIds, signers, allowDecline, ccs, clientId, customFields, files, fileUrls, isQualifiedSignature, isEid, message, metadata, signingOptions, signingRedirectUrl, subject, testMode, title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestSendWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" isQualifiedSignature: ").append(toIndentedString(isQualifiedSignature)).append("\n"); + sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; } - this.templateIds.add(templateIdsItem); - return this; - } - - /** - * Use `template_ids` to create a SignatureRequest from one or more templates, in the - * order in which the template will be used. - * - * @return templateIds - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getTemplateIds() { - return templateIds; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - } - - public SignatureRequestSendWithTemplateRequest signers( - @javax.annotation.Nonnull List signers) { - this.signers = signers; - return this; - } - public SignatureRequestSendWithTemplateRequest addSignersItem( - SubSignatureRequestTemplateSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + if (templateIds.getClass().equals(java.io.File.class) || + templateIds.getClass().equals(Integer.class) || + templateIds.getClass().equals(String.class) || + templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for(int i = 0; i< getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Templated-based Signature Request. - * - * @return signers - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getSigners() { - return signers; - } - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSigners( - @javax.annotation.Nonnull List signers) { - this.signers = signers; - } - - public SignatureRequestSendWithTemplateRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - public SignatureRequestSendWithTemplateRequest ccs(@javax.annotation.Nullable List ccs) { - this.ccs = ccs; - return this; - } - - public SignatureRequestSendWithTemplateRequest addCcsItem(SubCC ccsItem) { - if (this.ccs == null) { - this.ccs = new ArrayList<>(); + else { + map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); } - this.ccs.add(ccsItem); - return this; - } - - /** - * Add CC email recipients. Required when a CC role exists for the Template. - * - * @return ccs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcs() { - return ccs; - } - - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcs(@javax.annotation.Nullable List ccs) { - this.ccs = ccs; } - - public SignatureRequestSendWithTemplateRequest clientId( - @javax.annotation.Nullable String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Client id of the app to associate with the signature request. Used to apply the branding and - * callback url defined for the app. - * - * @return clientId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - } - - public SignatureRequestSendWithTemplateRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestSendWithTemplateRequest addCustomFieldsItem( - SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; } - this.customFields.add(customFieldsItem); - return this; - } - - /** - * An array defining values and options for custom fields. Required when a custom field exists - * in the Template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public SignatureRequestSendWithTemplateRequest files( - @javax.annotation.Nullable List files) { - this.files = files; - return this; - } - public SignatureRequestSendWithTemplateRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } } - this.files.add(filesItem); - return this; - } - - /** - * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } - - public SignatureRequestSendWithTemplateRequest fileUrls( - @javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public SignatureRequestSendWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - * This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - @Deprecated - public SignatureRequestSendWithTemplateRequest isQualifiedSignature( - @javax.annotation.Nullable Boolean isQualifiedSignature) { - this.isQualifiedSignature = isQualifiedSignature; - return this; - } - - /** - * Send with a value of `true` if you wish to enable [Qualified Electronic - * Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which - * requires a face-to-face call to verify the signer's identity.<br> **NOTE:** QES is - * only available on the Premium API plan as an add-on purchase. Cannot be used in - * `test_mode`. Only works on requests with one signer. - * - * @return isQualifiedSignature - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsQualifiedSignature() { - return isQualifiedSignature; - } - - @Deprecated - @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsQualifiedSignature(@javax.annotation.Nullable Boolean isQualifiedSignature) { - this.isQualifiedSignature = isQualifiedSignature; - } - - public SignatureRequestSendWithTemplateRequest isEid(@javax.annotation.Nullable Boolean isEid) { - this.isEid = isEid; - return this; - } - - /** - * Send with a value of `true` if you wish to enable [electronic identification - * (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify - * their identity with an eID provider to sign a document.<br> **NOTE:** eID is only - * available on the Premium API plan. Cannot be used in `test_mode`. Only works on - * requests with one signer. - * - * @return isEid - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_EID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsEid() { - return isEid; } - - @JsonProperty(JSON_PROPERTY_IS_EID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsEid(@javax.annotation.Nullable Boolean isEid) { - this.isEid = isEid; - } - - public SignatureRequestSendWithTemplateRequest message( - @javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public SignatureRequestSendWithTemplateRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestSendWithTemplateRequest putMetadataItem( - String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public SignatureRequestSendWithTemplateRequest signingOptions( - @javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; - } - - /** - * Get signingOptions - * - * @return signingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubSigningOptions getSigningOptions() { - return signingOptions; - } - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } - public SignatureRequestSendWithTemplateRequest signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; + if (ccs.getClass().equals(java.io.File.class) || + ccs.getClass().equals(Integer.class) || + ccs.getClass().equals(String.class) || + ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for(int i = 0; i< getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } + else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } - /** - * The URL you want signers redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } - public SignatureRequestSendWithTemplateRequest subject( - @javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } } + if (isQualifiedSignature != null) { + if (isFileTypeOrListOfFiles(isQualifiedSignature)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (isQualifiedSignature.getClass().equals(java.io.File.class) || + isQualifiedSignature.getClass().equals(Integer.class) || + isQualifiedSignature.getClass().equals(String.class) || + isQualifiedSignature.getClass().isEnum()) { + map.put("is_qualified_signature", isQualifiedSignature); + } else if (isListOfFile(isQualifiedSignature)) { + for(int i = 0; i< getListSize(isQualifiedSignature); i++) { + map.put("is_qualified_signature[" + i + "]", getFromList(isQualifiedSignature, i)); + } + } + else { + map.put("is_qualified_signature", JSON.getDefault().getMapper().writeValueAsString(isQualifiedSignature)); + } } + if (isEid != null) { + if (isFileTypeOrListOfFiles(isEid)) { + fileTypeFound = true; + } - public SignatureRequestSendWithTemplateRequest testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (isEid.getClass().equals(java.io.File.class) || + isEid.getClass().equals(Integer.class) || + isEid.getClass().equals(String.class) || + isEid.getClass().isEnum()) { + map.put("is_eid", isEid); + } else if (isListOfFile(isEid)) { + for(int i = 0; i< getListSize(isEid); i++) { + map.put("is_eid[" + i + "]", getFromList(isEid, i)); + } + } + else { + map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request will not be legally binding if set to - * `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } - public SignatureRequestSendWithTemplateRequest title(@javax.annotation.Nullable String title) { - this.title = title; - return this; + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestSendWithTemplateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); } - SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest = - (SignatureRequestSendWithTemplateRequest) o; - return Objects.equals(this.templateIds, signatureRequestSendWithTemplateRequest.templateIds) - && Objects.equals(this.signers, signatureRequestSendWithTemplateRequest.signers) - && Objects.equals( - this.allowDecline, signatureRequestSendWithTemplateRequest.allowDecline) - && Objects.equals(this.ccs, signatureRequestSendWithTemplateRequest.ccs) - && Objects.equals(this.clientId, signatureRequestSendWithTemplateRequest.clientId) - && Objects.equals( - this.customFields, signatureRequestSendWithTemplateRequest.customFields) - && Objects.equals(this.files, signatureRequestSendWithTemplateRequest.files) - && Objects.equals(this.fileUrls, signatureRequestSendWithTemplateRequest.fileUrls) - && Objects.equals( - this.isQualifiedSignature, - signatureRequestSendWithTemplateRequest.isQualifiedSignature) - && Objects.equals(this.isEid, signatureRequestSendWithTemplateRequest.isEid) - && Objects.equals(this.message, signatureRequestSendWithTemplateRequest.message) - && Objects.equals(this.metadata, signatureRequestSendWithTemplateRequest.metadata) - && Objects.equals( - this.signingOptions, signatureRequestSendWithTemplateRequest.signingOptions) - && Objects.equals( - this.signingRedirectUrl, - signatureRequestSendWithTemplateRequest.signingRedirectUrl) - && Objects.equals(this.subject, signatureRequestSendWithTemplateRequest.subject) - && Objects.equals(this.testMode, signatureRequestSendWithTemplateRequest.testMode) - && Objects.equals(this.title, signatureRequestSendWithTemplateRequest.title); } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - templateIds, - signers, - allowDecline, - ccs, - clientId, - customFields, - files, - fileUrls, - isQualifiedSignature, - isEid, - message, - metadata, - signingOptions, - signingRedirectUrl, - subject, - testMode, - title); + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestSendWithTemplateRequest {\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" isQualifiedSignature: ") - .append(toIndentedString(isQualifiedSignature)) - .append("\n"); - sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } - - if (templateIds.getClass().equals(java.io.File.class) - || templateIds.getClass().equals(Integer.class) - || templateIds.getClass().equals(String.class) - || templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for (int i = 0; i < getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } else { - map.put( - "template_ids", - JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (ccs != null) { - if (isFileTypeOrListOfFiles(ccs)) { - fileTypeFound = true; - } - - if (ccs.getClass().equals(java.io.File.class) - || ccs.getClass().equals(Integer.class) - || ccs.getClass().equals(String.class) - || ccs.getClass().isEnum()) { - map.put("ccs", ccs); - } else if (isListOfFile(ccs)) { - for (int i = 0; i < getListSize(ccs); i++) { - map.put("ccs[" + i + "]", getFromList(ccs, i)); - } - } else { - map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (isQualifiedSignature != null) { - if (isFileTypeOrListOfFiles(isQualifiedSignature)) { - fileTypeFound = true; - } - - if (isQualifiedSignature.getClass().equals(java.io.File.class) - || isQualifiedSignature.getClass().equals(Integer.class) - || isQualifiedSignature.getClass().equals(String.class) - || isQualifiedSignature.getClass().isEnum()) { - map.put("is_qualified_signature", isQualifiedSignature); - } else if (isListOfFile(isQualifiedSignature)) { - for (int i = 0; i < getListSize(isQualifiedSignature); i++) { - map.put( - "is_qualified_signature[" + i + "]", - getFromList(isQualifiedSignature, i)); - } - } else { - map.put( - "is_qualified_signature", - JSON.getDefault().getMapper().writeValueAsString(isQualifiedSignature)); - } - } - if (isEid != null) { - if (isFileTypeOrListOfFiles(isEid)) { - fileTypeFound = true; - } - - if (isEid.getClass().equals(java.io.File.class) - || isEid.getClass().equals(Integer.class) - || isEid.getClass().equals(String.class) - || isEid.getClass().isEnum()) { - map.put("is_eid", isEid); - } else if (isListOfFile(isEid)) { - for (int i = 0; i < getListSize(isEid); i++) { - map.put("is_eid[" + i + "]", getFromList(isEid, i)); - } - } else { - map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - - if (signingOptions.getClass().equals(java.io.File.class) - || signingOptions.getClass().equals(Integer.class) - || signingOptions.getClass().equals(String.class) - || signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for (int i = 0; i < getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } else { - map.put( - "signing_options", - JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java index ee3251b41..81afddbe9 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java @@ -10,310 +10,323 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SignatureRequestUpdateRequest */ + +import com.dropbox.sign.ApiException; +/** + * SignatureRequestUpdateRequest + */ @JsonPropertyOrder({ - SignatureRequestUpdateRequest.JSON_PROPERTY_SIGNATURE_ID, - SignatureRequestUpdateRequest.JSON_PROPERTY_EMAIL_ADDRESS, - SignatureRequestUpdateRequest.JSON_PROPERTY_NAME, - SignatureRequestUpdateRequest.JSON_PROPERTY_EXPIRES_AT + SignatureRequestUpdateRequest.JSON_PROPERTY_SIGNATURE_ID, + SignatureRequestUpdateRequest.JSON_PROPERTY_EMAIL_ADDRESS, + SignatureRequestUpdateRequest.JSON_PROPERTY_NAME, + SignatureRequestUpdateRequest.JSON_PROPERTY_EXPIRES_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SignatureRequestUpdateRequest { - public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; - @javax.annotation.Nonnull private String signatureId; - - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public SignatureRequestUpdateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SignatureRequestUpdateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestUpdateRequest.class); + public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; + @javax.annotation.Nonnull + private String signatureId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public SignatureRequestUpdateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SignatureRequestUpdateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestUpdateRequest.class); + } + + static public SignatureRequestUpdateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestUpdateRequest.class + ); + } + + public SignatureRequestUpdateRequest signatureId(@javax.annotation.Nonnull String signatureId) { + this.signatureId = signatureId; + return this; + } + + /** + * The signature ID for the recipient. + * @return signatureId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSignatureId() { + return signatureId; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignatureId(@javax.annotation.Nonnull String signatureId) { + this.signatureId = signatureId; + } + + + public SignatureRequestUpdateRequest emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided. + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + public SignatureRequestUpdateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The new name for the recipient. **NOTE:** Optional if `email_address` is provided. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SignatureRequestUpdateRequest expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this SignatureRequestUpdateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public static SignatureRequestUpdateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestUpdateRequest.class); - } - - public SignatureRequestUpdateRequest signatureId(@javax.annotation.Nonnull String signatureId) { - this.signatureId = signatureId; - return this; - } - - /** - * The signature ID for the recipient. - * - * @return signatureId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getSignatureId() { - return signatureId; - } - - @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSignatureId(@javax.annotation.Nonnull String signatureId) { - this.signatureId = signatureId; - } - - public SignatureRequestUpdateRequest emailAddress( - @javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The new email address for the recipient. This will generate a new `signature_id` - * value. **NOTE:** Optional if `name` is provided. - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; - } - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - } - - public SignatureRequestUpdateRequest name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The new name for the recipient. **NOTE:** Optional if `email_address` is provided. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public SignatureRequestUpdateRequest expiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestUpdateRequest signatureRequestUpdateRequest = (SignatureRequestUpdateRequest) o; + return Objects.equals(this.signatureId, signatureRequestUpdateRequest.signatureId) && + Objects.equals(this.emailAddress, signatureRequestUpdateRequest.emailAddress) && + Objects.equals(this.name, signatureRequestUpdateRequest.name) && + Objects.equals(this.expiresAt, signatureRequestUpdateRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(signatureId, emailAddress, name, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestUpdateRequest {\n"); + sb.append(" signatureId: ").append(toIndentedString(signatureId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (signatureId != null) { + if (isFileTypeOrListOfFiles(signatureId)) { + fileTypeFound = true; + } - /** - * The new time when the signature request will expire. Unsigned signatures will be moved to the - * expired status, and no longer signable. See [Signature Request Expiration - * Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; + if (signatureId.getClass().equals(java.io.File.class) || + signatureId.getClass().equals(Integer.class) || + signatureId.getClass().equals(String.class) || + signatureId.getClass().isEnum()) { + map.put("signature_id", signatureId); + } else if (isListOfFile(signatureId)) { + for(int i = 0; i< getListSize(signatureId); i++) { + map.put("signature_id[" + i + "]", getFromList(signatureId, i)); + } + } + else { + map.put("signature_id", JSON.getDefault().getMapper().writeValueAsString(signatureId)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** Return true if this SignatureRequestUpdateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); } - SignatureRequestUpdateRequest signatureRequestUpdateRequest = - (SignatureRequestUpdateRequest) o; - return Objects.equals(this.signatureId, signatureRequestUpdateRequest.signatureId) - && Objects.equals(this.emailAddress, signatureRequestUpdateRequest.emailAddress) - && Objects.equals(this.name, signatureRequestUpdateRequest.name) - && Objects.equals(this.expiresAt, signatureRequestUpdateRequest.expiresAt); } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(signatureId, emailAddress, name, expiresAt); + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestUpdateRequest {\n"); - sb.append(" signatureId: ").append(toIndentedString(signatureId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (signatureId != null) { - if (isFileTypeOrListOfFiles(signatureId)) { - fileTypeFound = true; - } - - if (signatureId.getClass().equals(java.io.File.class) - || signatureId.getClass().equals(Integer.class) - || signatureId.getClass().equals(String.class) - || signatureId.getClass().isEnum()) { - map.put("signature_id", signatureId); - } else if (isListOfFile(signatureId)) { - for (int i = 0; i < getListSize(signatureId); i++) { - map.put("signature_id[" + i + "]", getFromList(signatureId, i)); - } - } else { - map.put( - "signature_id", - JSON.getDefault().getMapper().writeValueAsString(signatureId)); - } - } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubAttachment.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubAttachment.java index d9f3ad2e5..fd9a9d463 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubAttachment.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubAttachment.java @@ -10,303 +10,323 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SubAttachment */ + +import com.dropbox.sign.ApiException; +/** + * SubAttachment + */ @JsonPropertyOrder({ - SubAttachment.JSON_PROPERTY_NAME, - SubAttachment.JSON_PROPERTY_SIGNER_INDEX, - SubAttachment.JSON_PROPERTY_INSTRUCTIONS, - SubAttachment.JSON_PROPERTY_REQUIRED + SubAttachment.JSON_PROPERTY_NAME, + SubAttachment.JSON_PROPERTY_SIGNER_INDEX, + SubAttachment.JSON_PROPERTY_INSTRUCTIONS, + SubAttachment.JSON_PROPERTY_REQUIRED }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubAttachment { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull private String name; - - public static final String JSON_PROPERTY_SIGNER_INDEX = "signer_index"; - @javax.annotation.Nonnull private Integer signerIndex; - - public static final String JSON_PROPERTY_INSTRUCTIONS = "instructions"; - @javax.annotation.Nullable private String instructions; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - @javax.annotation.Nullable private Boolean required = false; - - public SubAttachment() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubAttachment init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubAttachment.class); + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_SIGNER_INDEX = "signer_index"; + @javax.annotation.Nonnull + private Integer signerIndex; + + public static final String JSON_PROPERTY_INSTRUCTIONS = "instructions"; + @javax.annotation.Nullable + private String instructions; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + @javax.annotation.Nullable + private Boolean required = false; + + public SubAttachment() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubAttachment init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubAttachment.class); + } + + static public SubAttachment init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubAttachment.class + ); + } + + public SubAttachment name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of attachment. + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SubAttachment signerIndex(@javax.annotation.Nonnull Integer signerIndex) { + this.signerIndex = signerIndex; + return this; + } + + /** + * The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment. + * @return signerIndex + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNER_INDEX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getSignerIndex() { + return signerIndex; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER_INDEX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignerIndex(@javax.annotation.Nonnull Integer signerIndex) { + this.signerIndex = signerIndex; + } + + + public SubAttachment instructions(@javax.annotation.Nullable String instructions) { + this.instructions = instructions; + return this; + } + + /** + * The instructions for uploading the attachment. + * @return instructions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getInstructions() { + return instructions; + } + + + @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstructions(@javax.annotation.Nullable String instructions) { + this.instructions = instructions; + } + + + public SubAttachment required(@javax.annotation.Nullable Boolean required) { + this.required = required; + return this; + } + + /** + * Determines if the attachment must be uploaded. + * @return required + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRequired() { + return required; + } + + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(@javax.annotation.Nullable Boolean required) { + this.required = required; + } + + + /** + * Return true if this SubAttachment object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public static SubAttachment init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubAttachment.class); - } - - public SubAttachment name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name of attachment. - * - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public SubAttachment signerIndex(@javax.annotation.Nonnull Integer signerIndex) { - this.signerIndex = signerIndex; - return this; - } - - /** - * The signer's index in the `signers` parameter (0-based indexing). **NOTE:** - * Only one signer can be assigned per attachment. - * - * @return signerIndex - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNER_INDEX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getSignerIndex() { - return signerIndex; - } - - @JsonProperty(JSON_PROPERTY_SIGNER_INDEX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSignerIndex(@javax.annotation.Nonnull Integer signerIndex) { - this.signerIndex = signerIndex; - } - - public SubAttachment instructions(@javax.annotation.Nullable String instructions) { - this.instructions = instructions; - return this; - } - - /** - * The instructions for uploading the attachment. - * - * @return instructions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getInstructions() { - return instructions; - } - - @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInstructions(@javax.annotation.Nullable String instructions) { - this.instructions = instructions; - } - - public SubAttachment required(@javax.annotation.Nullable Boolean required) { - this.required = required; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + SubAttachment subAttachment = (SubAttachment) o; + return Objects.equals(this.name, subAttachment.name) && + Objects.equals(this.signerIndex, subAttachment.signerIndex) && + Objects.equals(this.instructions, subAttachment.instructions) && + Objects.equals(this.required, subAttachment.required); + } + + @Override + public int hashCode() { + return Objects.hash(name, signerIndex, instructions, required); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAttachment {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" signerIndex: ").append(toIndentedString(signerIndex)).append("\n"); + sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** - * Determines if the attachment must be uploaded. - * - * @return required - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getRequired() { - return required; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (signerIndex != null) { + if (isFileTypeOrListOfFiles(signerIndex)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(@javax.annotation.Nullable Boolean required) { - this.required = required; + if (signerIndex.getClass().equals(java.io.File.class) || + signerIndex.getClass().equals(Integer.class) || + signerIndex.getClass().equals(String.class) || + signerIndex.getClass().isEnum()) { + map.put("signer_index", signerIndex); + } else if (isListOfFile(signerIndex)) { + for(int i = 0; i< getListSize(signerIndex); i++) { + map.put("signer_index[" + i + "]", getFromList(signerIndex, i)); + } + } + else { + map.put("signer_index", JSON.getDefault().getMapper().writeValueAsString(signerIndex)); + } } + if (instructions != null) { + if (isFileTypeOrListOfFiles(instructions)) { + fileTypeFound = true; + } - /** Return true if this SubAttachment object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (instructions.getClass().equals(java.io.File.class) || + instructions.getClass().equals(Integer.class) || + instructions.getClass().equals(String.class) || + instructions.getClass().isEnum()) { + map.put("instructions", instructions); + } else if (isListOfFile(instructions)) { + for(int i = 0; i< getListSize(instructions); i++) { + map.put("instructions[" + i + "]", getFromList(instructions, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("instructions", JSON.getDefault().getMapper().writeValueAsString(instructions)); } - SubAttachment subAttachment = (SubAttachment) o; - return Objects.equals(this.name, subAttachment.name) - && Objects.equals(this.signerIndex, subAttachment.signerIndex) - && Objects.equals(this.instructions, subAttachment.instructions) - && Objects.equals(this.required, subAttachment.required); } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(name, signerIndex, instructions, required); + if (required.getClass().equals(java.io.File.class) || + required.getClass().equals(Integer.class) || + required.getClass().equals(String.class) || + required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for(int i = 0; i< getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } + else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubAttachment {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" signerIndex: ").append(toIndentedString(signerIndex)).append("\n"); - sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (signerIndex != null) { - if (isFileTypeOrListOfFiles(signerIndex)) { - fileTypeFound = true; - } - - if (signerIndex.getClass().equals(java.io.File.class) - || signerIndex.getClass().equals(Integer.class) - || signerIndex.getClass().equals(String.class) - || signerIndex.getClass().isEnum()) { - map.put("signer_index", signerIndex); - } else if (isListOfFile(signerIndex)) { - for (int i = 0; i < getListSize(signerIndex); i++) { - map.put("signer_index[" + i + "]", getFromList(signerIndex, i)); - } - } else { - map.put( - "signer_index", - JSON.getDefault().getMapper().writeValueAsString(signerIndex)); - } - } - if (instructions != null) { - if (isFileTypeOrListOfFiles(instructions)) { - fileTypeFound = true; - } - - if (instructions.getClass().equals(java.io.File.class) - || instructions.getClass().equals(Integer.class) - || instructions.getClass().equals(String.class) - || instructions.getClass().isEnum()) { - map.put("instructions", instructions); - } else if (isListOfFile(instructions)) { - for (int i = 0; i < getListSize(instructions); i++) { - map.put("instructions[" + i + "]", getFromList(instructions, i)); - } - } else { - map.put( - "instructions", - JSON.getDefault().getMapper().writeValueAsString(instructions)); - } - } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - - if (required.getClass().equals(java.io.File.class) - || required.getClass().equals(Integer.class) - || required.getClass().equals(String.class) - || required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for (int i = 0; i < getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java index d08a75d1e..7fa0fcf22 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java @@ -10,230 +10,241 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubBulkSignerListCustomField; +import com.dropbox.sign.model.SubSignatureRequestTemplateSigner; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** SubBulkSignerList */ +import com.dropbox.sign.ApiException; +/** + * SubBulkSignerList + */ @JsonPropertyOrder({ - SubBulkSignerList.JSON_PROPERTY_CUSTOM_FIELDS, - SubBulkSignerList.JSON_PROPERTY_SIGNERS + SubBulkSignerList.JSON_PROPERTY_CUSTOM_FIELDS, + SubBulkSignerList.JSON_PROPERTY_SIGNERS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubBulkSignerList { - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_SIGNERS = "signers"; - @javax.annotation.Nullable private List signers = null; - - public SubBulkSignerList() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubBulkSignerList init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubBulkSignerList.class); - } - - public static SubBulkSignerList init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubBulkSignerList.class); - } - - public SubBulkSignerList customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public SubBulkSignerList addCustomFieldsItem(SubBulkSignerListCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nullable + private List signers = null; + + public SubBulkSignerList() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubBulkSignerList init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubBulkSignerList.class); + } + + static public SubBulkSignerList init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubBulkSignerList.class + ); + } + + public SubBulkSignerList customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public SubBulkSignerList addCustomFieldsItem(SubBulkSignerListCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array of custom field values. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + + + public SubBulkSignerList signers(@javax.annotation.Nullable List signers) { + this.signers = signers; + return this; + } + + public SubBulkSignerList addSignersItem(SubSignatureRequestTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value. + * @return signers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(@javax.annotation.Nullable List signers) { + this.signers = signers; + } + + + /** + * Return true if this SubBulkSignerList object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubBulkSignerList subBulkSignerList = (SubBulkSignerList) o; + return Objects.equals(this.customFields, subBulkSignerList.customFields) && + Objects.equals(this.signers, subBulkSignerList.signers); + } + + @Override + public int hashCode() { + return Objects.hash(customFields, signers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubBulkSignerList {\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; } - this.customFields.add(customFieldsItem); - return this; - } - /** - * An array of custom field values. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public SubBulkSignerList signers( - @javax.annotation.Nullable List signers) { - this.signers = signers; - return this; - } - - public SubBulkSignerList addSignersItem(SubSignatureRequestTemplateSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Templated-based Signature Request. Allows the requester to specify editor - * options when a preparing a document. Currently only templates with a single role are - * supported. All signers must have the same `role` value. - * - * @return signers - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSigners() { - return signers; - } - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners( - @javax.annotation.Nullable List signers) { - this.signers = signers; } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } - /** Return true if this SubBulkSignerList object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); } - SubBulkSignerList subBulkSignerList = (SubBulkSignerList) o; - return Objects.equals(this.customFields, subBulkSignerList.customFields) - && Objects.equals(this.signers, subBulkSignerList.signers); } - - @Override - public int hashCode() { - return Objects.hash(customFields, signers); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubBulkSignerList {\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } - - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java index 40145d4ed..4bbec7220 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java @@ -10,209 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SubBulkSignerListCustomField */ + +import com.dropbox.sign.ApiException; +/** + * SubBulkSignerListCustomField + */ @JsonPropertyOrder({ - SubBulkSignerListCustomField.JSON_PROPERTY_NAME, - SubBulkSignerListCustomField.JSON_PROPERTY_VALUE + SubBulkSignerListCustomField.JSON_PROPERTY_NAME, + SubBulkSignerListCustomField.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubBulkSignerListCustomField { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull private String name; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nonnull private String value; - - public SubBulkSignerListCustomField() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubBulkSignerListCustomField init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubBulkSignerListCustomField.class); - } - - public static SubBulkSignerListCustomField init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubBulkSignerListCustomField.class); - } - - public SubBulkSignerListCustomField name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name of the custom field. Must be the field's `name` or `api_id`. - * - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public SubBulkSignerListCustomField value(@javax.annotation.Nonnull String value) { - this.value = value; - return this; - } - - /** - * The value of the custom field. - * - * @return value - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getValue() { - return value; - } + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nonnull + private String value; + + public SubBulkSignerListCustomField() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubBulkSignerListCustomField init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubBulkSignerListCustomField.class); + } + + static public SubBulkSignerListCustomField init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubBulkSignerListCustomField.class + ); + } + + public SubBulkSignerListCustomField name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the custom field. Must be the field's `name` or `api_id`. + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SubBulkSignerListCustomField value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * The value of the custom field. + * @return value + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + + /** + * Return true if this SubBulkSignerListCustomField object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubBulkSignerListCustomField subBulkSignerListCustomField = (SubBulkSignerListCustomField) o; + return Objects.equals(this.name, subBulkSignerListCustomField.name) && + Objects.equals(this.value, subBulkSignerListCustomField.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubBulkSignerListCustomField {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setValue(@javax.annotation.Nonnull String value) { - this.value = value; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - /** Return true if this SubBulkSignerListCustomField object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); } - SubBulkSignerListCustomField subBulkSignerListCustomField = - (SubBulkSignerListCustomField) o; - return Objects.equals(this.name, subBulkSignerListCustomField.name) - && Objects.equals(this.value, subBulkSignerListCustomField.value); } - - @Override - public int hashCode() { - return Objects.hash(name, value); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubBulkSignerListCustomField {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCC.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCC.java index f9b550b7e..7417c2093 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCC.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCC.java @@ -10,206 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** SubCC */ -@JsonPropertyOrder({SubCC.JSON_PROPERTY_ROLE, SubCC.JSON_PROPERTY_EMAIL_ADDRESS}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class SubCC { - public static final String JSON_PROPERTY_ROLE = "role"; - @javax.annotation.Nonnull private String role; - - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nonnull private String emailAddress; - public SubCC() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubCC init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubCC.class); - } - public static SubCC init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubCC.class); - } - - public SubCC role(@javax.annotation.Nonnull String role) { - this.role = role; - return this; - } - - /** - * Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the - * same CC role. - * - * @return role - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRole() { - return role; - } - - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRole(@javax.annotation.Nonnull String role) { - this.role = role; - } - - public SubCC emailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address of the CC recipient. - * - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getEmailAddress() { - return emailAddress; - } +import com.dropbox.sign.ApiException; +/** + * SubCC + */ +@JsonPropertyOrder({ + SubCC.JSON_PROPERTY_ROLE, + SubCC.JSON_PROPERTY_EMAIL_ADDRESS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SubCC { + public static final String JSON_PROPERTY_ROLE = "role"; + @javax.annotation.Nonnull + private String role; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nonnull + private String emailAddress; + + public SubCC() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubCC init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubCC.class); + } + + static public SubCC init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubCC.class + ); + } + + public SubCC role(@javax.annotation.Nonnull String role) { + this.role = role; + return this; + } + + /** + * Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. + * @return role + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRole() { + return role; + } + + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRole(@javax.annotation.Nonnull String role) { + this.role = role; + } + + + public SubCC emailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The email address of the CC recipient. + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this SubCC object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubCC subCC = (SubCC) o; + return Objects.equals(this.role, subCC.role) && + Objects.equals(this.emailAddress, subCC.emailAddress); + } + + @Override + public int hashCode() { + return Objects.hash(role, emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubCC {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (role != null) { + if (isFileTypeOrListOfFiles(role)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; + if (role.getClass().equals(java.io.File.class) || + role.getClass().equals(Integer.class) || + role.getClass().equals(String.class) || + role.getClass().isEnum()) { + map.put("role", role); + } else if (isListOfFile(role)) { + for(int i = 0; i< getListSize(role); i++) { + map.put("role[" + i + "]", getFromList(role, i)); + } + } + else { + map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - /** Return true if this SubCC object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); } - SubCC subCC = (SubCC) o; - return Objects.equals(this.role, subCC.role) - && Objects.equals(this.emailAddress, subCC.emailAddress); } - - @Override - public int hashCode() { - return Objects.hash(role, emailAddress); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubCC {\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (role != null) { - if (isFileTypeOrListOfFiles(role)) { - fileTypeFound = true; - } - - if (role.getClass().equals(java.io.File.class) - || role.getClass().equals(Integer.class) - || role.getClass().equals(String.class) - || role.getClass().isEnum()) { - map.put("role", role); - } else if (isListOfFile(role)) { - for (int i = 0; i < getListSize(role); i++) { - map.put("role[" + i + "]", getFromList(role, i)); - } - } else { - map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); - } - } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCustomField.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCustomField.java index 4cd3a8dc2..68e78356b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCustomField.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCustomField.java @@ -10,316 +10,323 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; + +import com.dropbox.sign.ApiException; /** - * When used together with merge fields, `custom_fields` allows users to add pre-filled - * data to their signature requests. Pre-filled data can be used with \"send-once\" - * signature requests by adding merge fields with `form_fields_per_document` or [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back - * with `custom_fields` together in one API call. For using pre-filled on repeatable - * signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling - * [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then - * passing `custom_fields` on subsequent signature requests referencing that template. + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. */ @JsonPropertyOrder({ - SubCustomField.JSON_PROPERTY_NAME, - SubCustomField.JSON_PROPERTY_EDITOR, - SubCustomField.JSON_PROPERTY_REQUIRED, - SubCustomField.JSON_PROPERTY_VALUE + SubCustomField.JSON_PROPERTY_NAME, + SubCustomField.JSON_PROPERTY_EDITOR, + SubCustomField.JSON_PROPERTY_REQUIRED, + SubCustomField.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubCustomField { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull private String name; - - public static final String JSON_PROPERTY_EDITOR = "editor"; - @javax.annotation.Nullable private String editor; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - @javax.annotation.Nullable private Boolean required = false; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private String value; - - public SubCustomField() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubCustomField init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubCustomField.class); - } - - public static SubCustomField init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubCustomField.class); - } - - public SubCustomField name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name of a custom field. When working with pre-filled data, the custom field's name - * must have a matching merge field name or the field will remain empty on the document during - * signing. - * - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public SubCustomField editor(@javax.annotation.Nullable String editor) { - this.editor = editor; - return this; - } - - /** - * Used to create editable merge fields. When the value matches a role passed in with - * `signers`, that role can edit the data that was pre-filled to that field. This - * field is optional, but required when this custom field object is set to `required = - * true`. **NOTE:** Editable merge fields are only supported for single signer requests (or - * the first signer in ordered signature requests). If used when there are multiple signers in - * an unordered signature request, the editor value is ignored and the field won't be - * editable. - * - * @return editor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEditor() { - return editor; - } - - @JsonProperty(JSON_PROPERTY_EDITOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditor(@javax.annotation.Nullable String editor) { - this.editor = editor; - } - - public SubCustomField required(@javax.annotation.Nullable Boolean required) { - this.required = required; - return this; + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_EDITOR = "editor"; + @javax.annotation.Nullable + private String editor; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + @javax.annotation.Nullable + private Boolean required = false; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private String value; + + public SubCustomField() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubCustomField init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubCustomField.class); + } + + static public SubCustomField init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubCustomField.class + ); + } + + public SubCustomField name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SubCustomField editor(@javax.annotation.Nullable String editor) { + this.editor = editor; + return this; + } + + /** + * Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable. + * @return editor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EDITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEditor() { + return editor; + } + + + @JsonProperty(JSON_PROPERTY_EDITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditor(@javax.annotation.Nullable String editor) { + this.editor = editor; + } + + + public SubCustomField required(@javax.annotation.Nullable Boolean required) { + this.required = required; + return this; + } + + /** + * Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`. + * @return required + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRequired() { + return required; + } + + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(@javax.annotation.Nullable Boolean required) { + this.required = required; + } + + + public SubCustomField value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing. + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + /** + * Return true if this SubCustomField object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * Used to set an editable merge field when working with pre-filled data. When `true`, - * the custom field must specify a signer role in `editor`. - * - * @return required - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getRequired() { - return required; - } - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(@javax.annotation.Nullable Boolean required) { - this.required = required; - } - - public SubCustomField value(@javax.annotation.Nullable String value) { - this.value = value; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + SubCustomField subCustomField = (SubCustomField) o; + return Objects.equals(this.name, subCustomField.name) && + Objects.equals(this.editor, subCustomField.editor) && + Objects.equals(this.required, subCustomField.required) && + Objects.equals(this.value, subCustomField.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, editor, required, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubCustomField {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" editor: ").append(toIndentedString(editor)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** - * The string that resolves (aka \"pre-fills\") to the merge field on the final - * document(s) used for signing. - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValue() { - return value; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (editor != null) { + if (isFileTypeOrListOfFiles(editor)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; + if (editor.getClass().equals(java.io.File.class) || + editor.getClass().equals(Integer.class) || + editor.getClass().equals(String.class) || + editor.getClass().isEnum()) { + map.put("editor", editor); + } else if (isListOfFile(editor)) { + for(int i = 0; i< getListSize(editor); i++) { + map.put("editor[" + i + "]", getFromList(editor, i)); + } + } + else { + map.put("editor", JSON.getDefault().getMapper().writeValueAsString(editor)); + } } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } - /** Return true if this SubCustomField object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (required.getClass().equals(java.io.File.class) || + required.getClass().equals(Integer.class) || + required.getClass().equals(String.class) || + required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for(int i = 0; i< getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); } - SubCustomField subCustomField = (SubCustomField) o; - return Objects.equals(this.name, subCustomField.name) - && Objects.equals(this.editor, subCustomField.editor) - && Objects.equals(this.required, subCustomField.required) - && Objects.equals(this.value, subCustomField.value); } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(name, editor, required, value); + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubCustomField {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" editor: ").append(toIndentedString(editor)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (editor != null) { - if (isFileTypeOrListOfFiles(editor)) { - fileTypeFound = true; - } - - if (editor.getClass().equals(java.io.File.class) - || editor.getClass().equals(Integer.class) - || editor.getClass().equals(String.class) - || editor.getClass().isEnum()) { - map.put("editor", editor); - } else if (isListOfFile(editor)) { - for (int i = 0; i < getListSize(editor); i++) { - map.put("editor[" + i + "]", getFromList(editor, i)); - } - } else { - map.put("editor", JSON.getDefault().getMapper().writeValueAsString(editor)); - } - } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - - if (required.getClass().equals(java.io.File.class) - || required.getClass().equals(Integer.class) - || required.getClass().equals(String.class) - || required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for (int i = 0; i < getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } - } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorOptions.java index d93127b44..6ce0da6bf 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorOptions.java @@ -10,213 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This allows the requester to specify editor options when a preparing a document */ + +import com.dropbox.sign.ApiException; +/** + * This allows the requester to specify editor options when a preparing a document + */ @JsonPropertyOrder({ - SubEditorOptions.JSON_PROPERTY_ALLOW_EDIT_SIGNERS, - SubEditorOptions.JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS + SubEditorOptions.JSON_PROPERTY_ALLOW_EDIT_SIGNERS, + SubEditorOptions.JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubEditorOptions { - public static final String JSON_PROPERTY_ALLOW_EDIT_SIGNERS = "allow_edit_signers"; - @javax.annotation.Nullable private Boolean allowEditSigners = false; - - public static final String JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS = "allow_edit_documents"; - @javax.annotation.Nullable private Boolean allowEditDocuments = false; - - public SubEditorOptions() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubEditorOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubEditorOptions.class); - } - - public static SubEditorOptions init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubEditorOptions.class); - } - - public SubEditorOptions allowEditSigners(@javax.annotation.Nullable Boolean allowEditSigners) { - this.allowEditSigners = allowEditSigners; - return this; - } - - /** - * Allows requesters to edit the list of signers - * - * @return allowEditSigners - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowEditSigners() { - return allowEditSigners; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowEditSigners(@javax.annotation.Nullable Boolean allowEditSigners) { - this.allowEditSigners = allowEditSigners; - } - - public SubEditorOptions allowEditDocuments( - @javax.annotation.Nullable Boolean allowEditDocuments) { - this.allowEditDocuments = allowEditDocuments; - return this; - } - - /** - * Allows requesters to edit documents, including delete and add - * - * @return allowEditDocuments - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowEditDocuments() { - return allowEditDocuments; - } + public static final String JSON_PROPERTY_ALLOW_EDIT_SIGNERS = "allow_edit_signers"; + @javax.annotation.Nullable + private Boolean allowEditSigners = false; + + public static final String JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS = "allow_edit_documents"; + @javax.annotation.Nullable + private Boolean allowEditDocuments = false; + + public SubEditorOptions() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubEditorOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubEditorOptions.class); + } + + static public SubEditorOptions init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubEditorOptions.class + ); + } + + public SubEditorOptions allowEditSigners(@javax.annotation.Nullable Boolean allowEditSigners) { + this.allowEditSigners = allowEditSigners; + return this; + } + + /** + * Allows requesters to edit the list of signers + * @return allowEditSigners + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowEditSigners() { + return allowEditSigners; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowEditSigners(@javax.annotation.Nullable Boolean allowEditSigners) { + this.allowEditSigners = allowEditSigners; + } + + + public SubEditorOptions allowEditDocuments(@javax.annotation.Nullable Boolean allowEditDocuments) { + this.allowEditDocuments = allowEditDocuments; + return this; + } + + /** + * Allows requesters to edit documents, including delete and add + * @return allowEditDocuments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowEditDocuments() { + return allowEditDocuments; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowEditDocuments(@javax.annotation.Nullable Boolean allowEditDocuments) { + this.allowEditDocuments = allowEditDocuments; + } + + + /** + * Return true if this SubEditorOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubEditorOptions subEditorOptions = (SubEditorOptions) o; + return Objects.equals(this.allowEditSigners, subEditorOptions.allowEditSigners) && + Objects.equals(this.allowEditDocuments, subEditorOptions.allowEditDocuments); + } + + @Override + public int hashCode() { + return Objects.hash(allowEditSigners, allowEditDocuments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubEditorOptions {\n"); + sb.append(" allowEditSigners: ").append(toIndentedString(allowEditSigners)).append("\n"); + sb.append(" allowEditDocuments: ").append(toIndentedString(allowEditDocuments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (allowEditSigners != null) { + if (isFileTypeOrListOfFiles(allowEditSigners)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowEditDocuments(@javax.annotation.Nullable Boolean allowEditDocuments) { - this.allowEditDocuments = allowEditDocuments; + if (allowEditSigners.getClass().equals(java.io.File.class) || + allowEditSigners.getClass().equals(Integer.class) || + allowEditSigners.getClass().equals(String.class) || + allowEditSigners.getClass().isEnum()) { + map.put("allow_edit_signers", allowEditSigners); + } else if (isListOfFile(allowEditSigners)) { + for(int i = 0; i< getListSize(allowEditSigners); i++) { + map.put("allow_edit_signers[" + i + "]", getFromList(allowEditSigners, i)); + } + } + else { + map.put("allow_edit_signers", JSON.getDefault().getMapper().writeValueAsString(allowEditSigners)); + } } + if (allowEditDocuments != null) { + if (isFileTypeOrListOfFiles(allowEditDocuments)) { + fileTypeFound = true; + } - /** Return true if this SubEditorOptions object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (allowEditDocuments.getClass().equals(java.io.File.class) || + allowEditDocuments.getClass().equals(Integer.class) || + allowEditDocuments.getClass().equals(String.class) || + allowEditDocuments.getClass().isEnum()) { + map.put("allow_edit_documents", allowEditDocuments); + } else if (isListOfFile(allowEditDocuments)) { + for(int i = 0; i< getListSize(allowEditDocuments); i++) { + map.put("allow_edit_documents[" + i + "]", getFromList(allowEditDocuments, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("allow_edit_documents", JSON.getDefault().getMapper().writeValueAsString(allowEditDocuments)); } - SubEditorOptions subEditorOptions = (SubEditorOptions) o; - return Objects.equals(this.allowEditSigners, subEditorOptions.allowEditSigners) - && Objects.equals(this.allowEditDocuments, subEditorOptions.allowEditDocuments); } - - @Override - public int hashCode() { - return Objects.hash(allowEditSigners, allowEditDocuments); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubEditorOptions {\n"); - sb.append(" allowEditSigners: ").append(toIndentedString(allowEditSigners)).append("\n"); - sb.append(" allowEditDocuments: ") - .append(toIndentedString(allowEditDocuments)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (allowEditSigners != null) { - if (isFileTypeOrListOfFiles(allowEditSigners)) { - fileTypeFound = true; - } - - if (allowEditSigners.getClass().equals(java.io.File.class) - || allowEditSigners.getClass().equals(Integer.class) - || allowEditSigners.getClass().equals(String.class) - || allowEditSigners.getClass().isEnum()) { - map.put("allow_edit_signers", allowEditSigners); - } else if (isListOfFile(allowEditSigners)) { - for (int i = 0; i < getListSize(allowEditSigners); i++) { - map.put("allow_edit_signers[" + i + "]", getFromList(allowEditSigners, i)); - } - } else { - map.put( - "allow_edit_signers", - JSON.getDefault().getMapper().writeValueAsString(allowEditSigners)); - } - } - if (allowEditDocuments != null) { - if (isFileTypeOrListOfFiles(allowEditDocuments)) { - fileTypeFound = true; - } - - if (allowEditDocuments.getClass().equals(java.io.File.class) - || allowEditDocuments.getClass().equals(Integer.class) - || allowEditDocuments.getClass().equals(String.class) - || allowEditDocuments.getClass().isEnum()) { - map.put("allow_edit_documents", allowEditDocuments); - } else if (isListOfFile(allowEditDocuments)) { - for (int i = 0; i < getListSize(allowEditDocuments); i++) { - map.put( - "allow_edit_documents[" + i + "]", - getFromList(allowEditDocuments, i)); - } - } else { - map.put( - "allow_edit_documents", - JSON.getDefault().getMapper().writeValueAsString(allowEditDocuments)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFieldOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFieldOptions.java index b739c2d42..dcbb16be9 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFieldOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFieldOptions.java @@ -10,208 +10,213 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This allows the requester to specify field options for a signature request. */ -@JsonPropertyOrder({SubFieldOptions.JSON_PROPERTY_DATE_FORMAT}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class SubFieldOptions { - /** - * Allows requester to specify the date format (see list of allowed - * [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and - * higher. - */ - public enum DateFormatEnum { - MMDDYYYY(String.valueOf("MM / DD / YYYY")), - - MM_DD_YYYY(String.valueOf("MM - DD - YYYY")), - - DDMMYYYY(String.valueOf("DD / MM / YYYY")), - - DD_MM_YYYY(String.valueOf("DD - MM - YYYY")), - YYYYMMDD(String.valueOf("YYYY / MM / DD")), - - YYYY_MM_DD(String.valueOf("YYYY - MM - DD")); - - private String value; - - DateFormatEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static DateFormatEnum fromValue(String value) { - for (DateFormatEnum b : DateFormatEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_DATE_FORMAT = "date_format"; - @javax.annotation.Nonnull private DateFormatEnum dateFormat; - - public SubFieldOptions() {} +import com.dropbox.sign.ApiException; +/** + * This allows the requester to specify field options for a signature request. + */ +@JsonPropertyOrder({ + SubFieldOptions.JSON_PROPERTY_DATE_FORMAT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SubFieldOptions { + /** + * Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. + */ + public enum DateFormatEnum { + MMDDYYYY(String.valueOf("MM / DD / YYYY")), + + MM_DD_YYYY(String.valueOf("MM - DD - YYYY")), + + DDMMYYYY(String.valueOf("DD / MM / YYYY")), + + DD_MM_YYYY(String.valueOf("DD - MM - YYYY")), + + YYYYMMDD(String.valueOf("YYYY / MM / DD")), + + YYYY_MM_DD(String.valueOf("YYYY - MM - DD")); - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFieldOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFieldOptions.class); - } + private String value; - public static SubFieldOptions init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubFieldOptions.class); + DateFormatEnum(String value) { + this.value = value; } - public SubFieldOptions dateFormat(@javax.annotation.Nonnull DateFormatEnum dateFormat) { - this.dateFormat = dateFormat; - return this; + @JsonValue + public String getValue() { + return value; } - /** - * Allows requester to specify the date format (see list of allowed - * [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and - * higher. - * - * @return dateFormat - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_DATE_FORMAT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public DateFormatEnum getDateFormat() { - return dateFormat; - } - - @JsonProperty(JSON_PROPERTY_DATE_FORMAT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDateFormat(@javax.annotation.Nonnull DateFormatEnum dateFormat) { - this.dateFormat = dateFormat; + @Override + public String toString() { + return String.valueOf(value); } - /** Return true if this SubFieldOptions object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @JsonCreator + public static DateFormatEnum fromValue(String value) { + for (DateFormatEnum b : DateFormatEnum.values()) { + if (b.value.equals(value)) { + return b; } - if (o == null || getClass() != o.getClass()) { - return false; + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_DATE_FORMAT = "date_format"; + @javax.annotation.Nonnull + private DateFormatEnum dateFormat; + + public SubFieldOptions() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFieldOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFieldOptions.class); + } + + static public SubFieldOptions init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFieldOptions.class + ); + } + + public SubFieldOptions dateFormat(@javax.annotation.Nonnull DateFormatEnum dateFormat) { + this.dateFormat = dateFormat; + return this; + } + + /** + * Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. + * @return dateFormat + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATE_FORMAT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public DateFormatEnum getDateFormat() { + return dateFormat; + } + + + @JsonProperty(JSON_PROPERTY_DATE_FORMAT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDateFormat(@javax.annotation.Nonnull DateFormatEnum dateFormat) { + this.dateFormat = dateFormat; + } + + + /** + * Return true if this SubFieldOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubFieldOptions subFieldOptions = (SubFieldOptions) o; + return Objects.equals(this.dateFormat, subFieldOptions.dateFormat); + } + + @Override + public int hashCode() { + return Objects.hash(dateFormat); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFieldOptions {\n"); + sb.append(" dateFormat: ").append(toIndentedString(dateFormat)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (dateFormat != null) { + if (isFileTypeOrListOfFiles(dateFormat)) { + fileTypeFound = true; } - SubFieldOptions subFieldOptions = (SubFieldOptions) o; - return Objects.equals(this.dateFormat, subFieldOptions.dateFormat); - } - @Override - public int hashCode() { - return Objects.hash(dateFormat); + if (dateFormat.getClass().equals(java.io.File.class) || + dateFormat.getClass().equals(Integer.class) || + dateFormat.getClass().equals(String.class) || + dateFormat.getClass().isEnum()) { + map.put("date_format", dateFormat); + } else if (isListOfFile(dateFormat)) { + for(int i = 0; i< getListSize(dateFormat); i++) { + map.put("date_format[" + i + "]", getFromList(dateFormat, i)); + } + } + else { + map.put("date_format", JSON.getDefault().getMapper().writeValueAsString(dateFormat)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFieldOptions {\n"); - sb.append(" dateFormat: ").append(toIndentedString(dateFormat)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (dateFormat != null) { - if (isFileTypeOrListOfFiles(dateFormat)) { - fileTypeFound = true; - } - - if (dateFormat.getClass().equals(java.io.File.class) - || dateFormat.getClass().equals(Integer.class) - || dateFormat.getClass().equals(String.class) - || dateFormat.getClass().isEnum()) { - map.put("date_format", dateFormat); - } else if (isListOfFile(dateFormat)) { - for (int i = 0; i < getListSize(dateFormat); i++) { - map.put("date_format[" + i + "]", getFromList(dateFormat, i)); - } - } else { - map.put( - "date_format", - JSON.getDefault().getMapper().writeValueAsString(dateFormat)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java index 11338d70a..2ea94dbcc 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java @@ -10,263 +10,272 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SubFormFieldGroup */ + +import com.dropbox.sign.ApiException; +/** + * SubFormFieldGroup + */ @JsonPropertyOrder({ - SubFormFieldGroup.JSON_PROPERTY_GROUP_ID, - SubFormFieldGroup.JSON_PROPERTY_GROUP_LABEL, - SubFormFieldGroup.JSON_PROPERTY_REQUIREMENT + SubFormFieldGroup.JSON_PROPERTY_GROUP_ID, + SubFormFieldGroup.JSON_PROPERTY_GROUP_LABEL, + SubFormFieldGroup.JSON_PROPERTY_REQUIREMENT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubFormFieldGroup { - public static final String JSON_PROPERTY_GROUP_ID = "group_id"; - @javax.annotation.Nonnull private String groupId; + public static final String JSON_PROPERTY_GROUP_ID = "group_id"; + @javax.annotation.Nonnull + private String groupId; - public static final String JSON_PROPERTY_GROUP_LABEL = "group_label"; - @javax.annotation.Nonnull private String groupLabel; + public static final String JSON_PROPERTY_GROUP_LABEL = "group_label"; + @javax.annotation.Nonnull + private String groupLabel; - public static final String JSON_PROPERTY_REQUIREMENT = "requirement"; - @javax.annotation.Nonnull private String requirement; + public static final String JSON_PROPERTY_REQUIREMENT = "requirement"; + @javax.annotation.Nonnull + private String requirement; - public SubFormFieldGroup() {} + public SubFormFieldGroup() { + } - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldGroup init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldGroup.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldGroup init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldGroup.class); + } - public static SubFormFieldGroup init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubFormFieldGroup.class); - } + static public SubFormFieldGroup init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldGroup.class + ); + } - public SubFormFieldGroup groupId(@javax.annotation.Nonnull String groupId) { - this.groupId = groupId; - return this; - } + public SubFormFieldGroup groupId(@javax.annotation.Nonnull String groupId) { + this.groupId = groupId; + return this; + } - /** - * ID of group. Use this to reference a specific group from the `group` value in - * `form_fields_per_document`. - * - * @return groupId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_GROUP_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getGroupId() { - return groupId; - } + /** + * ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. + * @return groupId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - @JsonProperty(JSON_PROPERTY_GROUP_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGroupId(@javax.annotation.Nonnull String groupId) { - this.groupId = groupId; - } + public String getGroupId() { + return groupId; + } - public SubFormFieldGroup groupLabel(@javax.annotation.Nonnull String groupLabel) { - this.groupLabel = groupLabel; - return this; - } - /** - * Name of the group - * - * @return groupLabel - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_GROUP_LABEL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getGroupLabel() { - return groupLabel; - } + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGroupId(@javax.annotation.Nonnull String groupId) { + this.groupId = groupId; + } - @JsonProperty(JSON_PROPERTY_GROUP_LABEL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGroupLabel(@javax.annotation.Nonnull String groupLabel) { - this.groupLabel = groupLabel; - } - public SubFormFieldGroup requirement(@javax.annotation.Nonnull String requirement) { - this.requirement = requirement; - return this; - } + public SubFormFieldGroup groupLabel(@javax.annotation.Nonnull String groupLabel) { + this.groupLabel = groupLabel; + return this; + } - /** - * Examples: `require_0-1` `require_1` `require_1-ormore` - Check - * out the list of [acceptable `requirement` checkbox type - * values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of - * [acceptable `requirement` radio type - * fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** - * two fields per group. - * - * @return requirement - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REQUIREMENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRequirement() { - return requirement; - } + /** + * Name of the group + * @return groupLabel + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GROUP_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getGroupLabel() { + return groupLabel; + } + + + @JsonProperty(JSON_PROPERTY_GROUP_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGroupLabel(@javax.annotation.Nonnull String groupLabel) { + this.groupLabel = groupLabel; + } + + + public SubFormFieldGroup requirement(@javax.annotation.Nonnull String requirement) { + this.requirement = requirement; + return this; + } + + /** + * Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. + * @return requirement + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REQUIREMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - @JsonProperty(JSON_PROPERTY_REQUIREMENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRequirement(@javax.annotation.Nonnull String requirement) { - this.requirement = requirement; + public String getRequirement() { + return requirement; + } + + + @JsonProperty(JSON_PROPERTY_REQUIREMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequirement(@javax.annotation.Nonnull String requirement) { + this.requirement = requirement; + } + + + /** + * Return true if this SubFormFieldGroup object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubFormFieldGroup subFormFieldGroup = (SubFormFieldGroup) o; + return Objects.equals(this.groupId, subFormFieldGroup.groupId) && + Objects.equals(this.groupLabel, subFormFieldGroup.groupLabel) && + Objects.equals(this.requirement, subFormFieldGroup.requirement); + } - /** Return true if this SubFormFieldGroup object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; + @Override + public int hashCode() { + return Objects.hash(groupId, groupLabel, requirement); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldGroup {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" groupLabel: ").append(toIndentedString(groupLabel)).append("\n"); + sb.append(" requirement: ").append(toIndentedString(requirement)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (groupId != null) { + if (isFileTypeOrListOfFiles(groupId)) { + fileTypeFound = true; } - SubFormFieldGroup subFormFieldGroup = (SubFormFieldGroup) o; - return Objects.equals(this.groupId, subFormFieldGroup.groupId) - && Objects.equals(this.groupLabel, subFormFieldGroup.groupLabel) - && Objects.equals(this.requirement, subFormFieldGroup.requirement); - } - @Override - public int hashCode() { - return Objects.hash(groupId, groupLabel, requirement); + if (groupId.getClass().equals(java.io.File.class) || + groupId.getClass().equals(Integer.class) || + groupId.getClass().equals(String.class) || + groupId.getClass().isEnum()) { + map.put("group_id", groupId); + } else if (isListOfFile(groupId)) { + for(int i = 0; i< getListSize(groupId); i++) { + map.put("group_id[" + i + "]", getFromList(groupId, i)); + } + } + else { + map.put("group_id", JSON.getDefault().getMapper().writeValueAsString(groupId)); + } } + if (groupLabel != null) { + if (isFileTypeOrListOfFiles(groupLabel)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldGroup {\n"); - sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); - sb.append(" groupLabel: ").append(toIndentedString(groupLabel)).append("\n"); - sb.append(" requirement: ").append(toIndentedString(requirement)).append("\n"); - sb.append("}"); - return sb.toString(); + if (groupLabel.getClass().equals(java.io.File.class) || + groupLabel.getClass().equals(Integer.class) || + groupLabel.getClass().equals(String.class) || + groupLabel.getClass().isEnum()) { + map.put("group_label", groupLabel); + } else if (isListOfFile(groupLabel)) { + for(int i = 0; i< getListSize(groupLabel); i++) { + map.put("group_label[" + i + "]", getFromList(groupLabel, i)); + } + } + else { + map.put("group_label", JSON.getDefault().getMapper().writeValueAsString(groupLabel)); + } } + if (requirement != null) { + if (isFileTypeOrListOfFiles(requirement)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (groupId != null) { - if (isFileTypeOrListOfFiles(groupId)) { - fileTypeFound = true; - } - - if (groupId.getClass().equals(java.io.File.class) - || groupId.getClass().equals(Integer.class) - || groupId.getClass().equals(String.class) - || groupId.getClass().isEnum()) { - map.put("group_id", groupId); - } else if (isListOfFile(groupId)) { - for (int i = 0; i < getListSize(groupId); i++) { - map.put("group_id[" + i + "]", getFromList(groupId, i)); - } - } else { - map.put("group_id", JSON.getDefault().getMapper().writeValueAsString(groupId)); - } - } - if (groupLabel != null) { - if (isFileTypeOrListOfFiles(groupLabel)) { - fileTypeFound = true; - } - - if (groupLabel.getClass().equals(java.io.File.class) - || groupLabel.getClass().equals(Integer.class) - || groupLabel.getClass().equals(String.class) - || groupLabel.getClass().isEnum()) { - map.put("group_label", groupLabel); - } else if (isListOfFile(groupLabel)) { - for (int i = 0; i < getListSize(groupLabel); i++) { - map.put("group_label[" + i + "]", getFromList(groupLabel, i)); - } - } else { - map.put( - "group_label", - JSON.getDefault().getMapper().writeValueAsString(groupLabel)); - } + if (requirement.getClass().equals(java.io.File.class) || + requirement.getClass().equals(Integer.class) || + requirement.getClass().equals(String.class) || + requirement.getClass().isEnum()) { + map.put("requirement", requirement); + } else if (isListOfFile(requirement)) { + for(int i = 0; i< getListSize(requirement); i++) { + map.put("requirement[" + i + "]", getFromList(requirement, i)); } - if (requirement != null) { - if (isFileTypeOrListOfFiles(requirement)) { - fileTypeFound = true; - } - - if (requirement.getClass().equals(java.io.File.class) - || requirement.getClass().equals(Integer.class) - || requirement.getClass().equals(String.class) - || requirement.getClass().isEnum()) { - map.put("requirement", requirement); - } else if (isListOfFile(requirement)) { - for (int i = 0; i < getListSize(requirement); i++) { - map.put("requirement[" + i + "]", getFromList(requirement, i)); - } - } else { - map.put( - "requirement", - JSON.getDefault().getMapper().writeValueAsString(requirement)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("requirement", JSON.getDefault().getMapper().writeValueAsString(requirement)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java index a32b6eb6c..6c1a6b910 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java @@ -10,324 +10,343 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubFormFieldRuleAction; +import com.dropbox.sign.model.SubFormFieldRuleTrigger; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** SubFormFieldRule */ +import com.dropbox.sign.ApiException; +/** + * SubFormFieldRule + */ @JsonPropertyOrder({ - SubFormFieldRule.JSON_PROPERTY_ID, - SubFormFieldRule.JSON_PROPERTY_TRIGGER_OPERATOR, - SubFormFieldRule.JSON_PROPERTY_TRIGGERS, - SubFormFieldRule.JSON_PROPERTY_ACTIONS + SubFormFieldRule.JSON_PROPERTY_ID, + SubFormFieldRule.JSON_PROPERTY_TRIGGER_OPERATOR, + SubFormFieldRule.JSON_PROPERTY_TRIGGERS, + SubFormFieldRule.JSON_PROPERTY_ACTIONS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubFormFieldRule { - public static final String JSON_PROPERTY_ID = "id"; - @javax.annotation.Nonnull private String id; - - public static final String JSON_PROPERTY_TRIGGER_OPERATOR = "trigger_operator"; - @javax.annotation.Nonnull private String triggerOperator = "AND"; - - public static final String JSON_PROPERTY_TRIGGERS = "triggers"; - @javax.annotation.Nonnull private List triggers = new ArrayList<>(); - - public static final String JSON_PROPERTY_ACTIONS = "actions"; - @javax.annotation.Nonnull private List actions = new ArrayList<>(); - - public SubFormFieldRule() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldRule init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldRule.class); - } - - public static SubFormFieldRule init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubFormFieldRule.class); - } - - public SubFormFieldRule id(@javax.annotation.Nonnull String id) { - this.id = id; - return this; + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nonnull + private String id; + + public static final String JSON_PROPERTY_TRIGGER_OPERATOR = "trigger_operator"; + @javax.annotation.Nonnull + private String triggerOperator = "AND"; + + public static final String JSON_PROPERTY_TRIGGERS = "triggers"; + @javax.annotation.Nonnull + private List triggers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ACTIONS = "actions"; + @javax.annotation.Nonnull + private List actions = new ArrayList<>(); + + public SubFormFieldRule() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldRule init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldRule.class); + } + + static public SubFormFieldRule init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldRule.class + ); + } + + public SubFormFieldRule id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Must be unique across all defined rules. + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public SubFormFieldRule triggerOperator(@javax.annotation.Nonnull String triggerOperator) { + this.triggerOperator = triggerOperator; + return this; + } + + /** + * Currently only `AND` is supported. Support for `OR` is being worked on. + * @return triggerOperator + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRIGGER_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTriggerOperator() { + return triggerOperator; + } + + + @JsonProperty(JSON_PROPERTY_TRIGGER_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTriggerOperator(@javax.annotation.Nonnull String triggerOperator) { + this.triggerOperator = triggerOperator; + } + + + public SubFormFieldRule triggers(@javax.annotation.Nonnull List triggers) { + this.triggers = triggers; + return this; + } + + public SubFormFieldRule addTriggersItem(SubFormFieldRuleTrigger triggersItem) { + if (this.triggers == null) { + this.triggers = new ArrayList<>(); } - - /** - * Must be unique across all defined rules. - * - * @return id - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getId() { - return id; + this.triggers.add(triggersItem); + return this; + } + + /** + * An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. + * @return triggers + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRIGGERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTriggers() { + return triggers; + } + + + @JsonProperty(JSON_PROPERTY_TRIGGERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTriggers(@javax.annotation.Nonnull List triggers) { + this.triggers = triggers; + } + + + public SubFormFieldRule actions(@javax.annotation.Nonnull List actions) { + this.actions = actions; + return this; + } + + public SubFormFieldRule addActionsItem(SubFormFieldRuleAction actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setId(@javax.annotation.Nonnull String id) { - this.id = id; + this.actions.add(actionsItem); + return this; + } + + /** + * An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule. + * @return actions + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ACTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getActions() { + return actions; + } + + + @JsonProperty(JSON_PROPERTY_ACTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setActions(@javax.annotation.Nonnull List actions) { + this.actions = actions; + } + + + /** + * Return true if this SubFormFieldRule object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public SubFormFieldRule triggerOperator(@javax.annotation.Nonnull String triggerOperator) { - this.triggerOperator = triggerOperator; - return this; - } - - /** - * Currently only `AND` is supported. Support for `OR` is being worked on. - * - * @return triggerOperator - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TRIGGER_OPERATOR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTriggerOperator() { - return triggerOperator; - } - - @JsonProperty(JSON_PROPERTY_TRIGGER_OPERATOR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTriggerOperator(@javax.annotation.Nonnull String triggerOperator) { - this.triggerOperator = triggerOperator; - } - - public SubFormFieldRule triggers( - @javax.annotation.Nonnull List triggers) { - this.triggers = triggers; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - public SubFormFieldRule addTriggersItem(SubFormFieldRuleTrigger triggersItem) { - if (this.triggers == null) { - this.triggers = new ArrayList<>(); + SubFormFieldRule subFormFieldRule = (SubFormFieldRule) o; + return Objects.equals(this.id, subFormFieldRule.id) && + Objects.equals(this.triggerOperator, subFormFieldRule.triggerOperator) && + Objects.equals(this.triggers, subFormFieldRule.triggers) && + Objects.equals(this.actions, subFormFieldRule.actions); + } + + @Override + public int hashCode() { + return Objects.hash(id, triggerOperator, triggers, actions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldRule {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" triggerOperator: ").append(toIndentedString(triggerOperator)).append("\n"); + sb.append(" triggers: ").append(toIndentedString(triggers)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (id != null) { + if (isFileTypeOrListOfFiles(id)) { + fileTypeFound = true; } - this.triggers.add(triggersItem); - return this; - } - /** - * An array of trigger definitions, the \"if this\" part of \"**if this**, then - * that\". Currently only a single trigger per rule is allowed. - * - * @return triggers - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TRIGGERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getTriggers() { - return triggers; - } - - @JsonProperty(JSON_PROPERTY_TRIGGERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTriggers(@javax.annotation.Nonnull List triggers) { - this.triggers = triggers; - } - - public SubFormFieldRule actions( - @javax.annotation.Nonnull List actions) { - this.actions = actions; - return this; - } - - public SubFormFieldRule addActionsItem(SubFormFieldRuleAction actionsItem) { - if (this.actions == null) { - this.actions = new ArrayList<>(); + if (id.getClass().equals(java.io.File.class) || + id.getClass().equals(Integer.class) || + id.getClass().equals(String.class) || + id.getClass().isEnum()) { + map.put("id", id); + } else if (isListOfFile(id)) { + for(int i = 0; i< getListSize(id); i++) { + map.put("id[" + i + "]", getFromList(id, i)); + } + } + else { + map.put("id", JSON.getDefault().getMapper().writeValueAsString(id)); } - this.actions.add(actionsItem); - return this; - } - - /** - * An array of action definitions, the \"then that\" part of \"if this, **then - * that**\". Any number of actions may be attached to a single rule. - * - * @return actions - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ACTIONS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getActions() { - return actions; } + if (triggerOperator != null) { + if (isFileTypeOrListOfFiles(triggerOperator)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ACTIONS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setActions(@javax.annotation.Nonnull List actions) { - this.actions = actions; + if (triggerOperator.getClass().equals(java.io.File.class) || + triggerOperator.getClass().equals(Integer.class) || + triggerOperator.getClass().equals(String.class) || + triggerOperator.getClass().isEnum()) { + map.put("trigger_operator", triggerOperator); + } else if (isListOfFile(triggerOperator)) { + for(int i = 0; i< getListSize(triggerOperator); i++) { + map.put("trigger_operator[" + i + "]", getFromList(triggerOperator, i)); + } + } + else { + map.put("trigger_operator", JSON.getDefault().getMapper().writeValueAsString(triggerOperator)); + } } + if (triggers != null) { + if (isFileTypeOrListOfFiles(triggers)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldRule object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (triggers.getClass().equals(java.io.File.class) || + triggers.getClass().equals(Integer.class) || + triggers.getClass().equals(String.class) || + triggers.getClass().isEnum()) { + map.put("triggers", triggers); + } else if (isListOfFile(triggers)) { + for(int i = 0; i< getListSize(triggers); i++) { + map.put("triggers[" + i + "]", getFromList(triggers, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("triggers", JSON.getDefault().getMapper().writeValueAsString(triggers)); } - SubFormFieldRule subFormFieldRule = (SubFormFieldRule) o; - return Objects.equals(this.id, subFormFieldRule.id) - && Objects.equals(this.triggerOperator, subFormFieldRule.triggerOperator) - && Objects.equals(this.triggers, subFormFieldRule.triggers) - && Objects.equals(this.actions, subFormFieldRule.actions); } + if (actions != null) { + if (isFileTypeOrListOfFiles(actions)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(id, triggerOperator, triggers, actions); + if (actions.getClass().equals(java.io.File.class) || + actions.getClass().equals(Integer.class) || + actions.getClass().equals(String.class) || + actions.getClass().isEnum()) { + map.put("actions", actions); + } else if (isListOfFile(actions)) { + for(int i = 0; i< getListSize(actions); i++) { + map.put("actions[" + i + "]", getFromList(actions, i)); + } + } + else { + map.put("actions", JSON.getDefault().getMapper().writeValueAsString(actions)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldRule {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" triggerOperator: ").append(toIndentedString(triggerOperator)).append("\n"); - sb.append(" triggers: ").append(toIndentedString(triggers)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (id != null) { - if (isFileTypeOrListOfFiles(id)) { - fileTypeFound = true; - } - - if (id.getClass().equals(java.io.File.class) - || id.getClass().equals(Integer.class) - || id.getClass().equals(String.class) - || id.getClass().isEnum()) { - map.put("id", id); - } else if (isListOfFile(id)) { - for (int i = 0; i < getListSize(id); i++) { - map.put("id[" + i + "]", getFromList(id, i)); - } - } else { - map.put("id", JSON.getDefault().getMapper().writeValueAsString(id)); - } - } - if (triggerOperator != null) { - if (isFileTypeOrListOfFiles(triggerOperator)) { - fileTypeFound = true; - } - - if (triggerOperator.getClass().equals(java.io.File.class) - || triggerOperator.getClass().equals(Integer.class) - || triggerOperator.getClass().equals(String.class) - || triggerOperator.getClass().isEnum()) { - map.put("trigger_operator", triggerOperator); - } else if (isListOfFile(triggerOperator)) { - for (int i = 0; i < getListSize(triggerOperator); i++) { - map.put("trigger_operator[" + i + "]", getFromList(triggerOperator, i)); - } - } else { - map.put( - "trigger_operator", - JSON.getDefault().getMapper().writeValueAsString(triggerOperator)); - } - } - if (triggers != null) { - if (isFileTypeOrListOfFiles(triggers)) { - fileTypeFound = true; - } - - if (triggers.getClass().equals(java.io.File.class) - || triggers.getClass().equals(Integer.class) - || triggers.getClass().equals(String.class) - || triggers.getClass().isEnum()) { - map.put("triggers", triggers); - } else if (isListOfFile(triggers)) { - for (int i = 0; i < getListSize(triggers); i++) { - map.put("triggers[" + i + "]", getFromList(triggers, i)); - } - } else { - map.put("triggers", JSON.getDefault().getMapper().writeValueAsString(triggers)); - } - } - if (actions != null) { - if (isFileTypeOrListOfFiles(actions)) { - fileTypeFound = true; - } - - if (actions.getClass().equals(java.io.File.class) - || actions.getClass().equals(Integer.class) - || actions.getClass().equals(String.class) - || actions.getClass().isEnum()) { - map.put("actions", actions); - } else if (isListOfFile(actions)) { - for (int i = 0; i < getListSize(actions); i++) { - map.put("actions[" + i + "]", getFromList(actions, i)); - } - } else { - map.put("actions", JSON.getDefault().getMapper().writeValueAsString(actions)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java index c26d25b82..e01bcc027 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java @@ -10,341 +10,358 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SubFormFieldRuleAction */ + +import com.dropbox.sign.ApiException; +/** + * SubFormFieldRuleAction + */ @JsonPropertyOrder({ - SubFormFieldRuleAction.JSON_PROPERTY_HIDDEN, - SubFormFieldRuleAction.JSON_PROPERTY_TYPE, - SubFormFieldRuleAction.JSON_PROPERTY_FIELD_ID, - SubFormFieldRuleAction.JSON_PROPERTY_GROUP_ID + SubFormFieldRuleAction.JSON_PROPERTY_HIDDEN, + SubFormFieldRuleAction.JSON_PROPERTY_TYPE, + SubFormFieldRuleAction.JSON_PROPERTY_FIELD_ID, + SubFormFieldRuleAction.JSON_PROPERTY_GROUP_ID }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubFormFieldRuleAction { - public static final String JSON_PROPERTY_HIDDEN = "hidden"; - @javax.annotation.Nonnull private Boolean hidden; - - /** Gets or Sets type */ - public enum TypeEnum { - CHANGE_FIELD_VISIBILITY(String.valueOf("change-field-visibility")), - FIELD_VISIBILITY(String.valueOf("change-field-visibility")), - - CHANGE_GROUP_VISIBILITY(String.valueOf("change-group-visibility")), - GROUP_VISIBILITY(String.valueOf("change-group-visibility")); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private TypeEnum type; - - public static final String JSON_PROPERTY_FIELD_ID = "field_id"; - @javax.annotation.Nullable private String fieldId; - - public static final String JSON_PROPERTY_GROUP_ID = "group_id"; - @javax.annotation.Nullable private String groupId; - - public SubFormFieldRuleAction() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldRuleAction init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldRuleAction.class); - } - - public static SubFormFieldRuleAction init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), SubFormFieldRuleAction.class); - } - - public SubFormFieldRuleAction hidden(@javax.annotation.Nonnull Boolean hidden) { - this.hidden = hidden; - return this; - } - - /** - * `true` to hide the target field when rule is satisfied, otherwise - * `false`. - * - * @return hidden - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_HIDDEN) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getHidden() { - return hidden; + public static final String JSON_PROPERTY_HIDDEN = "hidden"; + @javax.annotation.Nonnull + private Boolean hidden; + + /** + * Gets or Sets type + */ + public enum TypeEnum { + CHANGE_FIELD_VISIBILITY(String.valueOf("change-field-visibility")), + + CHANGE_GROUP_VISIBILITY(String.valueOf("change-group-visibility")); + + private String value; + + TypeEnum(String value) { + this.value = value; } - @JsonProperty(JSON_PROPERTY_HIDDEN) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setHidden(@javax.annotation.Nonnull Boolean hidden) { - this.hidden = hidden; + @JsonValue + public String getValue() { + return value; } - public SubFormFieldRuleAction type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TypeEnum getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - } - - public SubFormFieldRuleAction fieldId(@javax.annotation.Nullable String fieldId) { - this.fieldId = fieldId; - return this; + @Override + public String toString() { + return String.valueOf(value); } - /** - * **field_id** or **group_id** is required, but not both. Must reference the `api_id` - * of an existing field defined within `form_fields_per_document`. Cannot use with - * `group_id`. Trigger and action fields must belong to the same signer. - * - * @return fieldId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFieldId() { - return fieldId; + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - @JsonProperty(JSON_PROPERTY_FIELD_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldId(@javax.annotation.Nullable String fieldId) { - this.fieldId = fieldId; + } + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String JSON_PROPERTY_FIELD_ID = "field_id"; + @javax.annotation.Nullable + private String fieldId; + + public static final String JSON_PROPERTY_GROUP_ID = "group_id"; + @javax.annotation.Nullable + private String groupId; + + public SubFormFieldRuleAction() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldRuleAction init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldRuleAction.class); + } + + static public SubFormFieldRuleAction init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldRuleAction.class + ); + } + + public SubFormFieldRuleAction hidden(@javax.annotation.Nonnull Boolean hidden) { + this.hidden = hidden; + return this; + } + + /** + * `true` to hide the target field when rule is satisfied, otherwise `false`. + * @return hidden + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HIDDEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getHidden() { + return hidden; + } + + + @JsonProperty(JSON_PROPERTY_HIDDEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHidden(@javax.annotation.Nonnull Boolean hidden) { + this.hidden = hidden; + } + + + public SubFormFieldRuleAction type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public SubFormFieldRuleAction fieldId(@javax.annotation.Nullable String fieldId) { + this.fieldId = fieldId; + return this; + } + + /** + * **field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer. + * @return fieldId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFieldId() { + return fieldId; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldId(@javax.annotation.Nullable String fieldId) { + this.fieldId = fieldId; + } + + + public SubFormFieldRuleAction groupId(@javax.annotation.Nullable String groupId) { + this.groupId = groupId; + return this; + } + + /** + * **group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer. + * @return groupId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroupId() { + return groupId; + } + + + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupId(@javax.annotation.Nullable String groupId) { + this.groupId = groupId; + } + + + /** + * Return true if this SubFormFieldRuleAction object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public SubFormFieldRuleAction groupId(@javax.annotation.Nullable String groupId) { - this.groupId = groupId; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldRuleAction subFormFieldRuleAction = (SubFormFieldRuleAction) o; + return Objects.equals(this.hidden, subFormFieldRuleAction.hidden) && + Objects.equals(this.type, subFormFieldRuleAction.type) && + Objects.equals(this.fieldId, subFormFieldRuleAction.fieldId) && + Objects.equals(this.groupId, subFormFieldRuleAction.groupId); + } + + @Override + public int hashCode() { + return Objects.hash(hidden, type, fieldId, groupId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldRuleAction {\n"); + sb.append(" hidden: ").append(toIndentedString(hidden)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fieldId: ").append(toIndentedString(fieldId)).append("\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (hidden != null) { + if (isFileTypeOrListOfFiles(hidden)) { + fileTypeFound = true; + } - /** - * **group_id** or **field_id** is required, but not both. Must reference the ID of an existing - * group defined within `form_field_groups`. Cannot use with `field_id`. - * Trigger and action fields and groups must belong to the same signer. - * - * @return groupId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGroupId() { - return groupId; + if (hidden.getClass().equals(java.io.File.class) || + hidden.getClass().equals(Integer.class) || + hidden.getClass().equals(String.class) || + hidden.getClass().isEnum()) { + map.put("hidden", hidden); + } else if (isListOfFile(hidden)) { + for(int i = 0; i< getListSize(hidden); i++) { + map.put("hidden[" + i + "]", getFromList(hidden, i)); + } + } + else { + map.put("hidden", JSON.getDefault().getMapper().writeValueAsString(hidden)); + } } + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_GROUP_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroupId(@javax.annotation.Nullable String groupId) { - this.groupId = groupId; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (fieldId != null) { + if (isFileTypeOrListOfFiles(fieldId)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldRuleAction object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (fieldId.getClass().equals(java.io.File.class) || + fieldId.getClass().equals(Integer.class) || + fieldId.getClass().equals(String.class) || + fieldId.getClass().isEnum()) { + map.put("field_id", fieldId); + } else if (isListOfFile(fieldId)) { + for(int i = 0; i< getListSize(fieldId); i++) { + map.put("field_id[" + i + "]", getFromList(fieldId, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("field_id", JSON.getDefault().getMapper().writeValueAsString(fieldId)); } - SubFormFieldRuleAction subFormFieldRuleAction = (SubFormFieldRuleAction) o; - return Objects.equals(this.hidden, subFormFieldRuleAction.hidden) - && Objects.equals(this.type, subFormFieldRuleAction.type) - && Objects.equals(this.fieldId, subFormFieldRuleAction.fieldId) - && Objects.equals(this.groupId, subFormFieldRuleAction.groupId); } + if (groupId != null) { + if (isFileTypeOrListOfFiles(groupId)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(hidden, type, fieldId, groupId); + if (groupId.getClass().equals(java.io.File.class) || + groupId.getClass().equals(Integer.class) || + groupId.getClass().equals(String.class) || + groupId.getClass().isEnum()) { + map.put("group_id", groupId); + } else if (isListOfFile(groupId)) { + for(int i = 0; i< getListSize(groupId); i++) { + map.put("group_id[" + i + "]", getFromList(groupId, i)); + } + } + else { + map.put("group_id", JSON.getDefault().getMapper().writeValueAsString(groupId)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldRuleAction {\n"); - sb.append(" hidden: ").append(toIndentedString(hidden)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" fieldId: ").append(toIndentedString(fieldId)).append("\n"); - sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (hidden != null) { - if (isFileTypeOrListOfFiles(hidden)) { - fileTypeFound = true; - } - - if (hidden.getClass().equals(java.io.File.class) - || hidden.getClass().equals(Integer.class) - || hidden.getClass().equals(String.class) - || hidden.getClass().isEnum()) { - map.put("hidden", hidden); - } else if (isListOfFile(hidden)) { - for (int i = 0; i < getListSize(hidden); i++) { - map.put("hidden[" + i + "]", getFromList(hidden, i)); - } - } else { - map.put("hidden", JSON.getDefault().getMapper().writeValueAsString(hidden)); - } - } - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (fieldId != null) { - if (isFileTypeOrListOfFiles(fieldId)) { - fileTypeFound = true; - } - - if (fieldId.getClass().equals(java.io.File.class) - || fieldId.getClass().equals(Integer.class) - || fieldId.getClass().equals(String.class) - || fieldId.getClass().isEnum()) { - map.put("field_id", fieldId); - } else if (isListOfFile(fieldId)) { - for (int i = 0; i < getListSize(fieldId); i++) { - map.put("field_id[" + i + "]", getFromList(fieldId, i)); - } - } else { - map.put("field_id", JSON.getDefault().getMapper().writeValueAsString(fieldId)); - } - } - if (groupId != null) { - if (isFileTypeOrListOfFiles(groupId)) { - fileTypeFound = true; - } - - if (groupId.getClass().equals(java.io.File.class) - || groupId.getClass().equals(Integer.class) - || groupId.getClass().equals(String.class) - || groupId.getClass().isEnum()) { - map.put("group_id", groupId); - } else if (isListOfFile(groupId)) { - for (int i = 0; i < getListSize(groupId); i++) { - map.put("group_id[" + i + "]", getFromList(groupId, i)); - } - } else { - map.put("group_id", JSON.getDefault().getMapper().writeValueAsString(groupId)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java index d421a5926..41badae80 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java @@ -10,373 +10,374 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** SubFormFieldRuleTrigger */ + +import com.dropbox.sign.ApiException; +/** + * SubFormFieldRuleTrigger + */ @JsonPropertyOrder({ - SubFormFieldRuleTrigger.JSON_PROPERTY_ID, - SubFormFieldRuleTrigger.JSON_PROPERTY_OPERATOR, - SubFormFieldRuleTrigger.JSON_PROPERTY_VALUE, - SubFormFieldRuleTrigger.JSON_PROPERTY_VALUES + SubFormFieldRuleTrigger.JSON_PROPERTY_ID, + SubFormFieldRuleTrigger.JSON_PROPERTY_OPERATOR, + SubFormFieldRuleTrigger.JSON_PROPERTY_VALUE, + SubFormFieldRuleTrigger.JSON_PROPERTY_VALUES }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubFormFieldRuleTrigger { - public static final String JSON_PROPERTY_ID = "id"; - @javax.annotation.Nonnull private String id; - - /** - * Different field types allow different `operator` values: - Field type of **text**: - * - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. - * Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of - * **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - - * **any**: exact match, array of values. - **none**: not exact match, array of values. - Field - * type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single - * value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact - * match, single value - */ - public enum OperatorEnum { - ANY(String.valueOf("any")), - - IS(String.valueOf("is")), - - MATCH(String.valueOf("match")), - - NONE(String.valueOf("none")), - - NOT(String.valueOf("not")); - - private String value; - - OperatorEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OperatorEnum fromValue(String value) { - for (OperatorEnum b : OperatorEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nonnull + private String id; + + /** + * Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value + */ + public enum OperatorEnum { + ANY(String.valueOf("any")), + + IS(String.valueOf("is")), + + MATCH(String.valueOf("match")), + + NONE(String.valueOf("none")), + + NOT(String.valueOf("not")); + + private String value; + + OperatorEnum(String value) { + this.value = value; } - public static final String JSON_PROPERTY_OPERATOR = "operator"; - @javax.annotation.Nonnull private OperatorEnum operator; - - public static final String JSON_PROPERTY_VALUE = "value"; - @javax.annotation.Nullable private String value; - - public static final String JSON_PROPERTY_VALUES = "values"; - @javax.annotation.Nullable private List values = null; - - public SubFormFieldRuleTrigger() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldRuleTrigger init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldRuleTrigger.class); - } - - public static SubFormFieldRuleTrigger init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), SubFormFieldRuleTrigger.class); - } - - public SubFormFieldRuleTrigger id(@javax.annotation.Nonnull String id) { - this.id = id; - return this; - } - - /** - * Must reference the `api_id` of an existing field defined within - * `form_fields_per_document`. Trigger and action fields and groups must belong to the - * same signer. - * - * @return id - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setId(@javax.annotation.Nonnull String id) { - this.id = id; - } - - public SubFormFieldRuleTrigger operator(@javax.annotation.Nonnull OperatorEnum operator) { - this.operator = operator; - return this; + @JsonValue + public String getValue() { + return value; } - /** - * Different field types allow different `operator` values: - Field type of **text**: - * - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. - * Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of - * **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - - * **any**: exact match, array of values. - **none**: not exact match, array of values. - Field - * type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single - * value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact - * match, single value - * - * @return operator - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_OPERATOR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OperatorEnum getOperator() { - return operator; + @Override + public String toString() { + return String.valueOf(value); } - @JsonProperty(JSON_PROPERTY_OPERATOR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setOperator(@javax.annotation.Nonnull OperatorEnum operator) { - this.operator = operator; + @JsonCreator + public static OperatorEnum fromValue(String value) { + for (OperatorEnum b : OperatorEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - public SubFormFieldRuleTrigger value(@javax.annotation.Nullable String value) { - this.value = value; - return this; + } + + public static final String JSON_PROPERTY_OPERATOR = "operator"; + @javax.annotation.Nonnull + private OperatorEnum operator; + + public static final String JSON_PROPERTY_VALUE = "value"; + @javax.annotation.Nullable + private String value; + + public static final String JSON_PROPERTY_VALUES = "values"; + @javax.annotation.Nullable + private List values = null; + + public SubFormFieldRuleTrigger() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldRuleTrigger init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldRuleTrigger.class); + } + + static public SubFormFieldRuleTrigger init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldRuleTrigger.class + ); + } + + public SubFormFieldRuleTrigger id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public SubFormFieldRuleTrigger operator(@javax.annotation.Nonnull OperatorEnum operator) { + this.operator = operator; + return this; + } + + /** + * Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value + * @return operator + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OperatorEnum getOperator() { + return operator; + } + + + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOperator(@javax.annotation.Nonnull OperatorEnum operator) { + this.operator = operator; + } + + + public SubFormFieldRuleTrigger value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * **value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1` + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + public SubFormFieldRuleTrigger values(@javax.annotation.Nullable List values) { + this.values = values; + return this; + } + + public SubFormFieldRuleTrigger addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); } - - /** - * **value** or **values** is required, but not both. The value to match against **operator**. - - * When **operator** is one of the following, **value** must be `String`: - - * `is` - `not` - `match` Otherwise, - **checkbox**: When **type** - * of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: - * When **type** of trigger is **radio**, **value** must be `1` - * - * @return value - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValue() { - return value; + this.values.add(valuesItem); + return this; + } + + /** + * **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none` + * @return values + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getValues() { + return values; + } + + + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValues(@javax.annotation.Nullable List values) { + this.values = values; + } + + + /** + * Return true if this SubFormFieldRuleTrigger object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(@javax.annotation.Nullable String value) { - this.value = value; + if (o == null || getClass() != o.getClass()) { + return false; } - - public SubFormFieldRuleTrigger values(@javax.annotation.Nullable List values) { - this.values = values; - return this; - } - - public SubFormFieldRuleTrigger addValuesItem(String valuesItem) { - if (this.values == null) { - this.values = new ArrayList<>(); + SubFormFieldRuleTrigger subFormFieldRuleTrigger = (SubFormFieldRuleTrigger) o; + return Objects.equals(this.id, subFormFieldRuleTrigger.id) && + Objects.equals(this.operator, subFormFieldRuleTrigger.operator) && + Objects.equals(this.value, subFormFieldRuleTrigger.value) && + Objects.equals(this.values, subFormFieldRuleTrigger.values); + } + + @Override + public int hashCode() { + return Objects.hash(id, operator, value, values); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldRuleTrigger {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (id != null) { + if (isFileTypeOrListOfFiles(id)) { + fileTypeFound = true; } - this.values.add(valuesItem); - return this; - } - /** - * **values** or **value** is required, but not both. The values to match against **operator** - * when it is one of the following: - `any` - `none` - * - * @return values - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getValues() { - return values; + if (id.getClass().equals(java.io.File.class) || + id.getClass().equals(Integer.class) || + id.getClass().equals(String.class) || + id.getClass().isEnum()) { + map.put("id", id); + } else if (isListOfFile(id)) { + for(int i = 0; i< getListSize(id); i++) { + map.put("id[" + i + "]", getFromList(id, i)); + } + } + else { + map.put("id", JSON.getDefault().getMapper().writeValueAsString(id)); + } } + if (operator != null) { + if (isFileTypeOrListOfFiles(operator)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_VALUES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValues(@javax.annotation.Nullable List values) { - this.values = values; + if (operator.getClass().equals(java.io.File.class) || + operator.getClass().equals(Integer.class) || + operator.getClass().equals(String.class) || + operator.getClass().isEnum()) { + map.put("operator", operator); + } else if (isListOfFile(operator)) { + for(int i = 0; i< getListSize(operator); i++) { + map.put("operator[" + i + "]", getFromList(operator, i)); + } + } + else { + map.put("operator", JSON.getDefault().getMapper().writeValueAsString(operator)); + } } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldRuleTrigger object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (value.getClass().equals(java.io.File.class) || + value.getClass().equals(Integer.class) || + value.getClass().equals(String.class) || + value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for(int i = 0; i< getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); } - SubFormFieldRuleTrigger subFormFieldRuleTrigger = (SubFormFieldRuleTrigger) o; - return Objects.equals(this.id, subFormFieldRuleTrigger.id) - && Objects.equals(this.operator, subFormFieldRuleTrigger.operator) - && Objects.equals(this.value, subFormFieldRuleTrigger.value) - && Objects.equals(this.values, subFormFieldRuleTrigger.values); } + if (values != null) { + if (isFileTypeOrListOfFiles(values)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(id, operator, value, values); + if (values.getClass().equals(java.io.File.class) || + values.getClass().equals(Integer.class) || + values.getClass().equals(String.class) || + values.getClass().isEnum()) { + map.put("values", values); + } else if (isListOfFile(values)) { + for(int i = 0; i< getListSize(values); i++) { + map.put("values[" + i + "]", getFromList(values, i)); + } + } + else { + map.put("values", JSON.getDefault().getMapper().writeValueAsString(values)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldRuleTrigger {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" values: ").append(toIndentedString(values)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (id != null) { - if (isFileTypeOrListOfFiles(id)) { - fileTypeFound = true; - } - - if (id.getClass().equals(java.io.File.class) - || id.getClass().equals(Integer.class) - || id.getClass().equals(String.class) - || id.getClass().isEnum()) { - map.put("id", id); - } else if (isListOfFile(id)) { - for (int i = 0; i < getListSize(id); i++) { - map.put("id[" + i + "]", getFromList(id, i)); - } - } else { - map.put("id", JSON.getDefault().getMapper().writeValueAsString(id)); - } - } - if (operator != null) { - if (isFileTypeOrListOfFiles(operator)) { - fileTypeFound = true; - } - - if (operator.getClass().equals(java.io.File.class) - || operator.getClass().equals(Integer.class) - || operator.getClass().equals(String.class) - || operator.getClass().isEnum()) { - map.put("operator", operator); - } else if (isListOfFile(operator)) { - for (int i = 0; i < getListSize(operator); i++) { - map.put("operator[" + i + "]", getFromList(operator, i)); - } - } else { - map.put("operator", JSON.getDefault().getMapper().writeValueAsString(operator)); - } - } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - - if (value.getClass().equals(java.io.File.class) - || value.getClass().equals(Integer.class) - || value.getClass().equals(String.class) - || value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for (int i = 0; i < getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); - } - } - if (values != null) { - if (isFileTypeOrListOfFiles(values)) { - fileTypeFound = true; - } - - if (values.getClass().equals(java.io.File.class) - || values.getClass().equals(Integer.class) - || values.getClass().equals(String.class) - || values.getClass().isEnum()) { - map.put("values", values); - } else if (isListOfFile(values)) { - for (int i = 0; i < getListSize(values); i++) { - map.put("values[" + i + "]", getFromList(values, i)); - } - } else { - map.put("values", JSON.getDefault().getMapper().writeValueAsString(values)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java index 34bfc8529..d7555f5e1 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java @@ -10,706 +10,724 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; + +import com.dropbox.sign.ApiException; /** - * The fields that should appear on the document, expressed as an array of objects. (For more - * details you can read about it here: [Using Form Fields per - * Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, - * **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. - * Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) - * for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field - * use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use - * `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use - * `SubFormFieldsPerDocumentCheckbox` * Radio Field use - * `SubFormFieldsPerDocumentRadio` * Signature Field use - * `SubFormFieldsPerDocumentSignature` * Date Signed Field use - * `SubFormFieldsPerDocumentDateSigned` * Initials Field use - * `SubFormFieldsPerDocumentInitials` * Text Merge Field use - * `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use - * `SubFormFieldsPerDocumentCheckboxMerge` + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` */ @JsonPropertyOrder({ - SubFormFieldsPerDocumentBase.JSON_PROPERTY_DOCUMENT_INDEX, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_API_ID, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_HEIGHT, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_REQUIRED, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_SIGNER, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_WIDTH, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_X, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_Y, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_NAME, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_PAGE + SubFormFieldsPerDocumentBase.JSON_PROPERTY_DOCUMENT_INDEX, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_API_ID, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_HEIGHT, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_REQUIRED, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_SIGNER, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_WIDTH, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_X, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_Y, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_NAME, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_PAGE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type( - value = SubFormFieldsPerDocumentCheckboxMerge.class, - name = "checkbox-merge"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "text"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "text-merge"), + @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), + @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "checkbox-merge"), + @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), + @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "dropdown"), + @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "hyperlink"), + @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "initials"), + @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "radio"), + @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "signature"), + @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "text"), + @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "text-merge"), }) -public class SubFormFieldsPerDocumentBase { - public static final String JSON_PROPERTY_DOCUMENT_INDEX = "document_index"; - @javax.annotation.Nonnull private Integer documentIndex; - - public static final String JSON_PROPERTY_API_ID = "api_id"; - @javax.annotation.Nonnull private String apiId; - - public static final String JSON_PROPERTY_HEIGHT = "height"; - @javax.annotation.Nonnull private Integer height; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - @javax.annotation.Nonnull private Boolean required; - - public static final String JSON_PROPERTY_SIGNER = "signer"; - @javax.annotation.Nonnull private String signer; - - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type; - - public static final String JSON_PROPERTY_WIDTH = "width"; - @javax.annotation.Nonnull private Integer width; - - public static final String JSON_PROPERTY_X = "x"; - @javax.annotation.Nonnull private Integer x; - - public static final String JSON_PROPERTY_Y = "y"; - @javax.annotation.Nonnull private Integer y; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_PAGE = "page"; - @javax.annotation.Nullable private Integer page; - - public SubFormFieldsPerDocumentBase() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldsPerDocumentBase init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentBase.class); - } - - public static SubFormFieldsPerDocumentBase init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentBase.class); - } - - public SubFormFieldsPerDocumentBase documentIndex( - @javax.annotation.Nonnull Integer documentIndex) { - this.documentIndex = documentIndex; - return this; - } - - /** - * Represents the integer index of the `file` or `file_url` document the - * field should be attached to. - * - * @return documentIndex - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_DOCUMENT_INDEX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getDocumentIndex() { - return documentIndex; - } - - @JsonProperty(JSON_PROPERTY_DOCUMENT_INDEX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDocumentIndex(@javax.annotation.Nonnull Integer documentIndex) { - this.documentIndex = documentIndex; - } - - public SubFormFieldsPerDocumentBase apiId(@javax.annotation.Nonnull String apiId) { - this.apiId = apiId; - return this; - } - - /** - * An identifier for the field that is unique across all documents in the request. - * - * @return apiId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getApiId() { - return apiId; - } - - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setApiId(@javax.annotation.Nonnull String apiId) { - this.apiId = apiId; - } - - public SubFormFieldsPerDocumentBase height(@javax.annotation.Nonnull Integer height) { - this.height = height; - return this; - } - - /** - * Size of the field in pixels. - * - * @return height - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getHeight() { - return height; - } - - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setHeight(@javax.annotation.Nonnull Integer height) { - this.height = height; - } - - public SubFormFieldsPerDocumentBase required(@javax.annotation.Nonnull Boolean required) { - this.required = required; - return this; - } - - /** - * Whether this field is required. - * - * @return required - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getRequired() { - return required; - } - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRequired(@javax.annotation.Nonnull Boolean required) { - this.required = required; - } - - public SubFormFieldsPerDocumentBase signer(@javax.annotation.Nonnull String signer) { - this.signer = signer; - return this; - } - - public SubFormFieldsPerDocumentBase signer(Integer signer) { - this.signer = String.valueOf(signer); - return this; - } - - /** - * Signer index identified by the offset in the signers parameter (0-based indexing), indicating - * which signer should fill out the field. **NOTE:** To set the value of the field as the - * preparer you must set this to `me_now` **NOTE:** If type is `text-merge` - * or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - * - * @return signer - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getSigner() { - return signer; - } - - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSigner(@javax.annotation.Nonnull String signer) { - this.signer = signer; - } - - public void setSigner(Integer signer) { - this.signer = String.valueOf(signer); - } - - public SubFormFieldsPerDocumentBase type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public SubFormFieldsPerDocumentBase width(@javax.annotation.Nonnull Integer width) { - this.width = width; - return this; - } - - /** - * Size of the field in pixels. - * - * @return width - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getWidth() { - return width; - } - - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setWidth(@javax.annotation.Nonnull Integer width) { - this.width = width; - } - public SubFormFieldsPerDocumentBase x(@javax.annotation.Nonnull Integer x) { - this.x = x; - return this; - } - - /** - * Location coordinates of the field in pixels. - * - * @return x - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getX() { - return x; - } - - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setX(@javax.annotation.Nonnull Integer x) { - this.x = x; - } - - public SubFormFieldsPerDocumentBase y(@javax.annotation.Nonnull Integer y) { - this.y = y; - return this; - } - - /** - * Location coordinates of the field in pixels. - * - * @return y - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getY() { - return y; - } - - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setY(@javax.annotation.Nonnull Integer y) { - this.y = y; - } - - public SubFormFieldsPerDocumentBase name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * Display name for the field. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public SubFormFieldsPerDocumentBase page(@javax.annotation.Nullable Integer page) { - this.page = page; - return this; - } - - /** - * Page in the document where the field should be placed (requires documents be PDF files). - - * When the page number parameter is supplied, the API will use the new coordinate system. - - * Check out the differences between both [coordinate - * systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. - * - * @return page - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getPage() { - return page; - } - - @JsonProperty(JSON_PROPERTY_PAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPage(@javax.annotation.Nullable Integer page) { - this.page = page; - } +public class SubFormFieldsPerDocumentBase { + public static final String JSON_PROPERTY_DOCUMENT_INDEX = "document_index"; + @javax.annotation.Nonnull + private Integer documentIndex; + + public static final String JSON_PROPERTY_API_ID = "api_id"; + @javax.annotation.Nonnull + private String apiId; + + public static final String JSON_PROPERTY_HEIGHT = "height"; + @javax.annotation.Nonnull + private Integer height; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + @javax.annotation.Nonnull + private Boolean required; + + public static final String JSON_PROPERTY_SIGNER = "signer"; + @javax.annotation.Nonnull + private String signer; + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type; + + public static final String JSON_PROPERTY_WIDTH = "width"; + @javax.annotation.Nonnull + private Integer width; + + public static final String JSON_PROPERTY_X = "x"; + @javax.annotation.Nonnull + private Integer x; + + public static final String JSON_PROPERTY_Y = "y"; + @javax.annotation.Nonnull + private Integer y; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PAGE = "page"; + @javax.annotation.Nullable + private Integer page; + + public SubFormFieldsPerDocumentBase() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldsPerDocumentBase init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentBase.class); + } + + static public SubFormFieldsPerDocumentBase init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentBase.class + ); + } + + public SubFormFieldsPerDocumentBase documentIndex(@javax.annotation.Nonnull Integer documentIndex) { + this.documentIndex = documentIndex; + return this; + } + + /** + * Represents the integer index of the `file` or `file_url` document the field should be attached to. + * @return documentIndex + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOCUMENT_INDEX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getDocumentIndex() { + return documentIndex; + } + + + @JsonProperty(JSON_PROPERTY_DOCUMENT_INDEX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDocumentIndex(@javax.annotation.Nonnull Integer documentIndex) { + this.documentIndex = documentIndex; + } + + + public SubFormFieldsPerDocumentBase apiId(@javax.annotation.Nonnull String apiId) { + this.apiId = apiId; + return this; + } + + /** + * An identifier for the field that is unique across all documents in the request. + * @return apiId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getApiId() { + return apiId; + } + + + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setApiId(@javax.annotation.Nonnull String apiId) { + this.apiId = apiId; + } + + + public SubFormFieldsPerDocumentBase height(@javax.annotation.Nonnull Integer height) { + this.height = height; + return this; + } + + /** + * Size of the field in pixels. + * @return height + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getHeight() { + return height; + } + + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHeight(@javax.annotation.Nonnull Integer height) { + this.height = height; + } + + + public SubFormFieldsPerDocumentBase required(@javax.annotation.Nonnull Boolean required) { + this.required = required; + return this; + } + + /** + * Whether this field is required. + * @return required + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getRequired() { + return required; + } + + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequired(@javax.annotation.Nonnull Boolean required) { + this.required = required; + } + + + public SubFormFieldsPerDocumentBase signer(@javax.annotation.Nonnull String signer) { + this.signer = signer; + return this; + } + public SubFormFieldsPerDocumentBase signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } + + /** + * Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. + * @return signer + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSigner() { + return signer; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigner(@javax.annotation.Nonnull String signer) { + this.signer = signer; + } + + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + + + public SubFormFieldsPerDocumentBase type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SubFormFieldsPerDocumentBase width(@javax.annotation.Nonnull Integer width) { + this.width = width; + return this; + } + + /** + * Size of the field in pixels. + * @return width + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getWidth() { + return width; + } + + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWidth(@javax.annotation.Nonnull Integer width) { + this.width = width; + } + + + public SubFormFieldsPerDocumentBase x(@javax.annotation.Nonnull Integer x) { + this.x = x; + return this; + } + + /** + * Location coordinates of the field in pixels. + * @return x + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getX() { + return x; + } + + + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setX(@javax.annotation.Nonnull Integer x) { + this.x = x; + } + + + public SubFormFieldsPerDocumentBase y(@javax.annotation.Nonnull Integer y) { + this.y = y; + return this; + } + + /** + * Location coordinates of the field in pixels. + * @return y + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getY() { + return y; + } + + + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setY(@javax.annotation.Nonnull Integer y) { + this.y = y; + } + + + public SubFormFieldsPerDocumentBase name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Display name for the field. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SubFormFieldsPerDocumentBase page(@javax.annotation.Nullable Integer page) { + this.page = page; + return this; + } + + /** + * Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. + * @return page + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getPage() { + return page; + } + + + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPage(@javax.annotation.Nullable Integer page) { + this.page = page; + } + + + /** + * Return true if this SubFormFieldsPerDocumentBase object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubFormFieldsPerDocumentBase subFormFieldsPerDocumentBase = (SubFormFieldsPerDocumentBase) o; + return Objects.equals(this.documentIndex, subFormFieldsPerDocumentBase.documentIndex) && + Objects.equals(this.apiId, subFormFieldsPerDocumentBase.apiId) && + Objects.equals(this.height, subFormFieldsPerDocumentBase.height) && + Objects.equals(this.required, subFormFieldsPerDocumentBase.required) && + Objects.equals(this.signer, subFormFieldsPerDocumentBase.signer) && + Objects.equals(this.type, subFormFieldsPerDocumentBase.type) && + Objects.equals(this.width, subFormFieldsPerDocumentBase.width) && + Objects.equals(this.x, subFormFieldsPerDocumentBase.x) && + Objects.equals(this.y, subFormFieldsPerDocumentBase.y) && + Objects.equals(this.name, subFormFieldsPerDocumentBase.name) && + Objects.equals(this.page, subFormFieldsPerDocumentBase.page); + } + + @Override + public int hashCode() { + return Objects.hash(documentIndex, apiId, height, required, signer, type, width, x, y, name, page); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentBase {\n"); + sb.append(" documentIndex: ").append(toIndentedString(documentIndex)).append("\n"); + sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (documentIndex != null) { + if (isFileTypeOrListOfFiles(documentIndex)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldsPerDocumentBase object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubFormFieldsPerDocumentBase subFormFieldsPerDocumentBase = - (SubFormFieldsPerDocumentBase) o; - return Objects.equals(this.documentIndex, subFormFieldsPerDocumentBase.documentIndex) - && Objects.equals(this.apiId, subFormFieldsPerDocumentBase.apiId) - && Objects.equals(this.height, subFormFieldsPerDocumentBase.height) - && Objects.equals(this.required, subFormFieldsPerDocumentBase.required) - && Objects.equals(this.signer, subFormFieldsPerDocumentBase.signer) - && Objects.equals(this.type, subFormFieldsPerDocumentBase.type) - && Objects.equals(this.width, subFormFieldsPerDocumentBase.width) - && Objects.equals(this.x, subFormFieldsPerDocumentBase.x) - && Objects.equals(this.y, subFormFieldsPerDocumentBase.y) - && Objects.equals(this.name, subFormFieldsPerDocumentBase.name) - && Objects.equals(this.page, subFormFieldsPerDocumentBase.page); + if (documentIndex.getClass().equals(java.io.File.class) || + documentIndex.getClass().equals(Integer.class) || + documentIndex.getClass().equals(String.class) || + documentIndex.getClass().isEnum()) { + map.put("document_index", documentIndex); + } else if (isListOfFile(documentIndex)) { + for(int i = 0; i< getListSize(documentIndex); i++) { + map.put("document_index[" + i + "]", getFromList(documentIndex, i)); + } + } + else { + map.put("document_index", JSON.getDefault().getMapper().writeValueAsString(documentIndex)); + } } + if (apiId != null) { + if (isFileTypeOrListOfFiles(apiId)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - documentIndex, apiId, height, required, signer, type, width, x, y, name, page); + if (apiId.getClass().equals(java.io.File.class) || + apiId.getClass().equals(Integer.class) || + apiId.getClass().equals(String.class) || + apiId.getClass().isEnum()) { + map.put("api_id", apiId); + } else if (isListOfFile(apiId)) { + for(int i = 0; i< getListSize(apiId); i++) { + map.put("api_id[" + i + "]", getFromList(apiId, i)); + } + } + else { + map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + } } + if (height != null) { + if (isFileTypeOrListOfFiles(height)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentBase {\n"); - sb.append(" documentIndex: ").append(toIndentedString(documentIndex)).append("\n"); - sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); - sb.append(" height: ").append(toIndentedString(height)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" width: ").append(toIndentedString(width)).append("\n"); - sb.append(" x: ").append(toIndentedString(x)).append("\n"); - sb.append(" y: ").append(toIndentedString(y)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append("}"); - return sb.toString(); + if (height.getClass().equals(java.io.File.class) || + height.getClass().equals(Integer.class) || + height.getClass().equals(String.class) || + height.getClass().isEnum()) { + map.put("height", height); + } else if (isListOfFile(height)) { + for(int i = 0; i< getListSize(height); i++) { + map.put("height[" + i + "]", getFromList(height, i)); + } + } + else { + map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); + } } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (documentIndex != null) { - if (isFileTypeOrListOfFiles(documentIndex)) { - fileTypeFound = true; - } - - if (documentIndex.getClass().equals(java.io.File.class) - || documentIndex.getClass().equals(Integer.class) - || documentIndex.getClass().equals(String.class) - || documentIndex.getClass().isEnum()) { - map.put("document_index", documentIndex); - } else if (isListOfFile(documentIndex)) { - for (int i = 0; i < getListSize(documentIndex); i++) { - map.put("document_index[" + i + "]", getFromList(documentIndex, i)); - } - } else { - map.put( - "document_index", - JSON.getDefault().getMapper().writeValueAsString(documentIndex)); - } - } - if (apiId != null) { - if (isFileTypeOrListOfFiles(apiId)) { - fileTypeFound = true; - } - - if (apiId.getClass().equals(java.io.File.class) - || apiId.getClass().equals(Integer.class) - || apiId.getClass().equals(String.class) - || apiId.getClass().isEnum()) { - map.put("api_id", apiId); - } else if (isListOfFile(apiId)) { - for (int i = 0; i < getListSize(apiId); i++) { - map.put("api_id[" + i + "]", getFromList(apiId, i)); - } - } else { - map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); - } - } - if (height != null) { - if (isFileTypeOrListOfFiles(height)) { - fileTypeFound = true; - } - - if (height.getClass().equals(java.io.File.class) - || height.getClass().equals(Integer.class) - || height.getClass().equals(String.class) - || height.getClass().isEnum()) { - map.put("height", height); - } else if (isListOfFile(height)) { - for (int i = 0; i < getListSize(height); i++) { - map.put("height[" + i + "]", getFromList(height, i)); - } - } else { - map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); - } + if (required.getClass().equals(java.io.File.class) || + required.getClass().equals(Integer.class) || + required.getClass().equals(String.class) || + required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for(int i = 0; i< getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - - if (required.getClass().equals(java.io.File.class) - || required.getClass().equals(Integer.class) - || required.getClass().equals(String.class) - || required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for (int i = 0; i < getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } - } - if (signer != null) { - if (isFileTypeOrListOfFiles(signer)) { - fileTypeFound = true; - } - - if (signer.getClass().equals(java.io.File.class) - || signer.getClass().equals(Integer.class) - || signer.getClass().equals(String.class) - || signer.getClass().isEnum()) { - map.put("signer", signer); - } else if (isListOfFile(signer)) { - for (int i = 0; i < getListSize(signer); i++) { - map.put("signer[" + i + "]", getFromList(signer, i)); - } - } else { - map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); - } - } - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (width != null) { - if (isFileTypeOrListOfFiles(width)) { - fileTypeFound = true; - } - - if (width.getClass().equals(java.io.File.class) - || width.getClass().equals(Integer.class) - || width.getClass().equals(String.class) - || width.getClass().isEnum()) { - map.put("width", width); - } else if (isListOfFile(width)) { - for (int i = 0; i < getListSize(width); i++) { - map.put("width[" + i + "]", getFromList(width, i)); - } - } else { - map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); - } - } - if (x != null) { - if (isFileTypeOrListOfFiles(x)) { - fileTypeFound = true; - } - - if (x.getClass().equals(java.io.File.class) - || x.getClass().equals(Integer.class) - || x.getClass().equals(String.class) - || x.getClass().isEnum()) { - map.put("x", x); - } else if (isListOfFile(x)) { - for (int i = 0; i < getListSize(x); i++) { - map.put("x[" + i + "]", getFromList(x, i)); - } - } else { - map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); - } - } - if (y != null) { - if (isFileTypeOrListOfFiles(y)) { - fileTypeFound = true; - } - - if (y.getClass().equals(java.io.File.class) - || y.getClass().equals(Integer.class) - || y.getClass().equals(String.class) - || y.getClass().isEnum()) { - map.put("y", y); - } else if (isListOfFile(y)) { - for (int i = 0; i < getListSize(y); i++) { - map.put("y[" + i + "]", getFromList(y, i)); - } - } else { - map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (page != null) { - if (isFileTypeOrListOfFiles(page)) { - fileTypeFound = true; - } - - if (page.getClass().equals(java.io.File.class) - || page.getClass().equals(Integer.class) - || page.getClass().equals(String.class) - || page.getClass().isEnum()) { - map.put("page", page); - } else if (isListOfFile(page)) { - for (int i = 0; i < getListSize(page); i++) { - map.put("page[" + i + "]", getFromList(page, i)); - } - } else { - map.put("page", JSON.getDefault().getMapper().writeValueAsString(page)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } } + if (signer != null) { + if (isFileTypeOrListOfFiles(signer)) { + fileTypeFound = true; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + if (signer.getClass().equals(java.io.File.class) || + signer.getClass().equals(Integer.class) || + signer.getClass().equals(String.class) || + signer.getClass().isEnum()) { + map.put("signer", signer); + } else if (isListOfFile(signer)) { + for(int i = 0; i< getListSize(signer); i++) { + map.put("signer[" + i + "]", getFromList(signer, i)); + } + } + else { + map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); + } } + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (width != null) { + if (isFileTypeOrListOfFiles(width)) { + fileTypeFound = true; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + if (width.getClass().equals(java.io.File.class) || + width.getClass().equals(Integer.class) || + width.getClass().equals(String.class) || + width.getClass().isEnum()) { + map.put("width", width); + } else if (isListOfFile(width)) { + for(int i = 0; i< getListSize(width); i++) { + map.put("width[" + i + "]", getFromList(width, i)); + } + } + else { + map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); + } } + if (x != null) { + if (isFileTypeOrListOfFiles(x)) { + fileTypeFound = true; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); + if (x.getClass().equals(java.io.File.class) || + x.getClass().equals(Integer.class) || + x.getClass().equals(String.class) || + x.getClass().isEnum()) { + map.put("x", x); + } else if (isListOfFile(x)) { + for(int i = 0; i< getListSize(x); i++) { + map.put("x[" + i + "]", getFromList(x, i)); + } + } + else { + map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); + } } + if (y != null) { + if (isFileTypeOrListOfFiles(y)) { + fileTypeFound = true; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + if (y.getClass().equals(java.io.File.class) || + y.getClass().equals(Integer.class) || + y.getClass().equals(String.class) || + y.getClass().isEnum()) { + map.put("y", y); + } else if (isListOfFile(y)) { + for(int i = 0; i< getListSize(y); i++) { + map.put("y[" + i + "]", getFromList(y, i)); + } + } + else { + map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** - * 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"; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); } - return o.toString().replace("\n", "\n "); } + if (page != null) { + if (isFileTypeOrListOfFiles(page)) { + fileTypeFound = true; + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("initials", SubFormFieldsPerDocumentInitials.class); - mappings.put("radio", SubFormFieldsPerDocumentRadio.class); - mappings.put("signature", SubFormFieldsPerDocumentSignature.class); - mappings.put("text", SubFormFieldsPerDocumentText.class); - mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("SubFormFieldsPerDocumentBase", SubFormFieldsPerDocumentBase.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentBase.class, "type", mappings); + if (page.getClass().equals(java.io.File.class) || + page.getClass().equals(Integer.class) || + page.getClass().equals(String.class) || + page.getClass().isEnum()) { + map.put("page", page); + } else if (isListOfFile(page)) { + for(int i = 0; i< getListSize(page); i++) { + map.put("page[" + i + "]", getFromList(page, i)); + } + } + else { + map.put("page", JSON.getDefault().getMapper().writeValueAsString(page)); + } } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); + mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); + mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); + mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); + mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); + mappings.put("initials", SubFormFieldsPerDocumentInitials.class); + mappings.put("radio", SubFormFieldsPerDocumentRadio.class); + mappings.put("signature", SubFormFieldsPerDocumentSignature.class); + mappings.put("text", SubFormFieldsPerDocumentText.class); + mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); + mappings.put("SubFormFieldsPerDocumentBase", SubFormFieldsPerDocumentBase.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentBase.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java index edfc9ed9d..6935c84fd 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java @@ -10,275 +10,290 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `SubFormFieldsPerDocumentBase`. */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `SubFormFieldsPerDocumentBase`. + */ @JsonPropertyOrder({ - SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_IS_CHECKED, - SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_GROUP + SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_IS_CHECKED, + SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_GROUP }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "checkbox"; - - public static final String JSON_PROPERTY_IS_CHECKED = "is_checked"; - @javax.annotation.Nonnull private Boolean isChecked; - - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nullable private String group; - - public SubFormFieldsPerDocumentCheckbox() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldsPerDocumentCheckbox init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentCheckbox.class); - } - - public static SubFormFieldsPerDocumentCheckbox init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentCheckbox.class); - } - - public SubFormFieldsPerDocumentCheckbox type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public SubFormFieldsPerDocumentCheckbox isChecked(@javax.annotation.Nonnull Boolean isChecked) { - this.isChecked = isChecked; - return this; - } - - /** - * `true` for checking the checkbox field by default, otherwise `false`. - * - * @return isChecked - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_IS_CHECKED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getIsChecked() { - return isChecked; - } - - @JsonProperty(JSON_PROPERTY_IS_CHECKED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setIsChecked(@javax.annotation.Nonnull Boolean isChecked) { - this.isChecked = isChecked; - } - - public SubFormFieldsPerDocumentCheckbox group(@javax.annotation.Nullable String group) { - this.group = group; - return this; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - /** - * String referencing group defined in `form_field_groups` parameter. - * - * @return group - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGroup() { - return group; +public class SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "checkbox"; + + public static final String JSON_PROPERTY_IS_CHECKED = "is_checked"; + @javax.annotation.Nonnull + private Boolean isChecked; + + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nullable + private String group; + + public SubFormFieldsPerDocumentCheckbox() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldsPerDocumentCheckbox init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentCheckbox.class); + } + + static public SubFormFieldsPerDocumentCheckbox init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentCheckbox.class + ); + } + + public SubFormFieldsPerDocumentCheckbox type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SubFormFieldsPerDocumentCheckbox isChecked(@javax.annotation.Nonnull Boolean isChecked) { + this.isChecked = isChecked; + return this; + } + + /** + * `true` for checking the checkbox field by default, otherwise `false`. + * @return isChecked + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_CHECKED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getIsChecked() { + return isChecked; + } + + + @JsonProperty(JSON_PROPERTY_IS_CHECKED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsChecked(@javax.annotation.Nonnull Boolean isChecked) { + this.isChecked = isChecked; + } + + + public SubFormFieldsPerDocumentCheckbox group(@javax.annotation.Nullable String group) { + this.group = group; + return this; + } + + /** + * String referencing group defined in `form_field_groups` parameter. + * @return group + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(@javax.annotation.Nullable String group) { + this.group = group; + } + + + /** + * Return true if this SubFormFieldsPerDocumentCheckbox object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(@javax.annotation.Nullable String group) { - this.group = group; + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentCheckbox subFormFieldsPerDocumentCheckbox = (SubFormFieldsPerDocumentCheckbox) o; + return Objects.equals(this.type, subFormFieldsPerDocumentCheckbox.type) && + Objects.equals(this.isChecked, subFormFieldsPerDocumentCheckbox.isChecked) && + Objects.equals(this.group, subFormFieldsPerDocumentCheckbox.group) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, isChecked, group, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentCheckbox {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" isChecked: ").append(toIndentedString(isChecked)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldsPerDocumentCheckbox object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SubFormFieldsPerDocumentCheckbox subFormFieldsPerDocumentCheckbox = - (SubFormFieldsPerDocumentCheckbox) o; - return Objects.equals(this.type, subFormFieldsPerDocumentCheckbox.type) - && Objects.equals(this.isChecked, subFormFieldsPerDocumentCheckbox.isChecked) - && Objects.equals(this.group, subFormFieldsPerDocumentCheckbox.group) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, isChecked, group, super.hashCode()); } + if (isChecked != null) { + if (isFileTypeOrListOfFiles(isChecked)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentCheckbox {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" isChecked: ").append(toIndentedString(isChecked)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); + if (isChecked.getClass().equals(java.io.File.class) || + isChecked.getClass().equals(Integer.class) || + isChecked.getClass().equals(String.class) || + isChecked.getClass().isEnum()) { + map.put("is_checked", isChecked); + } else if (isListOfFile(isChecked)) { + for(int i = 0; i< getListSize(isChecked); i++) { + map.put("is_checked[" + i + "]", getFromList(isChecked, i)); + } + } + else { + map.put("is_checked", JSON.getDefault().getMapper().writeValueAsString(isChecked)); + } } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (isChecked != null) { - if (isFileTypeOrListOfFiles(isChecked)) { - fileTypeFound = true; - } - - if (isChecked.getClass().equals(java.io.File.class) - || isChecked.getClass().equals(Integer.class) - || isChecked.getClass().equals(String.class) - || isChecked.getClass().isEnum()) { - map.put("is_checked", isChecked); - } else if (isListOfFile(isChecked)) { - for (int i = 0; i < getListSize(isChecked); i++) { - map.put("is_checked[" + i + "]", getFromList(isChecked, i)); - } - } else { - map.put( - "is_checked", - JSON.getDefault().getMapper().writeValueAsString(isChecked)); - } - } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SubFormFieldsPerDocumentCheckbox", SubFormFieldsPerDocumentCheckbox.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentCheckbox.class, "type", mappings); + /** + * 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 "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentCheckbox", SubFormFieldsPerDocumentCheckbox.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentCheckbox.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java index d414d0c74..bdda17791 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java @@ -10,181 +10,188 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `SubFormFieldsPerDocumentBase`. */ -@JsonPropertyOrder({SubFormFieldsPerDocumentCheckboxMerge.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "checkbox-merge"; - - public SubFormFieldsPerDocumentCheckboxMerge() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldsPerDocumentCheckboxMerge init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentCheckboxMerge.class); - } - public static SubFormFieldsPerDocumentCheckboxMerge init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentCheckboxMerge.class); - } - - public SubFormFieldsPerDocumentCheckboxMerge type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * A checkbox field that has default value set using pre-filled data. Use the - * `SubFormFieldsPerDocumentCheckboxMerge` class. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } +import com.dropbox.sign.ApiException; +/** + * This class extends `SubFormFieldsPerDocumentBase`. + */ +@JsonPropertyOrder({ + SubFormFieldsPerDocumentCheckboxMerge.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } +public class SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "checkbox-merge"; + + public SubFormFieldsPerDocumentCheckboxMerge() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldsPerDocumentCheckboxMerge init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentCheckboxMerge.class); + } + + static public SubFormFieldsPerDocumentCheckboxMerge init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentCheckboxMerge.class + ); + } + + public SubFormFieldsPerDocumentCheckboxMerge type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + /** + * Return true if this SubFormFieldsPerDocumentCheckboxMerge object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubFormFieldsPerDocumentCheckboxMerge subFormFieldsPerDocumentCheckboxMerge = (SubFormFieldsPerDocumentCheckboxMerge) o; + return Objects.equals(this.type, subFormFieldsPerDocumentCheckboxMerge.type) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentCheckboxMerge {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldsPerDocumentCheckboxMerge object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SubFormFieldsPerDocumentCheckboxMerge subFormFieldsPerDocumentCheckboxMerge = - (SubFormFieldsPerDocumentCheckboxMerge) o; - return Objects.equals(this.type, subFormFieldsPerDocumentCheckboxMerge.type) - && super.equals(o); } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentCheckboxMerge {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + /** + * 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 "); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SubFormFieldsPerDocumentCheckboxMerge", - SubFormFieldsPerDocumentCheckboxMerge.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentCheckboxMerge.class, "type", mappings); - } + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentCheckboxMerge", SubFormFieldsPerDocumentCheckboxMerge.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentCheckboxMerge.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java index afb25159e..50beec70f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java @@ -10,344 +10,353 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `SubFormFieldsPerDocumentBase`. */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `SubFormFieldsPerDocumentBase`. + */ @JsonPropertyOrder({ - SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_FONT_FAMILY, - SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_FONT_SIZE + SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_FONT_FAMILY, + SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_FONT_SIZE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "date_signed"; - - /** Font family for the field. */ - public enum FontFamilyEnum { - HELVETICA(String.valueOf("helvetica")), - - ARIAL(String.valueOf("arial")), - - COURIER(String.valueOf("courier")), - - CALIBRI(String.valueOf("calibri")), - - CAMBRIA(String.valueOf("cambria")), - - GEORGIA(String.valueOf("georgia")), - - TIMES(String.valueOf("times")), - - TREBUCHET(String.valueOf("trebuchet")), - - VERDANA(String.valueOf("verdana")), - - ROBOTO(String.valueOf("roboto")), - - ROBOTO_MONO(String.valueOf("robotoMono")), - - NOTO_SANS(String.valueOf("notoSans")), - - NOTO_SERIF(String.valueOf("notoSerif")), - - NOTO_CJK_JP_REGULAR(String.valueOf("notoCJK-JP-Regular")), - - NOTO_HEBREW_REGULAR(String.valueOf("notoHebrew-Regular")), - - NOTO_SAN_THAI_MERGED(String.valueOf("notoSanThaiMerged")); - - private String value; - - FontFamilyEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static FontFamilyEnum fromValue(String value) { - for (FontFamilyEnum b : FontFamilyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; - @javax.annotation.Nullable private FontFamilyEnum fontFamily; - - public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; - @javax.annotation.Nullable private Integer fontSize = 12; - - public SubFormFieldsPerDocumentDateSigned() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldsPerDocumentDateSigned init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentDateSigned.class); - } - - public static SubFormFieldsPerDocumentDateSigned init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentDateSigned.class); - } - - public SubFormFieldsPerDocumentDateSigned type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * A date. Use the `SubFormFieldsPerDocumentDateSigned` class. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public SubFormFieldsPerDocumentDateSigned fontFamily( - @javax.annotation.Nullable FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - return this; +public class SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "date_signed"; + + /** + * Font family for the field. + */ + public enum FontFamilyEnum { + HELVETICA(String.valueOf("helvetica")), + + ARIAL(String.valueOf("arial")), + + COURIER(String.valueOf("courier")), + + CALIBRI(String.valueOf("calibri")), + + CAMBRIA(String.valueOf("cambria")), + + GEORGIA(String.valueOf("georgia")), + + TIMES(String.valueOf("times")), + + TREBUCHET(String.valueOf("trebuchet")), + + VERDANA(String.valueOf("verdana")), + + ROBOTO(String.valueOf("roboto")), + + ROBOTO_MONO(String.valueOf("robotoMono")), + + NOTO_SANS(String.valueOf("notoSans")), + + NOTO_SERIF(String.valueOf("notoSerif")), + + NOTO_CJK_JP_REGULAR(String.valueOf("notoCJK-JP-Regular")), + + NOTO_HEBREW_REGULAR(String.valueOf("notoHebrew-Regular")), + + NOTO_SAN_THAI_MERGED(String.valueOf("notoSanThaiMerged")); + + private String value; + + FontFamilyEnum(String value) { + this.value = value; } - /** - * Font family for the field. - * - * @return fontFamily - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public FontFamilyEnum getFontFamily() { - return fontFamily; + @JsonValue + public String getValue() { + return value; } - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; + @Override + public String toString() { + return String.valueOf(value); } - public SubFormFieldsPerDocumentDateSigned fontSize( - @javax.annotation.Nullable Integer fontSize) { - this.fontSize = fontSize; - return this; + @JsonCreator + public static FontFamilyEnum fromValue(String value) { + for (FontFamilyEnum b : FontFamilyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - /** - * The initial px font size for the field contents. Can be any integer value between - * `7` and `49`. **NOTE:** Font size may be reduced during processing in - * order to fit the contents within the dimensions of the field. - * - * @return fontSize - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getFontSize() { - return fontSize; + } + + public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; + @javax.annotation.Nullable + private FontFamilyEnum fontFamily; + + public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; + @javax.annotation.Nullable + private Integer fontSize = 12; + + public SubFormFieldsPerDocumentDateSigned() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldsPerDocumentDateSigned init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentDateSigned.class); + } + + static public SubFormFieldsPerDocumentDateSigned init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentDateSigned.class + ); + } + + public SubFormFieldsPerDocumentDateSigned type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * A date. Use the `SubFormFieldsPerDocumentDateSigned` class. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SubFormFieldsPerDocumentDateSigned fontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family for the field. + * @return fontFamily + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FontFamilyEnum getFontFamily() { + return fontFamily; + } + + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + } + + + public SubFormFieldsPerDocumentDateSigned fontSize(@javax.annotation.Nullable Integer fontSize) { + this.fontSize = fontSize; + return this; + } + + /** + * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. + * @return fontSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getFontSize() { + return fontSize; + } + + + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontSize(@javax.annotation.Nullable Integer fontSize) { + this.fontSize = fontSize; + } + + + /** + * Return true if this SubFormFieldsPerDocumentDateSigned object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontSize(@javax.annotation.Nullable Integer fontSize) { - this.fontSize = fontSize; + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentDateSigned subFormFieldsPerDocumentDateSigned = (SubFormFieldsPerDocumentDateSigned) o; + return Objects.equals(this.type, subFormFieldsPerDocumentDateSigned.type) && + Objects.equals(this.fontFamily, subFormFieldsPerDocumentDateSigned.fontFamily) && + Objects.equals(this.fontSize, subFormFieldsPerDocumentDateSigned.fontSize) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, fontFamily, fontSize, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentDateSigned {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldsPerDocumentDateSigned object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SubFormFieldsPerDocumentDateSigned subFormFieldsPerDocumentDateSigned = - (SubFormFieldsPerDocumentDateSigned) o; - return Objects.equals(this.type, subFormFieldsPerDocumentDateSigned.type) - && Objects.equals(this.fontFamily, subFormFieldsPerDocumentDateSigned.fontFamily) - && Objects.equals(this.fontSize, subFormFieldsPerDocumentDateSigned.fontSize) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, fontFamily, fontSize, super.hashCode()); } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentDateSigned {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); - sb.append("}"); - return sb.toString(); + if (fontFamily.getClass().equals(java.io.File.class) || + fontFamily.getClass().equals(Integer.class) || + fontFamily.getClass().equals(String.class) || + fontFamily.getClass().isEnum()) { + map.put("font_family", fontFamily); + } else if (isListOfFile(fontFamily)) { + for(int i = 0; i< getListSize(fontFamily); i++) { + map.put("font_family[" + i + "]", getFromList(fontFamily, i)); + } + } + else { + map.put("font_family", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } } + if (fontSize != null) { + if (isFileTypeOrListOfFiles(fontSize)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - - if (fontFamily.getClass().equals(java.io.File.class) - || fontFamily.getClass().equals(Integer.class) - || fontFamily.getClass().equals(String.class) - || fontFamily.getClass().isEnum()) { - map.put("font_family", fontFamily); - } else if (isListOfFile(fontFamily)) { - for (int i = 0; i < getListSize(fontFamily); i++) { - map.put("font_family[" + i + "]", getFromList(fontFamily, i)); - } - } else { - map.put( - "font_family", - JSON.getDefault().getMapper().writeValueAsString(fontFamily)); - } - } - if (fontSize != null) { - if (isFileTypeOrListOfFiles(fontSize)) { - fileTypeFound = true; - } - - if (fontSize.getClass().equals(java.io.File.class) - || fontSize.getClass().equals(Integer.class) - || fontSize.getClass().equals(String.class) - || fontSize.getClass().isEnum()) { - map.put("font_size", fontSize); - } else if (isListOfFile(fontSize)) { - for (int i = 0; i < getListSize(fontSize); i++) { - map.put("font_size[" + i + "]", getFromList(fontSize, i)); - } - } else { - map.put( - "font_size", - JSON.getDefault().getMapper().writeValueAsString(fontSize)); - } + if (fontSize.getClass().equals(java.io.File.class) || + fontSize.getClass().equals(Integer.class) || + fontSize.getClass().equals(String.class) || + fontSize.getClass().isEnum()) { + map.put("font_size", fontSize); + } else if (isListOfFile(fontSize)) { + for(int i = 0; i< getListSize(fontSize); i++) { + map.put("font_size[" + i + "]", getFromList(fontSize, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("font_size", JSON.getDefault().getMapper().writeValueAsString(fontSize)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "SubFormFieldsPerDocumentDateSigned", SubFormFieldsPerDocumentDateSigned.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentDateSigned.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentDateSigned", SubFormFieldsPerDocumentDateSigned.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentDateSigned.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java index 035f0e7f3..365970e23 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java @@ -10,446 +10,465 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** This class extends `SubFormFieldsPerDocumentBase`. */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `SubFormFieldsPerDocumentBase`. + */ @JsonPropertyOrder({ - SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_OPTIONS, - SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_CONTENT, - SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_FONT_FAMILY, - SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_FONT_SIZE + SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_OPTIONS, + SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_CONTENT, + SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_FONT_FAMILY, + SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_FONT_SIZE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "dropdown"; - - public static final String JSON_PROPERTY_OPTIONS = "options"; - @javax.annotation.Nonnull private List options = new ArrayList<>(); - - public static final String JSON_PROPERTY_CONTENT = "content"; - @javax.annotation.Nullable private String content; - - /** Font family for the field. */ - public enum FontFamilyEnum { - HELVETICA(String.valueOf("helvetica")), - - ARIAL(String.valueOf("arial")), - - COURIER(String.valueOf("courier")), - - CALIBRI(String.valueOf("calibri")), - - CAMBRIA(String.valueOf("cambria")), - - GEORGIA(String.valueOf("georgia")), - - TIMES(String.valueOf("times")), - - TREBUCHET(String.valueOf("trebuchet")), - - VERDANA(String.valueOf("verdana")), - - ROBOTO(String.valueOf("roboto")), - - ROBOTO_MONO(String.valueOf("robotoMono")), - - NOTO_SANS(String.valueOf("notoSans")), - - NOTO_SERIF(String.valueOf("notoSerif")), - - NOTO_CJK_JP_REGULAR(String.valueOf("notoCJK-JP-Regular")), - - NOTO_HEBREW_REGULAR(String.valueOf("notoHebrew-Regular")), - - NOTO_SAN_THAI_MERGED(String.valueOf("notoSanThaiMerged")); - - private String value; - - FontFamilyEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static FontFamilyEnum fromValue(String value) { - for (FontFamilyEnum b : FontFamilyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; - @javax.annotation.Nullable private FontFamilyEnum fontFamily; - - public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; - @javax.annotation.Nullable private Integer fontSize = 12; - - public SubFormFieldsPerDocumentDropdown() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldsPerDocumentDropdown init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentDropdown.class); - } - - public static SubFormFieldsPerDocumentDropdown init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentDropdown.class); - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - public SubFormFieldsPerDocumentDropdown type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; +public class SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "dropdown"; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + @javax.annotation.Nonnull + private List options = new ArrayList<>(); + + public static final String JSON_PROPERTY_CONTENT = "content"; + @javax.annotation.Nullable + private String content; + + /** + * Font family for the field. + */ + public enum FontFamilyEnum { + HELVETICA(String.valueOf("helvetica")), + + ARIAL(String.valueOf("arial")), + + COURIER(String.valueOf("courier")), + + CALIBRI(String.valueOf("calibri")), + + CAMBRIA(String.valueOf("cambria")), + + GEORGIA(String.valueOf("georgia")), + + TIMES(String.valueOf("times")), + + TREBUCHET(String.valueOf("trebuchet")), + + VERDANA(String.valueOf("verdana")), + + ROBOTO(String.valueOf("roboto")), + + ROBOTO_MONO(String.valueOf("robotoMono")), + + NOTO_SANS(String.valueOf("notoSans")), + + NOTO_SERIF(String.valueOf("notoSerif")), + + NOTO_CJK_JP_REGULAR(String.valueOf("notoCJK-JP-Regular")), + + NOTO_HEBREW_REGULAR(String.valueOf("notoHebrew-Regular")), + + NOTO_SAN_THAI_MERGED(String.valueOf("notoSanThaiMerged")); + + private String value; + + FontFamilyEnum(String value) { + this.value = value; } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; + @JsonValue + public String getValue() { + return value; } - public SubFormFieldsPerDocumentDropdown options( - @javax.annotation.Nonnull List options) { - this.options = options; - return this; + @Override + public String toString() { + return String.valueOf(value); } - public SubFormFieldsPerDocumentDropdown addOptionsItem(String optionsItem) { - if (this.options == null) { - this.options = new ArrayList<>(); + @JsonCreator + public static FontFamilyEnum fromValue(String value) { + for (FontFamilyEnum b : FontFamilyEnum.values()) { + if (b.value.equals(value)) { + return b; } - this.options.add(optionsItem); - return this; - } - - /** - * Array of string values representing dropdown values. - * - * @return options - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getOptions() { - return options; - } - - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setOptions(@javax.annotation.Nonnull List options) { - this.options = options; - } - - public SubFormFieldsPerDocumentDropdown content(@javax.annotation.Nullable String content) { - this.content = content; - return this; - } - - /** - * Selected value in `options` array. Value must exist in array. - * - * @return content - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CONTENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getContent() { - return content; - } - - @JsonProperty(JSON_PROPERTY_CONTENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setContent(@javax.annotation.Nullable String content) { - this.content = content; - } - - public SubFormFieldsPerDocumentDropdown fontFamily( - @javax.annotation.Nullable FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - return this; + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - /** - * Font family for the field. - * - * @return fontFamily - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public FontFamilyEnum getFontFamily() { - return fontFamily; + } + + public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; + @javax.annotation.Nullable + private FontFamilyEnum fontFamily; + + public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; + @javax.annotation.Nullable + private Integer fontSize = 12; + + public SubFormFieldsPerDocumentDropdown() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldsPerDocumentDropdown init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentDropdown.class); + } + + static public SubFormFieldsPerDocumentDropdown init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentDropdown.class + ); + } + + public SubFormFieldsPerDocumentDropdown type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SubFormFieldsPerDocumentDropdown options(@javax.annotation.Nonnull List options) { + this.options = options; + return this; + } + + public SubFormFieldsPerDocumentDropdown addOptionsItem(String optionsItem) { + if (this.options == null) { + this.options = new ArrayList<>(); } - - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - } - - public SubFormFieldsPerDocumentDropdown fontSize(@javax.annotation.Nullable Integer fontSize) { - this.fontSize = fontSize; - return this; + this.options.add(optionsItem); + return this; + } + + /** + * Array of string values representing dropdown values. + * @return options + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getOptions() { + return options; + } + + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOptions(@javax.annotation.Nonnull List options) { + this.options = options; + } + + + public SubFormFieldsPerDocumentDropdown content(@javax.annotation.Nullable String content) { + this.content = content; + return this; + } + + /** + * Selected value in `options` array. Value must exist in array. + * @return content + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getContent() { + return content; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(@javax.annotation.Nullable String content) { + this.content = content; + } + + + public SubFormFieldsPerDocumentDropdown fontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family for the field. + * @return fontFamily + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FontFamilyEnum getFontFamily() { + return fontFamily; + } + + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + } + + + public SubFormFieldsPerDocumentDropdown fontSize(@javax.annotation.Nullable Integer fontSize) { + this.fontSize = fontSize; + return this; + } + + /** + * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. + * @return fontSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getFontSize() { + return fontSize; + } + + + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontSize(@javax.annotation.Nullable Integer fontSize) { + this.fontSize = fontSize; + } + + + /** + * Return true if this SubFormFieldsPerDocumentDropdown object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * The initial px font size for the field contents. Can be any integer value between - * `7` and `49`. **NOTE:** Font size may be reduced during processing in - * order to fit the contents within the dimensions of the field. - * - * @return fontSize - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getFontSize() { - return fontSize; + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentDropdown subFormFieldsPerDocumentDropdown = (SubFormFieldsPerDocumentDropdown) o; + return Objects.equals(this.type, subFormFieldsPerDocumentDropdown.type) && + Objects.equals(this.options, subFormFieldsPerDocumentDropdown.options) && + Objects.equals(this.content, subFormFieldsPerDocumentDropdown.content) && + Objects.equals(this.fontFamily, subFormFieldsPerDocumentDropdown.fontFamily) && + Objects.equals(this.fontSize, subFormFieldsPerDocumentDropdown.fontSize) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, options, content, fontFamily, fontSize, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentDropdown {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontSize(@javax.annotation.Nullable Integer fontSize) { - this.fontSize = fontSize; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (options != null) { + if (isFileTypeOrListOfFiles(options)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldsPerDocumentDropdown object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (options.getClass().equals(java.io.File.class) || + options.getClass().equals(Integer.class) || + options.getClass().equals(String.class) || + options.getClass().isEnum()) { + map.put("options", options); + } else if (isListOfFile(options)) { + for(int i = 0; i< getListSize(options); i++) { + map.put("options[" + i + "]", getFromList(options, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); } - SubFormFieldsPerDocumentDropdown subFormFieldsPerDocumentDropdown = - (SubFormFieldsPerDocumentDropdown) o; - return Objects.equals(this.type, subFormFieldsPerDocumentDropdown.type) - && Objects.equals(this.options, subFormFieldsPerDocumentDropdown.options) - && Objects.equals(this.content, subFormFieldsPerDocumentDropdown.content) - && Objects.equals(this.fontFamily, subFormFieldsPerDocumentDropdown.fontFamily) - && Objects.equals(this.fontSize, subFormFieldsPerDocumentDropdown.fontSize) - && super.equals(o); } + if (content != null) { + if (isFileTypeOrListOfFiles(content)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(type, options, content, fontFamily, fontSize, super.hashCode()); + if (content.getClass().equals(java.io.File.class) || + content.getClass().equals(Integer.class) || + content.getClass().equals(String.class) || + content.getClass().isEnum()) { + map.put("content", content); + } else if (isListOfFile(content)) { + for(int i = 0; i< getListSize(content); i++) { + map.put("content[" + i + "]", getFromList(content, i)); + } + } + else { + map.put("content", JSON.getDefault().getMapper().writeValueAsString(content)); + } } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentDropdown {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); - sb.append("}"); - return sb.toString(); + if (fontFamily.getClass().equals(java.io.File.class) || + fontFamily.getClass().equals(Integer.class) || + fontFamily.getClass().equals(String.class) || + fontFamily.getClass().isEnum()) { + map.put("font_family", fontFamily); + } else if (isListOfFile(fontFamily)) { + for(int i = 0; i< getListSize(fontFamily); i++) { + map.put("font_family[" + i + "]", getFromList(fontFamily, i)); + } + } + else { + map.put("font_family", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } } + if (fontSize != null) { + if (isFileTypeOrListOfFiles(fontSize)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (options != null) { - if (isFileTypeOrListOfFiles(options)) { - fileTypeFound = true; - } - - if (options.getClass().equals(java.io.File.class) - || options.getClass().equals(Integer.class) - || options.getClass().equals(String.class) - || options.getClass().isEnum()) { - map.put("options", options); - } else if (isListOfFile(options)) { - for (int i = 0; i < getListSize(options); i++) { - map.put("options[" + i + "]", getFromList(options, i)); - } - } else { - map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); - } + if (fontSize.getClass().equals(java.io.File.class) || + fontSize.getClass().equals(Integer.class) || + fontSize.getClass().equals(String.class) || + fontSize.getClass().isEnum()) { + map.put("font_size", fontSize); + } else if (isListOfFile(fontSize)) { + for(int i = 0; i< getListSize(fontSize); i++) { + map.put("font_size[" + i + "]", getFromList(fontSize, i)); } - if (content != null) { - if (isFileTypeOrListOfFiles(content)) { - fileTypeFound = true; - } - - if (content.getClass().equals(java.io.File.class) - || content.getClass().equals(Integer.class) - || content.getClass().equals(String.class) - || content.getClass().isEnum()) { - map.put("content", content); - } else if (isListOfFile(content)) { - for (int i = 0; i < getListSize(content); i++) { - map.put("content[" + i + "]", getFromList(content, i)); - } - } else { - map.put("content", JSON.getDefault().getMapper().writeValueAsString(content)); - } - } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - - if (fontFamily.getClass().equals(java.io.File.class) - || fontFamily.getClass().equals(Integer.class) - || fontFamily.getClass().equals(String.class) - || fontFamily.getClass().isEnum()) { - map.put("font_family", fontFamily); - } else if (isListOfFile(fontFamily)) { - for (int i = 0; i < getListSize(fontFamily); i++) { - map.put("font_family[" + i + "]", getFromList(fontFamily, i)); - } - } else { - map.put( - "font_family", - JSON.getDefault().getMapper().writeValueAsString(fontFamily)); - } - } - if (fontSize != null) { - if (isFileTypeOrListOfFiles(fontSize)) { - fileTypeFound = true; - } - - if (fontSize.getClass().equals(java.io.File.class) - || fontSize.getClass().equals(Integer.class) - || fontSize.getClass().equals(String.class) - || fontSize.getClass().isEnum()) { - map.put("font_size", fontSize); - } else if (isListOfFile(fontSize)) { - for (int i = 0; i < getListSize(fontSize); i++) { - map.put("font_size[" + i + "]", getFromList(fontSize, i)); - } - } else { - map.put( - "font_size", - JSON.getDefault().getMapper().writeValueAsString(fontSize)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("font_size", JSON.getDefault().getMapper().writeValueAsString(fontSize)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SubFormFieldsPerDocumentDropdown", SubFormFieldsPerDocumentDropdown.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentDropdown.class, "type", mappings); + /** + * 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 "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentDropdown", SubFormFieldsPerDocumentDropdown.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentDropdown.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java index a4e55c3f5..f557d5af4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java @@ -10,68 +10,82 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets SubFormFieldsPerDocumentFontEnum */ +/** + * Gets or Sets SubFormFieldsPerDocumentFontEnum + */ public enum SubFormFieldsPerDocumentFontEnum { - HELVETICA("helvetica"), - - ARIAL("arial"), - - COURIER("courier"), - - CALIBRI("calibri"), - - CAMBRIA("cambria"), - - GEORGIA("georgia"), - - TIMES("times"), - - TREBUCHET("trebuchet"), - - VERDANA("verdana"), - - ROBOTO("roboto"), - - ROBOTO_MONO("robotoMono"), - - NOTO_SANS("notoSans"), - - NOTO_SERIF("notoSerif"), - - NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - - NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - - NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); - - private String value; - - SubFormFieldsPerDocumentFontEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SubFormFieldsPerDocumentFontEnum fromValue(String value) { - for (SubFormFieldsPerDocumentFontEnum b : SubFormFieldsPerDocumentFontEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + + HELVETICA("helvetica"), + + ARIAL("arial"), + + COURIER("courier"), + + CALIBRI("calibri"), + + CAMBRIA("cambria"), + + GEORGIA("georgia"), + + TIMES("times"), + + TREBUCHET("trebuchet"), + + VERDANA("verdana"), + + ROBOTO("roboto"), + + ROBOTO_MONO("robotoMono"), + + NOTO_SANS("notoSans"), + + NOTO_SERIF("notoSerif"), + + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), + + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), + + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); + + private String value; + + SubFormFieldsPerDocumentFontEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SubFormFieldsPerDocumentFontEnum fromValue(String value) { + for (SubFormFieldsPerDocumentFontEnum b : SubFormFieldsPerDocumentFontEnum.values()) { + if (b.value.equals(value)) { + return b; + } } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java index 0a1af8390..47fabe98f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java @@ -10,439 +10,455 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `SubFormFieldsPerDocumentBase`. */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `SubFormFieldsPerDocumentBase`. + */ @JsonPropertyOrder({ - SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_CONTENT, - SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_CONTENT_URL, - SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_FONT_FAMILY, - SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_FONT_SIZE + SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_CONTENT, + SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_CONTENT_URL, + SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_FONT_FAMILY, + SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_FONT_SIZE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "hyperlink"; - - public static final String JSON_PROPERTY_CONTENT = "content"; - @javax.annotation.Nonnull private String content; - - public static final String JSON_PROPERTY_CONTENT_URL = "content_url"; - @javax.annotation.Nonnull private String contentUrl; - - /** Font family for the field. */ - public enum FontFamilyEnum { - HELVETICA(String.valueOf("helvetica")), - - ARIAL(String.valueOf("arial")), - - COURIER(String.valueOf("courier")), - - CALIBRI(String.valueOf("calibri")), - - CAMBRIA(String.valueOf("cambria")), - - GEORGIA(String.valueOf("georgia")), - - TIMES(String.valueOf("times")), + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - TREBUCHET(String.valueOf("trebuchet")), - - VERDANA(String.valueOf("verdana")), - - ROBOTO(String.valueOf("roboto")), - - ROBOTO_MONO(String.valueOf("robotoMono")), - - NOTO_SANS(String.valueOf("notoSans")), - - NOTO_SERIF(String.valueOf("notoSerif")), - - NOTO_CJK_JP_REGULAR(String.valueOf("notoCJK-JP-Regular")), - - NOTO_HEBREW_REGULAR(String.valueOf("notoHebrew-Regular")), - - NOTO_SAN_THAI_MERGED(String.valueOf("notoSanThaiMerged")); - - private String value; - - FontFamilyEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static FontFamilyEnum fromValue(String value) { - for (FontFamilyEnum b : FontFamilyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; - @javax.annotation.Nullable private FontFamilyEnum fontFamily; - - public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; - @javax.annotation.Nullable private Integer fontSize = 12; - - public SubFormFieldsPerDocumentHyperlink() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldsPerDocumentHyperlink init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentHyperlink.class); - } - - public static SubFormFieldsPerDocumentHyperlink init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentHyperlink.class); - } - - public SubFormFieldsPerDocumentHyperlink type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public SubFormFieldsPerDocumentHyperlink content(@javax.annotation.Nonnull String content) { - this.content = content; - return this; - } - - /** - * Link Text. - * - * @return content - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CONTENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getContent() { - return content; - } - - @JsonProperty(JSON_PROPERTY_CONTENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setContent(@javax.annotation.Nonnull String content) { - this.content = content; - } - - public SubFormFieldsPerDocumentHyperlink contentUrl( - @javax.annotation.Nonnull String contentUrl) { - this.contentUrl = contentUrl; - return this; - } - - /** - * Link URL. - * - * @return contentUrl - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CONTENT_URL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getContentUrl() { - return contentUrl; - } - - @JsonProperty(JSON_PROPERTY_CONTENT_URL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setContentUrl(@javax.annotation.Nonnull String contentUrl) { - this.contentUrl = contentUrl; +public class SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "hyperlink"; + + public static final String JSON_PROPERTY_CONTENT = "content"; + @javax.annotation.Nonnull + private String content; + + public static final String JSON_PROPERTY_CONTENT_URL = "content_url"; + @javax.annotation.Nonnull + private String contentUrl; + + /** + * Font family for the field. + */ + public enum FontFamilyEnum { + HELVETICA(String.valueOf("helvetica")), + + ARIAL(String.valueOf("arial")), + + COURIER(String.valueOf("courier")), + + CALIBRI(String.valueOf("calibri")), + + CAMBRIA(String.valueOf("cambria")), + + GEORGIA(String.valueOf("georgia")), + + TIMES(String.valueOf("times")), + + TREBUCHET(String.valueOf("trebuchet")), + + VERDANA(String.valueOf("verdana")), + + ROBOTO(String.valueOf("roboto")), + + ROBOTO_MONO(String.valueOf("robotoMono")), + + NOTO_SANS(String.valueOf("notoSans")), + + NOTO_SERIF(String.valueOf("notoSerif")), + + NOTO_CJK_JP_REGULAR(String.valueOf("notoCJK-JP-Regular")), + + NOTO_HEBREW_REGULAR(String.valueOf("notoHebrew-Regular")), + + NOTO_SAN_THAI_MERGED(String.valueOf("notoSanThaiMerged")); + + private String value; + + FontFamilyEnum(String value) { + this.value = value; } - public SubFormFieldsPerDocumentHyperlink fontFamily( - @javax.annotation.Nullable FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - return this; + @JsonValue + public String getValue() { + return value; } - /** - * Font family for the field. - * - * @return fontFamily - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public FontFamilyEnum getFontFamily() { - return fontFamily; + @Override + public String toString() { + return String.valueOf(value); } - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; + @JsonCreator + public static FontFamilyEnum fromValue(String value) { + for (FontFamilyEnum b : FontFamilyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - public SubFormFieldsPerDocumentHyperlink fontSize(@javax.annotation.Nullable Integer fontSize) { - this.fontSize = fontSize; - return this; + } + + public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; + @javax.annotation.Nullable + private FontFamilyEnum fontFamily; + + public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; + @javax.annotation.Nullable + private Integer fontSize = 12; + + public SubFormFieldsPerDocumentHyperlink() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldsPerDocumentHyperlink init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentHyperlink.class); + } + + static public SubFormFieldsPerDocumentHyperlink init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentHyperlink.class + ); + } + + public SubFormFieldsPerDocumentHyperlink type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SubFormFieldsPerDocumentHyperlink content(@javax.annotation.Nonnull String content) { + this.content = content; + return this; + } + + /** + * Link Text. + * @return content + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getContent() { + return content; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(@javax.annotation.Nonnull String content) { + this.content = content; + } + + + public SubFormFieldsPerDocumentHyperlink contentUrl(@javax.annotation.Nonnull String contentUrl) { + this.contentUrl = contentUrl; + return this; + } + + /** + * Link URL. + * @return contentUrl + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTENT_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getContentUrl() { + return contentUrl; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContentUrl(@javax.annotation.Nonnull String contentUrl) { + this.contentUrl = contentUrl; + } + + + public SubFormFieldsPerDocumentHyperlink fontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family for the field. + * @return fontFamily + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FontFamilyEnum getFontFamily() { + return fontFamily; + } + + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + } + + + public SubFormFieldsPerDocumentHyperlink fontSize(@javax.annotation.Nullable Integer fontSize) { + this.fontSize = fontSize; + return this; + } + + /** + * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. + * @return fontSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getFontSize() { + return fontSize; + } + + + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontSize(@javax.annotation.Nullable Integer fontSize) { + this.fontSize = fontSize; + } + + + /** + * Return true if this SubFormFieldsPerDocumentHyperlink object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * The initial px font size for the field contents. Can be any integer value between - * `7` and `49`. **NOTE:** Font size may be reduced during processing in - * order to fit the contents within the dimensions of the field. - * - * @return fontSize - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getFontSize() { - return fontSize; + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentHyperlink subFormFieldsPerDocumentHyperlink = (SubFormFieldsPerDocumentHyperlink) o; + return Objects.equals(this.type, subFormFieldsPerDocumentHyperlink.type) && + Objects.equals(this.content, subFormFieldsPerDocumentHyperlink.content) && + Objects.equals(this.contentUrl, subFormFieldsPerDocumentHyperlink.contentUrl) && + Objects.equals(this.fontFamily, subFormFieldsPerDocumentHyperlink.fontFamily) && + Objects.equals(this.fontSize, subFormFieldsPerDocumentHyperlink.fontSize) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, content, contentUrl, fontFamily, fontSize, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentHyperlink {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" contentUrl: ").append(toIndentedString(contentUrl)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontSize(@javax.annotation.Nullable Integer fontSize) { - this.fontSize = fontSize; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (content != null) { + if (isFileTypeOrListOfFiles(content)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldsPerDocumentHyperlink object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (content.getClass().equals(java.io.File.class) || + content.getClass().equals(Integer.class) || + content.getClass().equals(String.class) || + content.getClass().isEnum()) { + map.put("content", content); + } else if (isListOfFile(content)) { + for(int i = 0; i< getListSize(content); i++) { + map.put("content[" + i + "]", getFromList(content, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("content", JSON.getDefault().getMapper().writeValueAsString(content)); } - SubFormFieldsPerDocumentHyperlink subFormFieldsPerDocumentHyperlink = - (SubFormFieldsPerDocumentHyperlink) o; - return Objects.equals(this.type, subFormFieldsPerDocumentHyperlink.type) - && Objects.equals(this.content, subFormFieldsPerDocumentHyperlink.content) - && Objects.equals(this.contentUrl, subFormFieldsPerDocumentHyperlink.contentUrl) - && Objects.equals(this.fontFamily, subFormFieldsPerDocumentHyperlink.fontFamily) - && Objects.equals(this.fontSize, subFormFieldsPerDocumentHyperlink.fontSize) - && super.equals(o); } + if (contentUrl != null) { + if (isFileTypeOrListOfFiles(contentUrl)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(type, content, contentUrl, fontFamily, fontSize, super.hashCode()); + if (contentUrl.getClass().equals(java.io.File.class) || + contentUrl.getClass().equals(Integer.class) || + contentUrl.getClass().equals(String.class) || + contentUrl.getClass().isEnum()) { + map.put("content_url", contentUrl); + } else if (isListOfFile(contentUrl)) { + for(int i = 0; i< getListSize(contentUrl); i++) { + map.put("content_url[" + i + "]", getFromList(contentUrl, i)); + } + } + else { + map.put("content_url", JSON.getDefault().getMapper().writeValueAsString(contentUrl)); + } } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentHyperlink {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" contentUrl: ").append(toIndentedString(contentUrl)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); - sb.append("}"); - return sb.toString(); + if (fontFamily.getClass().equals(java.io.File.class) || + fontFamily.getClass().equals(Integer.class) || + fontFamily.getClass().equals(String.class) || + fontFamily.getClass().isEnum()) { + map.put("font_family", fontFamily); + } else if (isListOfFile(fontFamily)) { + for(int i = 0; i< getListSize(fontFamily); i++) { + map.put("font_family[" + i + "]", getFromList(fontFamily, i)); + } + } + else { + map.put("font_family", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } } + if (fontSize != null) { + if (isFileTypeOrListOfFiles(fontSize)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (content != null) { - if (isFileTypeOrListOfFiles(content)) { - fileTypeFound = true; - } - - if (content.getClass().equals(java.io.File.class) - || content.getClass().equals(Integer.class) - || content.getClass().equals(String.class) - || content.getClass().isEnum()) { - map.put("content", content); - } else if (isListOfFile(content)) { - for (int i = 0; i < getListSize(content); i++) { - map.put("content[" + i + "]", getFromList(content, i)); - } - } else { - map.put("content", JSON.getDefault().getMapper().writeValueAsString(content)); - } - } - if (contentUrl != null) { - if (isFileTypeOrListOfFiles(contentUrl)) { - fileTypeFound = true; - } - - if (contentUrl.getClass().equals(java.io.File.class) - || contentUrl.getClass().equals(Integer.class) - || contentUrl.getClass().equals(String.class) - || contentUrl.getClass().isEnum()) { - map.put("content_url", contentUrl); - } else if (isListOfFile(contentUrl)) { - for (int i = 0; i < getListSize(contentUrl); i++) { - map.put("content_url[" + i + "]", getFromList(contentUrl, i)); - } - } else { - map.put( - "content_url", - JSON.getDefault().getMapper().writeValueAsString(contentUrl)); - } + if (fontSize.getClass().equals(java.io.File.class) || + fontSize.getClass().equals(Integer.class) || + fontSize.getClass().equals(String.class) || + fontSize.getClass().isEnum()) { + map.put("font_size", fontSize); + } else if (isListOfFile(fontSize)) { + for(int i = 0; i< getListSize(fontSize); i++) { + map.put("font_size[" + i + "]", getFromList(fontSize, i)); } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - - if (fontFamily.getClass().equals(java.io.File.class) - || fontFamily.getClass().equals(Integer.class) - || fontFamily.getClass().equals(String.class) - || fontFamily.getClass().isEnum()) { - map.put("font_family", fontFamily); - } else if (isListOfFile(fontFamily)) { - for (int i = 0; i < getListSize(fontFamily); i++) { - map.put("font_family[" + i + "]", getFromList(fontFamily, i)); - } - } else { - map.put( - "font_family", - JSON.getDefault().getMapper().writeValueAsString(fontFamily)); - } - } - if (fontSize != null) { - if (isFileTypeOrListOfFiles(fontSize)) { - fileTypeFound = true; - } - - if (fontSize.getClass().equals(java.io.File.class) - || fontSize.getClass().equals(Integer.class) - || fontSize.getClass().equals(String.class) - || fontSize.getClass().isEnum()) { - map.put("font_size", fontSize); - } else if (isListOfFile(fontSize)) { - for (int i = 0; i < getListSize(fontSize); i++) { - map.put("font_size[" + i + "]", getFromList(fontSize, i)); - } - } else { - map.put( - "font_size", - JSON.getDefault().getMapper().writeValueAsString(fontSize)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("font_size", JSON.getDefault().getMapper().writeValueAsString(fontSize)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SubFormFieldsPerDocumentHyperlink", SubFormFieldsPerDocumentHyperlink.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentHyperlink.class, "type", mappings); + /** + * 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 "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentHyperlink", SubFormFieldsPerDocumentHyperlink.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentHyperlink.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java index d00c7e281..b5429e27c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java @@ -10,177 +10,188 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `SubFormFieldsPerDocumentBase`. */ -@JsonPropertyOrder({SubFormFieldsPerDocumentInitials.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "initials"; - - public SubFormFieldsPerDocumentInitials() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldsPerDocumentInitials init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentInitials.class); - } - public static SubFormFieldsPerDocumentInitials init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentInitials.class); - } - - public SubFormFieldsPerDocumentInitials type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } +import com.dropbox.sign.ApiException; +/** + * This class extends `SubFormFieldsPerDocumentBase`. + */ +@JsonPropertyOrder({ + SubFormFieldsPerDocumentInitials.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } +public class SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "initials"; + + public SubFormFieldsPerDocumentInitials() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldsPerDocumentInitials init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentInitials.class); + } + + static public SubFormFieldsPerDocumentInitials init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentInitials.class + ); + } + + public SubFormFieldsPerDocumentInitials type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + /** + * Return true if this SubFormFieldsPerDocumentInitials object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubFormFieldsPerDocumentInitials subFormFieldsPerDocumentInitials = (SubFormFieldsPerDocumentInitials) o; + return Objects.equals(this.type, subFormFieldsPerDocumentInitials.type) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentInitials {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldsPerDocumentInitials object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SubFormFieldsPerDocumentInitials subFormFieldsPerDocumentInitials = - (SubFormFieldsPerDocumentInitials) o; - return Objects.equals(this.type, subFormFieldsPerDocumentInitials.type) && super.equals(o); } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentInitials {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + /** + * 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 "); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SubFormFieldsPerDocumentInitials", SubFormFieldsPerDocumentInitials.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentInitials.class, "type", mappings); - } + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentInitials", SubFormFieldsPerDocumentInitials.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentInitials.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java index e72b7f9b2..03f031b1b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java @@ -10,277 +10,290 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `SubFormFieldsPerDocumentBase`. */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `SubFormFieldsPerDocumentBase`. + */ @JsonPropertyOrder({ - SubFormFieldsPerDocumentRadio.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentRadio.JSON_PROPERTY_GROUP, - SubFormFieldsPerDocumentRadio.JSON_PROPERTY_IS_CHECKED + SubFormFieldsPerDocumentRadio.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentRadio.JSON_PROPERTY_GROUP, + SubFormFieldsPerDocumentRadio.JSON_PROPERTY_IS_CHECKED }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "radio"; - - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nonnull private String group; - - public static final String JSON_PROPERTY_IS_CHECKED = "is_checked"; - @javax.annotation.Nonnull private Boolean isChecked; - - public SubFormFieldsPerDocumentRadio() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldsPerDocumentRadio init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentRadio.class); - } - - public static SubFormFieldsPerDocumentRadio init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentRadio.class); - } - - public SubFormFieldsPerDocumentRadio type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public SubFormFieldsPerDocumentRadio group(@javax.annotation.Nonnull String group) { - this.group = group; - return this; - } - - /** - * String referencing group defined in `form_field_groups` parameter. - * - * @return group - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getGroup() { - return group; - } - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGroup(@javax.annotation.Nonnull String group) { - this.group = group; - } - - public SubFormFieldsPerDocumentRadio isChecked(@javax.annotation.Nonnull Boolean isChecked) { - this.isChecked = isChecked; - return this; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - /** - * `true` for checking the radio field by default, otherwise `false`. Only - * one radio field per group can be `true`. - * - * @return isChecked - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_IS_CHECKED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getIsChecked() { - return isChecked; +public class SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "radio"; + + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nonnull + private String group; + + public static final String JSON_PROPERTY_IS_CHECKED = "is_checked"; + @javax.annotation.Nonnull + private Boolean isChecked; + + public SubFormFieldsPerDocumentRadio() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldsPerDocumentRadio init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentRadio.class); + } + + static public SubFormFieldsPerDocumentRadio init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentRadio.class + ); + } + + public SubFormFieldsPerDocumentRadio type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SubFormFieldsPerDocumentRadio group(@javax.annotation.Nonnull String group) { + this.group = group; + return this; + } + + /** + * String referencing group defined in `form_field_groups` parameter. + * @return group + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGroup(@javax.annotation.Nonnull String group) { + this.group = group; + } + + + public SubFormFieldsPerDocumentRadio isChecked(@javax.annotation.Nonnull Boolean isChecked) { + this.isChecked = isChecked; + return this; + } + + /** + * `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. + * @return isChecked + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_CHECKED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getIsChecked() { + return isChecked; + } + + + @JsonProperty(JSON_PROPERTY_IS_CHECKED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsChecked(@javax.annotation.Nonnull Boolean isChecked) { + this.isChecked = isChecked; + } + + + /** + * Return true if this SubFormFieldsPerDocumentRadio object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_IS_CHECKED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setIsChecked(@javax.annotation.Nonnull Boolean isChecked) { - this.isChecked = isChecked; + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentRadio subFormFieldsPerDocumentRadio = (SubFormFieldsPerDocumentRadio) o; + return Objects.equals(this.type, subFormFieldsPerDocumentRadio.type) && + Objects.equals(this.group, subFormFieldsPerDocumentRadio.group) && + Objects.equals(this.isChecked, subFormFieldsPerDocumentRadio.isChecked) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, group, isChecked, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentRadio {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" isChecked: ").append(toIndentedString(isChecked)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldsPerDocumentRadio object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SubFormFieldsPerDocumentRadio subFormFieldsPerDocumentRadio = - (SubFormFieldsPerDocumentRadio) o; - return Objects.equals(this.type, subFormFieldsPerDocumentRadio.type) - && Objects.equals(this.group, subFormFieldsPerDocumentRadio.group) - && Objects.equals(this.isChecked, subFormFieldsPerDocumentRadio.isChecked) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, group, isChecked, super.hashCode()); } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentRadio {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" isChecked: ").append(toIndentedString(isChecked)).append("\n"); - sb.append("}"); - return sb.toString(); + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); + } + } + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } + if (isChecked != null) { + if (isFileTypeOrListOfFiles(isChecked)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } - } - if (isChecked != null) { - if (isFileTypeOrListOfFiles(isChecked)) { - fileTypeFound = true; - } - - if (isChecked.getClass().equals(java.io.File.class) - || isChecked.getClass().equals(Integer.class) - || isChecked.getClass().equals(String.class) - || isChecked.getClass().isEnum()) { - map.put("is_checked", isChecked); - } else if (isListOfFile(isChecked)) { - for (int i = 0; i < getListSize(isChecked); i++) { - map.put("is_checked[" + i + "]", getFromList(isChecked, i)); - } - } else { - map.put( - "is_checked", - JSON.getDefault().getMapper().writeValueAsString(isChecked)); - } + if (isChecked.getClass().equals(java.io.File.class) || + isChecked.getClass().equals(Integer.class) || + isChecked.getClass().equals(String.class) || + isChecked.getClass().isEnum()) { + map.put("is_checked", isChecked); + } else if (isListOfFile(isChecked)) { + for(int i = 0; i< getListSize(isChecked); i++) { + map.put("is_checked[" + i + "]", getFromList(isChecked, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("is_checked", JSON.getDefault().getMapper().writeValueAsString(isChecked)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SubFormFieldsPerDocumentRadio", SubFormFieldsPerDocumentRadio.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentRadio.class, "type", mappings); + /** + * 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 "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentRadio", SubFormFieldsPerDocumentRadio.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentRadio.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java index 71370c6d2..a488c66a4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java @@ -10,177 +10,188 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `SubFormFieldsPerDocumentBase`. */ -@JsonPropertyOrder({SubFormFieldsPerDocumentSignature.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "signature"; - - public SubFormFieldsPerDocumentSignature() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldsPerDocumentSignature init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentSignature.class); - } - public static SubFormFieldsPerDocumentSignature init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentSignature.class); - } - - public SubFormFieldsPerDocumentSignature type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } +import com.dropbox.sign.ApiException; +/** + * This class extends `SubFormFieldsPerDocumentBase`. + */ +@JsonPropertyOrder({ + SubFormFieldsPerDocumentSignature.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } +public class SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "signature"; + + public SubFormFieldsPerDocumentSignature() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldsPerDocumentSignature init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentSignature.class); + } + + static public SubFormFieldsPerDocumentSignature init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentSignature.class + ); + } + + public SubFormFieldsPerDocumentSignature type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + /** + * Return true if this SubFormFieldsPerDocumentSignature object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubFormFieldsPerDocumentSignature subFormFieldsPerDocumentSignature = (SubFormFieldsPerDocumentSignature) o; + return Objects.equals(this.type, subFormFieldsPerDocumentSignature.type) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentSignature {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldsPerDocumentSignature object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SubFormFieldsPerDocumentSignature subFormFieldsPerDocumentSignature = - (SubFormFieldsPerDocumentSignature) o; - return Objects.equals(this.type, subFormFieldsPerDocumentSignature.type) && super.equals(o); } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentSignature {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + /** + * 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 "); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SubFormFieldsPerDocumentSignature", SubFormFieldsPerDocumentSignature.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentSignature.class, "type", mappings); - } + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentSignature", SubFormFieldsPerDocumentSignature.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentSignature.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java index 00d47ecb5..90da99d2f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java @@ -10,821 +10,812 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `SubFormFieldsPerDocumentBase`. */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `SubFormFieldsPerDocumentBase`. + */ @JsonPropertyOrder({ - SubFormFieldsPerDocumentText.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentText.JSON_PROPERTY_PLACEHOLDER, - SubFormFieldsPerDocumentText.JSON_PROPERTY_AUTO_FILL_TYPE, - SubFormFieldsPerDocumentText.JSON_PROPERTY_LINK_ID, - SubFormFieldsPerDocumentText.JSON_PROPERTY_MASKED, - SubFormFieldsPerDocumentText.JSON_PROPERTY_VALIDATION_TYPE, - SubFormFieldsPerDocumentText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX, - SubFormFieldsPerDocumentText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL, - SubFormFieldsPerDocumentText.JSON_PROPERTY_CONTENT, - SubFormFieldsPerDocumentText.JSON_PROPERTY_FONT_FAMILY, - SubFormFieldsPerDocumentText.JSON_PROPERTY_FONT_SIZE + SubFormFieldsPerDocumentText.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentText.JSON_PROPERTY_PLACEHOLDER, + SubFormFieldsPerDocumentText.JSON_PROPERTY_AUTO_FILL_TYPE, + SubFormFieldsPerDocumentText.JSON_PROPERTY_LINK_ID, + SubFormFieldsPerDocumentText.JSON_PROPERTY_MASKED, + SubFormFieldsPerDocumentText.JSON_PROPERTY_VALIDATION_TYPE, + SubFormFieldsPerDocumentText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX, + SubFormFieldsPerDocumentText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL, + SubFormFieldsPerDocumentText.JSON_PROPERTY_CONTENT, + SubFormFieldsPerDocumentText.JSON_PROPERTY_FONT_FAMILY, + SubFormFieldsPerDocumentText.JSON_PROPERTY_FONT_SIZE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "text"; - - public static final String JSON_PROPERTY_PLACEHOLDER = "placeholder"; - @javax.annotation.Nullable private String placeholder; - - public static final String JSON_PROPERTY_AUTO_FILL_TYPE = "auto_fill_type"; - @javax.annotation.Nullable private String autoFillType; - - public static final String JSON_PROPERTY_LINK_ID = "link_id"; - @javax.annotation.Nullable private String linkId; - - public static final String JSON_PROPERTY_MASKED = "masked"; - @javax.annotation.Nullable private Boolean masked; - - /** - * Each text field may contain a `validation_type` parameter. Check out the list of - * [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about - * the possible values. **NOTE:** When using `custom_regex` you are required to pass a - * second parameter `validation_custom_regex` and you can optionally provide - * `validation_custom_regex_format_label` for the error message the user will see in - * case of an invalid value. - */ - public enum ValidationTypeEnum { - NUMBERS_ONLY(String.valueOf("numbers_only")), + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - LETTERS_ONLY(String.valueOf("letters_only")), - - PHONE_NUMBER(String.valueOf("phone_number")), - - BANK_ROUTING_NUMBER(String.valueOf("bank_routing_number")), - - BANK_ACCOUNT_NUMBER(String.valueOf("bank_account_number")), - - EMAIL_ADDRESS(String.valueOf("email_address")), - - ZIP_CODE(String.valueOf("zip_code")), - - SOCIAL_SECURITY_NUMBER(String.valueOf("social_security_number")), - - EMPLOYER_IDENTIFICATION_NUMBER(String.valueOf("employer_identification_number")), - - CUSTOM_REGEX(String.valueOf("custom_regex")); +public class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "text"; + + public static final String JSON_PROPERTY_PLACEHOLDER = "placeholder"; + @javax.annotation.Nullable + private String placeholder; + + public static final String JSON_PROPERTY_AUTO_FILL_TYPE = "auto_fill_type"; + @javax.annotation.Nullable + private String autoFillType; + + public static final String JSON_PROPERTY_LINK_ID = "link_id"; + @javax.annotation.Nullable + private String linkId; + + public static final String JSON_PROPERTY_MASKED = "masked"; + @javax.annotation.Nullable + private Boolean masked; + + /** + * Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. **NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value. + */ + public enum ValidationTypeEnum { + NUMBERS_ONLY(String.valueOf("numbers_only")), + + LETTERS_ONLY(String.valueOf("letters_only")), + + PHONE_NUMBER(String.valueOf("phone_number")), + + BANK_ROUTING_NUMBER(String.valueOf("bank_routing_number")), + + BANK_ACCOUNT_NUMBER(String.valueOf("bank_account_number")), + + EMAIL_ADDRESS(String.valueOf("email_address")), + + ZIP_CODE(String.valueOf("zip_code")), + + SOCIAL_SECURITY_NUMBER(String.valueOf("social_security_number")), + + EMPLOYER_IDENTIFICATION_NUMBER(String.valueOf("employer_identification_number")), + + CUSTOM_REGEX(String.valueOf("custom_regex")); + + private String value; + + ValidationTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } - private String value; + @Override + public String toString() { + return String.valueOf(value); + } - ValidationTypeEnum(String value) { - this.value = value; + @JsonCreator + public static ValidationTypeEnum fromValue(String value) { + for (ValidationTypeEnum b : ValidationTypeEnum.values()) { + if (b.value.equals(value)) { + return b; } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_VALIDATION_TYPE = "validation_type"; + @javax.annotation.Nullable + private ValidationTypeEnum validationType; + + public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX = "validation_custom_regex"; + @javax.annotation.Nullable + private String validationCustomRegex; + + public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL = "validation_custom_regex_format_label"; + @javax.annotation.Nullable + private String validationCustomRegexFormatLabel; + + public static final String JSON_PROPERTY_CONTENT = "content"; + @javax.annotation.Nullable + private String content; + + /** + * Font family for the field. + */ + public enum FontFamilyEnum { + HELVETICA(String.valueOf("helvetica")), + + ARIAL(String.valueOf("arial")), + + COURIER(String.valueOf("courier")), + + CALIBRI(String.valueOf("calibri")), + + CAMBRIA(String.valueOf("cambria")), + + GEORGIA(String.valueOf("georgia")), + + TIMES(String.valueOf("times")), + + TREBUCHET(String.valueOf("trebuchet")), + + VERDANA(String.valueOf("verdana")), + + ROBOTO(String.valueOf("roboto")), + + ROBOTO_MONO(String.valueOf("robotoMono")), + + NOTO_SANS(String.valueOf("notoSans")), + + NOTO_SERIF(String.valueOf("notoSerif")), + + NOTO_CJK_JP_REGULAR(String.valueOf("notoCJK-JP-Regular")), + + NOTO_HEBREW_REGULAR(String.valueOf("notoHebrew-Regular")), + + NOTO_SAN_THAI_MERGED(String.valueOf("notoSanThaiMerged")); + + private String value; + + FontFamilyEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } - @JsonValue - public String getValue() { - return value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @Override - public String toString() { - return String.valueOf(value); + @JsonCreator + public static FontFamilyEnum fromValue(String value) { + for (FontFamilyEnum b : FontFamilyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; + @javax.annotation.Nullable + private FontFamilyEnum fontFamily; + + public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; + @javax.annotation.Nullable + private Integer fontSize = 12; + + public SubFormFieldsPerDocumentText() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldsPerDocumentText init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentText.class); + } + + static public SubFormFieldsPerDocumentText init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentText.class + ); + } + + public SubFormFieldsPerDocumentText type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * A text input field. Use the `SubFormFieldsPerDocumentText` class. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SubFormFieldsPerDocumentText placeholder(@javax.annotation.Nullable String placeholder) { + this.placeholder = placeholder; + return this; + } + + /** + * Placeholder value for text field. + * @return placeholder + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PLACEHOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPlaceholder() { + return placeholder; + } + + + @JsonProperty(JSON_PROPERTY_PLACEHOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaceholder(@javax.annotation.Nullable String placeholder) { + this.placeholder = placeholder; + } + + + public SubFormFieldsPerDocumentText autoFillType(@javax.annotation.Nullable String autoFillType) { + this.autoFillType = autoFillType; + return this; + } + + /** + * Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values. + * @return autoFillType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTO_FILL_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAutoFillType() { + return autoFillType; + } + + + @JsonProperty(JSON_PROPERTY_AUTO_FILL_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutoFillType(@javax.annotation.Nullable String autoFillType) { + this.autoFillType = autoFillType; + } + + + public SubFormFieldsPerDocumentText linkId(@javax.annotation.Nullable String linkId) { + this.linkId = linkId; + return this; + } + + /** + * Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. + * @return linkId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINK_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLinkId() { + return linkId; + } + + + @JsonProperty(JSON_PROPERTY_LINK_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkId(@javax.annotation.Nullable String linkId) { + this.linkId = linkId; + } + + + public SubFormFieldsPerDocumentText masked(@javax.annotation.Nullable Boolean masked) { + this.masked = masked; + return this; + } + + /** + * Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`. + * @return masked + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MASKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMasked() { + return masked; + } + + + @JsonProperty(JSON_PROPERTY_MASKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMasked(@javax.annotation.Nullable Boolean masked) { + this.masked = masked; + } + + + public SubFormFieldsPerDocumentText validationType(@javax.annotation.Nullable ValidationTypeEnum validationType) { + this.validationType = validationType; + return this; + } + + /** + * Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. **NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value. + * @return validationType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ValidationTypeEnum getValidationType() { + return validationType; + } + + + @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationType(@javax.annotation.Nullable ValidationTypeEnum validationType) { + this.validationType = validationType; + } + + + public SubFormFieldsPerDocumentText validationCustomRegex(@javax.annotation.Nullable String validationCustomRegex) { + this.validationCustomRegex = validationCustomRegex; + return this; + } + + /** + * Get validationCustomRegex + * @return validationCustomRegex + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValidationCustomRegex() { + return validationCustomRegex; + } + + + @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationCustomRegex(@javax.annotation.Nullable String validationCustomRegex) { + this.validationCustomRegex = validationCustomRegex; + } + + + public SubFormFieldsPerDocumentText validationCustomRegexFormatLabel(@javax.annotation.Nullable String validationCustomRegexFormatLabel) { + this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; + return this; + } + + /** + * Get validationCustomRegexFormatLabel + * @return validationCustomRegexFormatLabel + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValidationCustomRegexFormatLabel() { + return validationCustomRegexFormatLabel; + } + + + @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationCustomRegexFormatLabel(@javax.annotation.Nullable String validationCustomRegexFormatLabel) { + this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; + } + + + public SubFormFieldsPerDocumentText content(@javax.annotation.Nullable String content) { + this.content = content; + return this; + } + + /** + * Content of a `me_now` text field + * @return content + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getContent() { + return content; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(@javax.annotation.Nullable String content) { + this.content = content; + } + + + public SubFormFieldsPerDocumentText fontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family for the field. + * @return fontFamily + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FontFamilyEnum getFontFamily() { + return fontFamily; + } + + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + } + + + public SubFormFieldsPerDocumentText fontSize(@javax.annotation.Nullable Integer fontSize) { + this.fontSize = fontSize; + return this; + } + + /** + * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. + * @return fontSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getFontSize() { + return fontSize; + } + + + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontSize(@javax.annotation.Nullable Integer fontSize) { + this.fontSize = fontSize; + } + + + /** + * Return true if this SubFormFieldsPerDocumentText object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubFormFieldsPerDocumentText subFormFieldsPerDocumentText = (SubFormFieldsPerDocumentText) o; + return Objects.equals(this.type, subFormFieldsPerDocumentText.type) && + Objects.equals(this.placeholder, subFormFieldsPerDocumentText.placeholder) && + Objects.equals(this.autoFillType, subFormFieldsPerDocumentText.autoFillType) && + Objects.equals(this.linkId, subFormFieldsPerDocumentText.linkId) && + Objects.equals(this.masked, subFormFieldsPerDocumentText.masked) && + Objects.equals(this.validationType, subFormFieldsPerDocumentText.validationType) && + Objects.equals(this.validationCustomRegex, subFormFieldsPerDocumentText.validationCustomRegex) && + Objects.equals(this.validationCustomRegexFormatLabel, subFormFieldsPerDocumentText.validationCustomRegexFormatLabel) && + Objects.equals(this.content, subFormFieldsPerDocumentText.content) && + Objects.equals(this.fontFamily, subFormFieldsPerDocumentText.fontFamily) && + Objects.equals(this.fontSize, subFormFieldsPerDocumentText.fontSize) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, placeholder, autoFillType, linkId, masked, validationType, validationCustomRegex, validationCustomRegexFormatLabel, content, fontFamily, fontSize, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentText {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" placeholder: ").append(toIndentedString(placeholder)).append("\n"); + sb.append(" autoFillType: ").append(toIndentedString(autoFillType)).append("\n"); + sb.append(" linkId: ").append(toIndentedString(linkId)).append("\n"); + sb.append(" masked: ").append(toIndentedString(masked)).append("\n"); + sb.append(" validationType: ").append(toIndentedString(validationType)).append("\n"); + sb.append(" validationCustomRegex: ").append(toIndentedString(validationCustomRegex)).append("\n"); + sb.append(" validationCustomRegexFormatLabel: ").append(toIndentedString(validationCustomRegexFormatLabel)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; } - @JsonCreator - public static ValidationTypeEnum fromValue(String value) { - for (ValidationTypeEnum b : ValidationTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } } - - public static final String JSON_PROPERTY_VALIDATION_TYPE = "validation_type"; - @javax.annotation.Nullable private ValidationTypeEnum validationType; - - public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX = "validation_custom_regex"; - @javax.annotation.Nullable private String validationCustomRegex; - - public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL = - "validation_custom_regex_format_label"; - @javax.annotation.Nullable private String validationCustomRegexFormatLabel; - - public static final String JSON_PROPERTY_CONTENT = "content"; - @javax.annotation.Nullable private String content; - - /** Font family for the field. */ - public enum FontFamilyEnum { - HELVETICA(String.valueOf("helvetica")), - - ARIAL(String.valueOf("arial")), - - COURIER(String.valueOf("courier")), - - CALIBRI(String.valueOf("calibri")), - - CAMBRIA(String.valueOf("cambria")), - - GEORGIA(String.valueOf("georgia")), - - TIMES(String.valueOf("times")), - - TREBUCHET(String.valueOf("trebuchet")), - - VERDANA(String.valueOf("verdana")), - - ROBOTO(String.valueOf("roboto")), - - ROBOTO_MONO(String.valueOf("robotoMono")), - - NOTO_SANS(String.valueOf("notoSans")), - - NOTO_SERIF(String.valueOf("notoSerif")), - - NOTO_CJK_JP_REGULAR(String.valueOf("notoCJK-JP-Regular")), - - NOTO_HEBREW_REGULAR(String.valueOf("notoHebrew-Regular")), - - NOTO_SAN_THAI_MERGED(String.valueOf("notoSanThaiMerged")); - - private String value; - - FontFamilyEnum(String value) { - this.value = value; + if (placeholder != null) { + if (isFileTypeOrListOfFiles(placeholder)) { + fileTypeFound = true; } - @JsonValue - public String getValue() { - return value; + if (placeholder.getClass().equals(java.io.File.class) || + placeholder.getClass().equals(Integer.class) || + placeholder.getClass().equals(String.class) || + placeholder.getClass().isEnum()) { + map.put("placeholder", placeholder); + } else if (isListOfFile(placeholder)) { + for(int i = 0; i< getListSize(placeholder); i++) { + map.put("placeholder[" + i + "]", getFromList(placeholder, i)); + } } - - @Override - public String toString() { - return String.valueOf(value); + else { + map.put("placeholder", JSON.getDefault().getMapper().writeValueAsString(placeholder)); + } + } + if (autoFillType != null) { + if (isFileTypeOrListOfFiles(autoFillType)) { + fileTypeFound = true; } - @JsonCreator - public static FontFamilyEnum fromValue(String value) { - for (FontFamilyEnum b : FontFamilyEnum.values()) { - if (b.value.equals(value)) { - return b; - } + if (autoFillType.getClass().equals(java.io.File.class) || + autoFillType.getClass().equals(Integer.class) || + autoFillType.getClass().equals(String.class) || + autoFillType.getClass().isEnum()) { + map.put("auto_fill_type", autoFillType); + } else if (isListOfFile(autoFillType)) { + for(int i = 0; i< getListSize(autoFillType); i++) { + map.put("auto_fill_type[" + i + "]", getFromList(autoFillType, i)); } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + else { + map.put("auto_fill_type", JSON.getDefault().getMapper().writeValueAsString(autoFillType)); } } + if (linkId != null) { + if (isFileTypeOrListOfFiles(linkId)) { + fileTypeFound = true; + } - public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; - @javax.annotation.Nullable private FontFamilyEnum fontFamily; - - public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; - @javax.annotation.Nullable private Integer fontSize = 12; - - public SubFormFieldsPerDocumentText() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldsPerDocumentText init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentText.class); - } - - public static SubFormFieldsPerDocumentText init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentText.class); - } - - public SubFormFieldsPerDocumentText type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * A text input field. Use the `SubFormFieldsPerDocumentText` class. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public SubFormFieldsPerDocumentText placeholder(@javax.annotation.Nullable String placeholder) { - this.placeholder = placeholder; - return this; - } - - /** - * Placeholder value for text field. - * - * @return placeholder - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PLACEHOLDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPlaceholder() { - return placeholder; - } - - @JsonProperty(JSON_PROPERTY_PLACEHOLDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPlaceholder(@javax.annotation.Nullable String placeholder) { - this.placeholder = placeholder; - } - - public SubFormFieldsPerDocumentText autoFillType( - @javax.annotation.Nullable String autoFillType) { - this.autoFillType = autoFillType; - return this; - } - - /** - * Auto fill type for populating fields automatically. Check out the list of [auto fill - * types](/api/reference/constants/#auto-fill-types) to learn more about the possible values. - * - * @return autoFillType - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_AUTO_FILL_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAutoFillType() { - return autoFillType; - } - - @JsonProperty(JSON_PROPERTY_AUTO_FILL_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAutoFillType(@javax.annotation.Nullable String autoFillType) { - this.autoFillType = autoFillType; - } - - public SubFormFieldsPerDocumentText linkId(@javax.annotation.Nullable String linkId) { - this.linkId = linkId; - return this; - } - - /** - * Link two or more text fields. Enter data into one linked text field, which automatically fill - * all other linked text fields. - * - * @return linkId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LINK_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLinkId() { - return linkId; - } - - @JsonProperty(JSON_PROPERTY_LINK_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLinkId(@javax.annotation.Nullable String linkId) { - this.linkId = linkId; - } - - public SubFormFieldsPerDocumentText masked(@javax.annotation.Nullable Boolean masked) { - this.masked = masked; - return this; - } - - /** - * Masks entered data. For more information see [Masking sensitive - * information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). - * `true` for masking the data in a text field, otherwise `false`. - * - * @return masked - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MASKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getMasked() { - return masked; - } - - @JsonProperty(JSON_PROPERTY_MASKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMasked(@javax.annotation.Nullable Boolean masked) { - this.masked = masked; - } - - public SubFormFieldsPerDocumentText validationType( - @javax.annotation.Nullable ValidationTypeEnum validationType) { - this.validationType = validationType; - return this; - } - - /** - * Each text field may contain a `validation_type` parameter. Check out the list of - * [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about - * the possible values. **NOTE:** When using `custom_regex` you are required to pass a - * second parameter `validation_custom_regex` and you can optionally provide - * `validation_custom_regex_format_label` for the error message the user will see in - * case of an invalid value. - * - * @return validationType - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ValidationTypeEnum getValidationType() { - return validationType; - } - - @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValidationType(@javax.annotation.Nullable ValidationTypeEnum validationType) { - this.validationType = validationType; - } - - public SubFormFieldsPerDocumentText validationCustomRegex( - @javax.annotation.Nullable String validationCustomRegex) { - this.validationCustomRegex = validationCustomRegex; - return this; - } - - /** - * Get validationCustomRegex - * - * @return validationCustomRegex - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValidationCustomRegex() { - return validationCustomRegex; - } - - @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValidationCustomRegex(@javax.annotation.Nullable String validationCustomRegex) { - this.validationCustomRegex = validationCustomRegex; - } - - public SubFormFieldsPerDocumentText validationCustomRegexFormatLabel( - @javax.annotation.Nullable String validationCustomRegexFormatLabel) { - this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; - return this; - } - - /** - * Get validationCustomRegexFormatLabel - * - * @return validationCustomRegexFormatLabel - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValidationCustomRegexFormatLabel() { - return validationCustomRegexFormatLabel; - } - - @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValidationCustomRegexFormatLabel( - @javax.annotation.Nullable String validationCustomRegexFormatLabel) { - this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; - } - - public SubFormFieldsPerDocumentText content(@javax.annotation.Nullable String content) { - this.content = content; - return this; - } - - /** - * Content of a `me_now` text field - * - * @return content - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CONTENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getContent() { - return content; - } - - @JsonProperty(JSON_PROPERTY_CONTENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setContent(@javax.annotation.Nullable String content) { - this.content = content; - } - - public SubFormFieldsPerDocumentText fontFamily( - @javax.annotation.Nullable FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - return this; - } - - /** - * Font family for the field. - * - * @return fontFamily - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public FontFamilyEnum getFontFamily() { - return fontFamily; - } - - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; + if (linkId.getClass().equals(java.io.File.class) || + linkId.getClass().equals(Integer.class) || + linkId.getClass().equals(String.class) || + linkId.getClass().isEnum()) { + map.put("link_id", linkId); + } else if (isListOfFile(linkId)) { + for(int i = 0; i< getListSize(linkId); i++) { + map.put("link_id[" + i + "]", getFromList(linkId, i)); + } + } + else { + map.put("link_id", JSON.getDefault().getMapper().writeValueAsString(linkId)); + } } + if (masked != null) { + if (isFileTypeOrListOfFiles(masked)) { + fileTypeFound = true; + } - public SubFormFieldsPerDocumentText fontSize(@javax.annotation.Nullable Integer fontSize) { - this.fontSize = fontSize; - return this; + if (masked.getClass().equals(java.io.File.class) || + masked.getClass().equals(Integer.class) || + masked.getClass().equals(String.class) || + masked.getClass().isEnum()) { + map.put("masked", masked); + } else if (isListOfFile(masked)) { + for(int i = 0; i< getListSize(masked); i++) { + map.put("masked[" + i + "]", getFromList(masked, i)); + } + } + else { + map.put("masked", JSON.getDefault().getMapper().writeValueAsString(masked)); + } } + if (validationType != null) { + if (isFileTypeOrListOfFiles(validationType)) { + fileTypeFound = true; + } - /** - * The initial px font size for the field contents. Can be any integer value between - * `7` and `49`. **NOTE:** Font size may be reduced during processing in - * order to fit the contents within the dimensions of the field. - * - * @return fontSize - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getFontSize() { - return fontSize; + if (validationType.getClass().equals(java.io.File.class) || + validationType.getClass().equals(Integer.class) || + validationType.getClass().equals(String.class) || + validationType.getClass().isEnum()) { + map.put("validation_type", validationType); + } else if (isListOfFile(validationType)) { + for(int i = 0; i< getListSize(validationType); i++) { + map.put("validation_type[" + i + "]", getFromList(validationType, i)); + } + } + else { + map.put("validation_type", JSON.getDefault().getMapper().writeValueAsString(validationType)); + } } + if (validationCustomRegex != null) { + if (isFileTypeOrListOfFiles(validationCustomRegex)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontSize(@javax.annotation.Nullable Integer fontSize) { - this.fontSize = fontSize; + if (validationCustomRegex.getClass().equals(java.io.File.class) || + validationCustomRegex.getClass().equals(Integer.class) || + validationCustomRegex.getClass().equals(String.class) || + validationCustomRegex.getClass().isEnum()) { + map.put("validation_custom_regex", validationCustomRegex); + } else if (isListOfFile(validationCustomRegex)) { + for(int i = 0; i< getListSize(validationCustomRegex); i++) { + map.put("validation_custom_regex[" + i + "]", getFromList(validationCustomRegex, i)); + } + } + else { + map.put("validation_custom_regex", JSON.getDefault().getMapper().writeValueAsString(validationCustomRegex)); + } } + if (validationCustomRegexFormatLabel != null) { + if (isFileTypeOrListOfFiles(validationCustomRegexFormatLabel)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldsPerDocumentText object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubFormFieldsPerDocumentText subFormFieldsPerDocumentText = - (SubFormFieldsPerDocumentText) o; - return Objects.equals(this.type, subFormFieldsPerDocumentText.type) - && Objects.equals(this.placeholder, subFormFieldsPerDocumentText.placeholder) - && Objects.equals(this.autoFillType, subFormFieldsPerDocumentText.autoFillType) - && Objects.equals(this.linkId, subFormFieldsPerDocumentText.linkId) - && Objects.equals(this.masked, subFormFieldsPerDocumentText.masked) - && Objects.equals(this.validationType, subFormFieldsPerDocumentText.validationType) - && Objects.equals( - this.validationCustomRegex, - subFormFieldsPerDocumentText.validationCustomRegex) - && Objects.equals( - this.validationCustomRegexFormatLabel, - subFormFieldsPerDocumentText.validationCustomRegexFormatLabel) - && Objects.equals(this.content, subFormFieldsPerDocumentText.content) - && Objects.equals(this.fontFamily, subFormFieldsPerDocumentText.fontFamily) - && Objects.equals(this.fontSize, subFormFieldsPerDocumentText.fontSize) - && super.equals(o); + if (validationCustomRegexFormatLabel.getClass().equals(java.io.File.class) || + validationCustomRegexFormatLabel.getClass().equals(Integer.class) || + validationCustomRegexFormatLabel.getClass().equals(String.class) || + validationCustomRegexFormatLabel.getClass().isEnum()) { + map.put("validation_custom_regex_format_label", validationCustomRegexFormatLabel); + } else if (isListOfFile(validationCustomRegexFormatLabel)) { + for(int i = 0; i< getListSize(validationCustomRegexFormatLabel); i++) { + map.put("validation_custom_regex_format_label[" + i + "]", getFromList(validationCustomRegexFormatLabel, i)); + } + } + else { + map.put("validation_custom_regex_format_label", JSON.getDefault().getMapper().writeValueAsString(validationCustomRegexFormatLabel)); + } } + if (content != null) { + if (isFileTypeOrListOfFiles(content)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - type, - placeholder, - autoFillType, - linkId, - masked, - validationType, - validationCustomRegex, - validationCustomRegexFormatLabel, - content, - fontFamily, - fontSize, - super.hashCode()); + if (content.getClass().equals(java.io.File.class) || + content.getClass().equals(Integer.class) || + content.getClass().equals(String.class) || + content.getClass().isEnum()) { + map.put("content", content); + } else if (isListOfFile(content)) { + for(int i = 0; i< getListSize(content); i++) { + map.put("content[" + i + "]", getFromList(content, i)); + } + } + else { + map.put("content", JSON.getDefault().getMapper().writeValueAsString(content)); + } } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentText {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" placeholder: ").append(toIndentedString(placeholder)).append("\n"); - sb.append(" autoFillType: ").append(toIndentedString(autoFillType)).append("\n"); - sb.append(" linkId: ").append(toIndentedString(linkId)).append("\n"); - sb.append(" masked: ").append(toIndentedString(masked)).append("\n"); - sb.append(" validationType: ").append(toIndentedString(validationType)).append("\n"); - sb.append(" validationCustomRegex: ") - .append(toIndentedString(validationCustomRegex)) - .append("\n"); - sb.append(" validationCustomRegexFormatLabel: ") - .append(toIndentedString(validationCustomRegexFormatLabel)) - .append("\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); - sb.append("}"); - return sb.toString(); + if (fontFamily.getClass().equals(java.io.File.class) || + fontFamily.getClass().equals(Integer.class) || + fontFamily.getClass().equals(String.class) || + fontFamily.getClass().isEnum()) { + map.put("font_family", fontFamily); + } else if (isListOfFile(fontFamily)) { + for(int i = 0; i< getListSize(fontFamily); i++) { + map.put("font_family[" + i + "]", getFromList(fontFamily, i)); + } + } + else { + map.put("font_family", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } } + if (fontSize != null) { + if (isFileTypeOrListOfFiles(fontSize)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (placeholder != null) { - if (isFileTypeOrListOfFiles(placeholder)) { - fileTypeFound = true; - } - - if (placeholder.getClass().equals(java.io.File.class) - || placeholder.getClass().equals(Integer.class) - || placeholder.getClass().equals(String.class) - || placeholder.getClass().isEnum()) { - map.put("placeholder", placeholder); - } else if (isListOfFile(placeholder)) { - for (int i = 0; i < getListSize(placeholder); i++) { - map.put("placeholder[" + i + "]", getFromList(placeholder, i)); - } - } else { - map.put( - "placeholder", - JSON.getDefault().getMapper().writeValueAsString(placeholder)); - } - } - if (autoFillType != null) { - if (isFileTypeOrListOfFiles(autoFillType)) { - fileTypeFound = true; - } - - if (autoFillType.getClass().equals(java.io.File.class) - || autoFillType.getClass().equals(Integer.class) - || autoFillType.getClass().equals(String.class) - || autoFillType.getClass().isEnum()) { - map.put("auto_fill_type", autoFillType); - } else if (isListOfFile(autoFillType)) { - for (int i = 0; i < getListSize(autoFillType); i++) { - map.put("auto_fill_type[" + i + "]", getFromList(autoFillType, i)); - } - } else { - map.put( - "auto_fill_type", - JSON.getDefault().getMapper().writeValueAsString(autoFillType)); - } - } - if (linkId != null) { - if (isFileTypeOrListOfFiles(linkId)) { - fileTypeFound = true; - } - - if (linkId.getClass().equals(java.io.File.class) - || linkId.getClass().equals(Integer.class) - || linkId.getClass().equals(String.class) - || linkId.getClass().isEnum()) { - map.put("link_id", linkId); - } else if (isListOfFile(linkId)) { - for (int i = 0; i < getListSize(linkId); i++) { - map.put("link_id[" + i + "]", getFromList(linkId, i)); - } - } else { - map.put("link_id", JSON.getDefault().getMapper().writeValueAsString(linkId)); - } - } - if (masked != null) { - if (isFileTypeOrListOfFiles(masked)) { - fileTypeFound = true; - } - - if (masked.getClass().equals(java.io.File.class) - || masked.getClass().equals(Integer.class) - || masked.getClass().equals(String.class) - || masked.getClass().isEnum()) { - map.put("masked", masked); - } else if (isListOfFile(masked)) { - for (int i = 0; i < getListSize(masked); i++) { - map.put("masked[" + i + "]", getFromList(masked, i)); - } - } else { - map.put("masked", JSON.getDefault().getMapper().writeValueAsString(masked)); - } - } - if (validationType != null) { - if (isFileTypeOrListOfFiles(validationType)) { - fileTypeFound = true; - } - - if (validationType.getClass().equals(java.io.File.class) - || validationType.getClass().equals(Integer.class) - || validationType.getClass().equals(String.class) - || validationType.getClass().isEnum()) { - map.put("validation_type", validationType); - } else if (isListOfFile(validationType)) { - for (int i = 0; i < getListSize(validationType); i++) { - map.put("validation_type[" + i + "]", getFromList(validationType, i)); - } - } else { - map.put( - "validation_type", - JSON.getDefault().getMapper().writeValueAsString(validationType)); - } + if (fontSize.getClass().equals(java.io.File.class) || + fontSize.getClass().equals(Integer.class) || + fontSize.getClass().equals(String.class) || + fontSize.getClass().isEnum()) { + map.put("font_size", fontSize); + } else if (isListOfFile(fontSize)) { + for(int i = 0; i< getListSize(fontSize); i++) { + map.put("font_size[" + i + "]", getFromList(fontSize, i)); } - if (validationCustomRegex != null) { - if (isFileTypeOrListOfFiles(validationCustomRegex)) { - fileTypeFound = true; - } - - if (validationCustomRegex.getClass().equals(java.io.File.class) - || validationCustomRegex.getClass().equals(Integer.class) - || validationCustomRegex.getClass().equals(String.class) - || validationCustomRegex.getClass().isEnum()) { - map.put("validation_custom_regex", validationCustomRegex); - } else if (isListOfFile(validationCustomRegex)) { - for (int i = 0; i < getListSize(validationCustomRegex); i++) { - map.put( - "validation_custom_regex[" + i + "]", - getFromList(validationCustomRegex, i)); - } - } else { - map.put( - "validation_custom_regex", - JSON.getDefault() - .getMapper() - .writeValueAsString(validationCustomRegex)); - } - } - if (validationCustomRegexFormatLabel != null) { - if (isFileTypeOrListOfFiles(validationCustomRegexFormatLabel)) { - fileTypeFound = true; - } - - if (validationCustomRegexFormatLabel.getClass().equals(java.io.File.class) - || validationCustomRegexFormatLabel.getClass().equals(Integer.class) - || validationCustomRegexFormatLabel.getClass().equals(String.class) - || validationCustomRegexFormatLabel.getClass().isEnum()) { - map.put( - "validation_custom_regex_format_label", - validationCustomRegexFormatLabel); - } else if (isListOfFile(validationCustomRegexFormatLabel)) { - for (int i = 0; i < getListSize(validationCustomRegexFormatLabel); i++) { - map.put( - "validation_custom_regex_format_label[" + i + "]", - getFromList(validationCustomRegexFormatLabel, i)); - } - } else { - map.put( - "validation_custom_regex_format_label", - JSON.getDefault() - .getMapper() - .writeValueAsString(validationCustomRegexFormatLabel)); - } - } - if (content != null) { - if (isFileTypeOrListOfFiles(content)) { - fileTypeFound = true; - } - - if (content.getClass().equals(java.io.File.class) - || content.getClass().equals(Integer.class) - || content.getClass().equals(String.class) - || content.getClass().isEnum()) { - map.put("content", content); - } else if (isListOfFile(content)) { - for (int i = 0; i < getListSize(content); i++) { - map.put("content[" + i + "]", getFromList(content, i)); - } - } else { - map.put("content", JSON.getDefault().getMapper().writeValueAsString(content)); - } - } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - - if (fontFamily.getClass().equals(java.io.File.class) - || fontFamily.getClass().equals(Integer.class) - || fontFamily.getClass().equals(String.class) - || fontFamily.getClass().isEnum()) { - map.put("font_family", fontFamily); - } else if (isListOfFile(fontFamily)) { - for (int i = 0; i < getListSize(fontFamily); i++) { - map.put("font_family[" + i + "]", getFromList(fontFamily, i)); - } - } else { - map.put( - "font_family", - JSON.getDefault().getMapper().writeValueAsString(fontFamily)); - } - } - if (fontSize != null) { - if (isFileTypeOrListOfFiles(fontSize)) { - fileTypeFound = true; - } - - if (fontSize.getClass().equals(java.io.File.class) - || fontSize.getClass().equals(Integer.class) - || fontSize.getClass().equals(String.class) - || fontSize.getClass().isEnum()) { - map.put("font_size", fontSize); - } else if (isListOfFile(fontSize)) { - for (int i = 0; i < getListSize(fontSize); i++) { - map.put("font_size[" + i + "]", getFromList(fontSize, i)); - } - } else { - map.put( - "font_size", - JSON.getDefault().getMapper().writeValueAsString(fontSize)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("font_size", JSON.getDefault().getMapper().writeValueAsString(fontSize)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SubFormFieldsPerDocumentText", SubFormFieldsPerDocumentText.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentText.class, "type", mappings); + /** + * 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 "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentText", SubFormFieldsPerDocumentText.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentText.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java index d4bf984d5..9d2367fb7 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java @@ -10,343 +10,353 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `SubFormFieldsPerDocumentBase`. */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `SubFormFieldsPerDocumentBase`. + */ @JsonPropertyOrder({ - SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_FONT_FAMILY, - SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_FONT_SIZE + SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_FONT_FAMILY, + SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_FONT_SIZE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "text-merge"; - - /** Font family for the field. */ - public enum FontFamilyEnum { - HELVETICA(String.valueOf("helvetica")), - - ARIAL(String.valueOf("arial")), - - COURIER(String.valueOf("courier")), - - CALIBRI(String.valueOf("calibri")), - - CAMBRIA(String.valueOf("cambria")), - - GEORGIA(String.valueOf("georgia")), - - TIMES(String.valueOf("times")), - - TREBUCHET(String.valueOf("trebuchet")), - - VERDANA(String.valueOf("verdana")), - - ROBOTO(String.valueOf("roboto")), - - ROBOTO_MONO(String.valueOf("robotoMono")), - - NOTO_SANS(String.valueOf("notoSans")), - - NOTO_SERIF(String.valueOf("notoSerif")), - - NOTO_CJK_JP_REGULAR(String.valueOf("notoCJK-JP-Regular")), - - NOTO_HEBREW_REGULAR(String.valueOf("notoHebrew-Regular")), - - NOTO_SAN_THAI_MERGED(String.valueOf("notoSanThaiMerged")); - - private String value; - - FontFamilyEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static FontFamilyEnum fromValue(String value) { - for (FontFamilyEnum b : FontFamilyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; - @javax.annotation.Nullable private FontFamilyEnum fontFamily; - - public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; - @javax.annotation.Nullable private Integer fontSize = 12; - - public SubFormFieldsPerDocumentTextMerge() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubFormFieldsPerDocumentTextMerge init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentTextMerge.class); - } - - public static SubFormFieldsPerDocumentTextMerge init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentTextMerge.class); - } - - public SubFormFieldsPerDocumentTextMerge type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * A text field that has default text set using pre-filled data. Use the - * `SubFormFieldsPerDocumentTextMerge` class. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public SubFormFieldsPerDocumentTextMerge fontFamily( - @javax.annotation.Nullable FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - return this; +public class SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "text-merge"; + + /** + * Font family for the field. + */ + public enum FontFamilyEnum { + HELVETICA(String.valueOf("helvetica")), + + ARIAL(String.valueOf("arial")), + + COURIER(String.valueOf("courier")), + + CALIBRI(String.valueOf("calibri")), + + CAMBRIA(String.valueOf("cambria")), + + GEORGIA(String.valueOf("georgia")), + + TIMES(String.valueOf("times")), + + TREBUCHET(String.valueOf("trebuchet")), + + VERDANA(String.valueOf("verdana")), + + ROBOTO(String.valueOf("roboto")), + + ROBOTO_MONO(String.valueOf("robotoMono")), + + NOTO_SANS(String.valueOf("notoSans")), + + NOTO_SERIF(String.valueOf("notoSerif")), + + NOTO_CJK_JP_REGULAR(String.valueOf("notoCJK-JP-Regular")), + + NOTO_HEBREW_REGULAR(String.valueOf("notoHebrew-Regular")), + + NOTO_SAN_THAI_MERGED(String.valueOf("notoSanThaiMerged")); + + private String value; + + FontFamilyEnum(String value) { + this.value = value; } - /** - * Font family for the field. - * - * @return fontFamily - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public FontFamilyEnum getFontFamily() { - return fontFamily; + @JsonValue + public String getValue() { + return value; } - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; + @Override + public String toString() { + return String.valueOf(value); } - public SubFormFieldsPerDocumentTextMerge fontSize(@javax.annotation.Nullable Integer fontSize) { - this.fontSize = fontSize; - return this; + @JsonCreator + public static FontFamilyEnum fromValue(String value) { + for (FontFamilyEnum b : FontFamilyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - /** - * The initial px font size for the field contents. Can be any integer value between - * `7` and `49`. **NOTE:** Font size may be reduced during processing in - * order to fit the contents within the dimensions of the field. - * - * @return fontSize - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getFontSize() { - return fontSize; + } + + public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; + @javax.annotation.Nullable + private FontFamilyEnum fontFamily; + + public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; + @javax.annotation.Nullable + private Integer fontSize = 12; + + public SubFormFieldsPerDocumentTextMerge() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubFormFieldsPerDocumentTextMerge init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentTextMerge.class); + } + + static public SubFormFieldsPerDocumentTextMerge init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentTextMerge.class + ); + } + + public SubFormFieldsPerDocumentTextMerge type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public SubFormFieldsPerDocumentTextMerge fontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family for the field. + * @return fontFamily + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FontFamilyEnum getFontFamily() { + return fontFamily; + } + + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(@javax.annotation.Nullable FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + } + + + public SubFormFieldsPerDocumentTextMerge fontSize(@javax.annotation.Nullable Integer fontSize) { + this.fontSize = fontSize; + return this; + } + + /** + * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. + * @return fontSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getFontSize() { + return fontSize; + } + + + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontSize(@javax.annotation.Nullable Integer fontSize) { + this.fontSize = fontSize; + } + + + /** + * Return true if this SubFormFieldsPerDocumentTextMerge object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontSize(@javax.annotation.Nullable Integer fontSize) { - this.fontSize = fontSize; + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentTextMerge subFormFieldsPerDocumentTextMerge = (SubFormFieldsPerDocumentTextMerge) o; + return Objects.equals(this.type, subFormFieldsPerDocumentTextMerge.type) && + Objects.equals(this.fontFamily, subFormFieldsPerDocumentTextMerge.fontFamily) && + Objects.equals(this.fontSize, subFormFieldsPerDocumentTextMerge.fontSize) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, fontFamily, fontSize, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentTextMerge {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SubFormFieldsPerDocumentTextMerge object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SubFormFieldsPerDocumentTextMerge subFormFieldsPerDocumentTextMerge = - (SubFormFieldsPerDocumentTextMerge) o; - return Objects.equals(this.type, subFormFieldsPerDocumentTextMerge.type) - && Objects.equals(this.fontFamily, subFormFieldsPerDocumentTextMerge.fontFamily) - && Objects.equals(this.fontSize, subFormFieldsPerDocumentTextMerge.fontSize) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, fontFamily, fontSize, super.hashCode()); } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentTextMerge {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); - sb.append("}"); - return sb.toString(); + if (fontFamily.getClass().equals(java.io.File.class) || + fontFamily.getClass().equals(Integer.class) || + fontFamily.getClass().equals(String.class) || + fontFamily.getClass().isEnum()) { + map.put("font_family", fontFamily); + } else if (isListOfFile(fontFamily)) { + for(int i = 0; i< getListSize(fontFamily); i++) { + map.put("font_family[" + i + "]", getFromList(fontFamily, i)); + } + } + else { + map.put("font_family", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } } + if (fontSize != null) { + if (isFileTypeOrListOfFiles(fontSize)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - - if (fontFamily.getClass().equals(java.io.File.class) - || fontFamily.getClass().equals(Integer.class) - || fontFamily.getClass().equals(String.class) - || fontFamily.getClass().isEnum()) { - map.put("font_family", fontFamily); - } else if (isListOfFile(fontFamily)) { - for (int i = 0; i < getListSize(fontFamily); i++) { - map.put("font_family[" + i + "]", getFromList(fontFamily, i)); - } - } else { - map.put( - "font_family", - JSON.getDefault().getMapper().writeValueAsString(fontFamily)); - } - } - if (fontSize != null) { - if (isFileTypeOrListOfFiles(fontSize)) { - fileTypeFound = true; - } - - if (fontSize.getClass().equals(java.io.File.class) - || fontSize.getClass().equals(Integer.class) - || fontSize.getClass().equals(String.class) - || fontSize.getClass().isEnum()) { - map.put("font_size", fontSize); - } else if (isListOfFile(fontSize)) { - for (int i = 0; i < getListSize(fontSize); i++) { - map.put("font_size[" + i + "]", getFromList(fontSize, i)); - } - } else { - map.put( - "font_size", - JSON.getDefault().getMapper().writeValueAsString(fontSize)); - } + if (fontSize.getClass().equals(java.io.File.class) || + fontSize.getClass().equals(Integer.class) || + fontSize.getClass().equals(String.class) || + fontSize.getClass().isEnum()) { + map.put("font_size", fontSize); + } else if (isListOfFile(fontSize)) { + for(int i = 0; i< getListSize(fontSize); i++) { + map.put("font_size[" + i + "]", getFromList(fontSize, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("font_size", JSON.getDefault().getMapper().writeValueAsString(fontSize)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SubFormFieldsPerDocumentTextMerge", SubFormFieldsPerDocumentTextMerge.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentTextMerge.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentTextMerge", SubFormFieldsPerDocumentTextMerge.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentTextMerge.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java index 7b3d7e5d3..2b9d9c00b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java @@ -10,56 +10,70 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Gets or Sets SubFormFieldsPerDocumentTypeEnum */ +/** + * Gets or Sets SubFormFieldsPerDocumentTypeEnum + */ public enum SubFormFieldsPerDocumentTypeEnum { - CHECKBOX("checkbox"), - - CHECKBOX_MERGE("checkbox-merge"), - - DATE_SIGNED("date_signed"), - - DROPDOWN("dropdown"), - - HYPERLINK("hyperlink"), - - INITIALS("initials"), - - SIGNATURE("signature"), - - RADIO("radio"), - - TEXT("text"), - - TEXT_MERGE("text-merge"); - - private String value; - - SubFormFieldsPerDocumentTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SubFormFieldsPerDocumentTypeEnum fromValue(String value) { - for (SubFormFieldsPerDocumentTypeEnum b : SubFormFieldsPerDocumentTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + + CHECKBOX("checkbox"), + + CHECKBOX_MERGE("checkbox-merge"), + + DATE_SIGNED("date_signed"), + + DROPDOWN("dropdown"), + + HYPERLINK("hyperlink"), + + INITIALS("initials"), + + SIGNATURE("signature"), + + RADIO("radio"), + + TEXT("text"), + + TEXT_MERGE("text-merge"); + + private String value; + + SubFormFieldsPerDocumentTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SubFormFieldsPerDocumentTypeEnum fromValue(String value) { + for (SubFormFieldsPerDocumentTypeEnum b : SubFormFieldsPerDocumentTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubMergeField.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubMergeField.java index d4f7fba9f..5dc2f1f67 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubMergeField.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubMergeField.java @@ -10,238 +10,256 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** SubMergeField */ -@JsonPropertyOrder({SubMergeField.JSON_PROPERTY_NAME, SubMergeField.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class SubMergeField { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull private String name; - - /** The type of merge field. */ - public enum TypeEnum { - TEXT(String.valueOf("text")), - - CHECKBOX(String.valueOf("checkbox")); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private TypeEnum type; - - public SubMergeField() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubMergeField init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubMergeField.class); - } - public static SubMergeField init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubMergeField.class); +import com.dropbox.sign.ApiException; +/** + * SubMergeField + */ +@JsonPropertyOrder({ + SubMergeField.JSON_PROPERTY_NAME, + SubMergeField.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SubMergeField { + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + /** + * The type of merge field. + */ + public enum TypeEnum { + TEXT(String.valueOf("text")), + + CHECKBOX(String.valueOf("checkbox")); + + private String value; + + TypeEnum(String value) { + this.value = value; } - public SubMergeField name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; + @JsonValue + public String getValue() { + return value; } - /** - * The name of the merge field. Must be unique. - * - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; + @Override + public String toString() { + return String.valueOf(value); } - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - public SubMergeField type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - return this; + } + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private TypeEnum type; + + public SubMergeField() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubMergeField init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubMergeField.class); + } + + static public SubMergeField init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubMergeField.class + ); + } + + public SubMergeField name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the merge field. Must be unique. + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SubMergeField type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of merge field. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + /** + * Return true if this SubMergeField object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * The type of merge field. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TypeEnum getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; + if (o == null || getClass() != o.getClass()) { + return false; } + SubMergeField subMergeField = (SubMergeField) o; + return Objects.equals(this.name, subMergeField.name) && + Objects.equals(this.type, subMergeField.type); + } + + @Override + public int hashCode() { + return Objects.hash(name, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubMergeField {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** Return true if this SubMergeField object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); } - SubMergeField subMergeField = (SubMergeField) o; - return Objects.equals(this.name, subMergeField.name) - && Objects.equals(this.type, subMergeField.type); } + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(name, type); + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubMergeField {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOAuth.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOAuth.java index 1d7220b38..9fd848ab2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOAuth.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOAuth.java @@ -10,262 +10,278 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** OAuth related parameters. */ -@JsonPropertyOrder({SubOAuth.JSON_PROPERTY_CALLBACK_URL, SubOAuth.JSON_PROPERTY_SCOPES}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class SubOAuth { - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - @javax.annotation.Nullable private String callbackUrl; - - /** Gets or Sets scopes */ - public enum ScopesEnum { - REQUEST_SIGNATURE(String.valueOf("request_signature")), - - BASIC_ACCOUNT_INFO(String.valueOf("basic_account_info")), - - ACCOUNT_ACCESS(String.valueOf("account_access")), - - SIGNATURE_REQUEST_ACCESS(String.valueOf("signature_request_access")), - - TEMPLATE_ACCESS(String.valueOf("template_access")), - - TEAM_ACCESS(String.valueOf("team_access")), - - API_APP_ACCESS(String.valueOf("api_app_access")), - - EMPTY(String.valueOf("")); - - private String value; - - ScopesEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; - @Override - public String toString() { - return String.valueOf(value); - } - @JsonCreator - public static ScopesEnum fromValue(String value) { - for (ScopesEnum b : ScopesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } +import com.dropbox.sign.ApiException; +/** + * OAuth related parameters. + */ +@JsonPropertyOrder({ + SubOAuth.JSON_PROPERTY_CALLBACK_URL, + SubOAuth.JSON_PROPERTY_SCOPES +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SubOAuth { + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + @javax.annotation.Nullable + private String callbackUrl; + + /** + * Gets or Sets scopes + */ + public enum ScopesEnum { + REQUEST_SIGNATURE(String.valueOf("request_signature")), + + BASIC_ACCOUNT_INFO(String.valueOf("basic_account_info")), + + ACCOUNT_ACCESS(String.valueOf("account_access")), + + SIGNATURE_REQUEST_ACCESS(String.valueOf("signature_request_access")), + + TEMPLATE_ACCESS(String.valueOf("template_access")), + + TEAM_ACCESS(String.valueOf("team_access")), + + API_APP_ACCESS(String.valueOf("api_app_access")), + + EMPTY(String.valueOf("")); + + private String value; + + ScopesEnum(String value) { + this.value = value; } - public static final String JSON_PROPERTY_SCOPES = "scopes"; - @javax.annotation.Nullable private List scopes = null; - - public SubOAuth() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubOAuth init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubOAuth.class); + @JsonValue + public String getValue() { + return value; } - public static SubOAuth init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubOAuth.class); + @Override + public String toString() { + return String.valueOf(value); } - public SubOAuth callbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; + @JsonCreator + public static ScopesEnum fromValue(String value) { + for (ScopesEnum b : ScopesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - /** - * The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is - * provided) - * - * @return callbackUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCallbackUrl() { - return callbackUrl; + } + + public static final String JSON_PROPERTY_SCOPES = "scopes"; + @javax.annotation.Nullable + private List scopes = null; + + public SubOAuth() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubOAuth init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubOAuth.class); + } + + static public SubOAuth init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubOAuth.class + ); + } + + public SubOAuth callbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; + } + + /** + * The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) + * @return callbackUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCallbackUrl() { + return callbackUrl; + } + + + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { + this.callbackUrl = callbackUrl; + } + + + public SubOAuth scopes(@javax.annotation.Nullable List scopes) { + this.scopes = scopes; + return this; + } + + public SubOAuth addScopesItem(ScopesEnum scopesItem) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(); } - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(@javax.annotation.Nullable String callbackUrl) { - this.callbackUrl = callbackUrl; + this.scopes.add(scopesItem); + return this; + } + + /** + * A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). + * @return scopes + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getScopes() { + return scopes; + } + + + @JsonProperty(JSON_PROPERTY_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScopes(@javax.annotation.Nullable List scopes) { + this.scopes = scopes; + } + + + /** + * Return true if this SubOAuth object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public SubOAuth scopes(@javax.annotation.Nullable List scopes) { - this.scopes = scopes; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - public SubOAuth addScopesItem(ScopesEnum scopesItem) { - if (this.scopes == null) { - this.scopes = new ArrayList<>(); + SubOAuth subOAuth = (SubOAuth) o; + return Objects.equals(this.callbackUrl, subOAuth.callbackUrl) && + Objects.equals(this.scopes, subOAuth.scopes); + } + + @Override + public int hashCode() { + return Objects.hash(callbackUrl, scopes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubOAuth {\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; } - this.scopes.add(scopesItem); - return this; - } - /** - * A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if - * `oauth[callback_url]` is provided). - * - * @return scopes - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SCOPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getScopes() { - return scopes; - } - - @JsonProperty(JSON_PROPERTY_SCOPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setScopes(@javax.annotation.Nullable List scopes) { - this.scopes = scopes; - } - - /** Return true if this SubOAuth object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (callbackUrl.getClass().equals(java.io.File.class) || + callbackUrl.getClass().equals(Integer.class) || + callbackUrl.getClass().equals(String.class) || + callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for(int i = 0; i< getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); } - SubOAuth subOAuth = (SubOAuth) o; - return Objects.equals(this.callbackUrl, subOAuth.callbackUrl) - && Objects.equals(this.scopes, subOAuth.scopes); } + if (scopes != null) { + if (isFileTypeOrListOfFiles(scopes)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(callbackUrl, scopes); + if (scopes.getClass().equals(java.io.File.class) || + scopes.getClass().equals(Integer.class) || + scopes.getClass().equals(String.class) || + scopes.getClass().isEnum()) { + map.put("scopes", scopes); + } else if (isListOfFile(scopes)) { + for(int i = 0; i< getListSize(scopes); i++) { + map.put("scopes[" + i + "]", getFromList(scopes, i)); + } + } + else { + map.put("scopes", JSON.getDefault().getMapper().writeValueAsString(scopes)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubOAuth {\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } - - if (callbackUrl.getClass().equals(java.io.File.class) - || callbackUrl.getClass().equals(Integer.class) - || callbackUrl.getClass().equals(String.class) - || callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for (int i = 0; i < getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } else { - map.put( - "callback_url", - JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); - } - } - if (scopes != null) { - if (isFileTypeOrListOfFiles(scopes)) { - fileTypeFound = true; - } - - if (scopes.getClass().equals(java.io.File.class) - || scopes.getClass().equals(Integer.class) - || scopes.getClass().equals(String.class) - || scopes.getClass().isEnum()) { - map.put("scopes", scopes); - } else if (isListOfFile(scopes)) { - for (int i = 0; i < getListSize(scopes); i++) { - map.put("scopes[" + i + "]", getFromList(scopes, i)); - } - } else { - map.put("scopes", JSON.getDefault().getMapper().writeValueAsString(scopes)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOptions.java index dca71d2ef..b611f9140 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOptions.java @@ -10,162 +10,170 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** Additional options supported by API App. */ -@JsonPropertyOrder({SubOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class SubOptions { - public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; - @javax.annotation.Nullable private Boolean canInsertEverywhere = false; - - public SubOptions() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubOptions.class); - } - public static SubOptions init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubOptions.class); - } - - public SubOptions canInsertEverywhere(@javax.annotation.Nullable Boolean canInsertEverywhere) { - this.canInsertEverywhere = canInsertEverywhere; - return this; - } - - /** - * Determines if signers can use \"Insert Everywhere\" when signing a document. - * - * @return canInsertEverywhere - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getCanInsertEverywhere() { - return canInsertEverywhere; +import com.dropbox.sign.ApiException; +/** + * Additional options supported by API App. + */ +@JsonPropertyOrder({ + SubOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SubOptions { + public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; + @javax.annotation.Nullable + private Boolean canInsertEverywhere = false; + + public SubOptions() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubOptions.class); + } + + static public SubOptions init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubOptions.class + ); + } + + public SubOptions canInsertEverywhere(@javax.annotation.Nullable Boolean canInsertEverywhere) { + this.canInsertEverywhere = canInsertEverywhere; + return this; + } + + /** + * Determines if signers can use \"Insert Everywhere\" when signing a document. + * @return canInsertEverywhere + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getCanInsertEverywhere() { + return canInsertEverywhere; + } + + + @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanInsertEverywhere(@javax.annotation.Nullable Boolean canInsertEverywhere) { + this.canInsertEverywhere = canInsertEverywhere; + } + + + /** + * Return true if this SubOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCanInsertEverywhere(@javax.annotation.Nullable Boolean canInsertEverywhere) { - this.canInsertEverywhere = canInsertEverywhere; + if (o == null || getClass() != o.getClass()) { + return false; } + SubOptions subOptions = (SubOptions) o; + return Objects.equals(this.canInsertEverywhere, subOptions.canInsertEverywhere); + } + + @Override + public int hashCode() { + return Objects.hash(canInsertEverywhere); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubOptions {\n"); + sb.append(" canInsertEverywhere: ").append(toIndentedString(canInsertEverywhere)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (canInsertEverywhere != null) { + if (isFileTypeOrListOfFiles(canInsertEverywhere)) { + fileTypeFound = true; + } - /** Return true if this SubOptions object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (canInsertEverywhere.getClass().equals(java.io.File.class) || + canInsertEverywhere.getClass().equals(Integer.class) || + canInsertEverywhere.getClass().equals(String.class) || + canInsertEverywhere.getClass().isEnum()) { + map.put("can_insert_everywhere", canInsertEverywhere); + } else if (isListOfFile(canInsertEverywhere)) { + for(int i = 0; i< getListSize(canInsertEverywhere); i++) { + map.put("can_insert_everywhere[" + i + "]", getFromList(canInsertEverywhere, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("can_insert_everywhere", JSON.getDefault().getMapper().writeValueAsString(canInsertEverywhere)); } - SubOptions subOptions = (SubOptions) o; - return Objects.equals(this.canInsertEverywhere, subOptions.canInsertEverywhere); } - - @Override - public int hashCode() { - return Objects.hash(canInsertEverywhere); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubOptions {\n"); - sb.append(" canInsertEverywhere: ") - .append(toIndentedString(canInsertEverywhere)) - .append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (canInsertEverywhere != null) { - if (isFileTypeOrListOfFiles(canInsertEverywhere)) { - fileTypeFound = true; - } - - if (canInsertEverywhere.getClass().equals(java.io.File.class) - || canInsertEverywhere.getClass().equals(Integer.class) - || canInsertEverywhere.getClass().equals(String.class) - || canInsertEverywhere.getClass().isEnum()) { - map.put("can_insert_everywhere", canInsertEverywhere); - } else if (isListOfFile(canInsertEverywhere)) { - for (int i = 0; i < getListSize(canInsertEverywhere); i++) { - map.put( - "can_insert_everywhere[" + i + "]", - getFromList(canInsertEverywhere, i)); - } - } else { - map.put( - "can_insert_everywhere", - JSON.getDefault().getMapper().writeValueAsString(canInsertEverywhere)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java index b67ccb989..c0837b9e2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java @@ -10,269 +10,283 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubSignatureRequestSigner; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** SubSignatureRequestGroupedSigners */ + +import com.dropbox.sign.ApiException; +/** + * SubSignatureRequestGroupedSigners + */ @JsonPropertyOrder({ - SubSignatureRequestGroupedSigners.JSON_PROPERTY_GROUP, - SubSignatureRequestGroupedSigners.JSON_PROPERTY_SIGNERS, - SubSignatureRequestGroupedSigners.JSON_PROPERTY_ORDER + SubSignatureRequestGroupedSigners.JSON_PROPERTY_GROUP, + SubSignatureRequestGroupedSigners.JSON_PROPERTY_SIGNERS, + SubSignatureRequestGroupedSigners.JSON_PROPERTY_ORDER }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubSignatureRequestGroupedSigners { - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nonnull private String group; - - public static final String JSON_PROPERTY_SIGNERS = "signers"; - @javax.annotation.Nonnull private List signers = new ArrayList<>(); - - public static final String JSON_PROPERTY_ORDER = "order"; - @javax.annotation.Nullable private Integer order; - - public SubSignatureRequestGroupedSigners() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubSignatureRequestGroupedSigners init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubSignatureRequestGroupedSigners.class); - } - - public static SubSignatureRequestGroupedSigners init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubSignatureRequestGroupedSigners.class); - } - - public SubSignatureRequestGroupedSigners group(@javax.annotation.Nonnull String group) { - this.group = group; - return this; - } - - /** - * The name of the group. - * - * @return group - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getGroup() { - return group; + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nonnull + private String group; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nonnull + private List signers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ORDER = "order"; + @javax.annotation.Nullable + private Integer order; + + public SubSignatureRequestGroupedSigners() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubSignatureRequestGroupedSigners init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubSignatureRequestGroupedSigners.class); + } + + static public SubSignatureRequestGroupedSigners init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubSignatureRequestGroupedSigners.class + ); + } + + public SubSignatureRequestGroupedSigners group(@javax.annotation.Nonnull String group) { + this.group = group; + return this; + } + + /** + * The name of the group. + * @return group + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGroup(@javax.annotation.Nonnull String group) { + this.group = group; + } + + + public SubSignatureRequestGroupedSigners signers(@javax.annotation.Nonnull List signers) { + this.signers = signers; + return this; + } + + public SubSignatureRequestGroupedSigners addSignersItem(SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); } - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGroup(@javax.annotation.Nonnull String group) { - this.group = group; + this.signers.add(signersItem); + return this; + } + + /** + * Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. + * @return signers + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigners(@javax.annotation.Nonnull List signers) { + this.signers = signers; + } + + + public SubSignatureRequestGroupedSigners order(@javax.annotation.Nullable Integer order) { + this.order = order; + return this; + } + + /** + * The order the group is required to sign in. Use this instead of Signer-level `order`. + * @return order + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getOrder() { + return order; + } + + + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(@javax.annotation.Nullable Integer order) { + this.order = order; + } + + + /** + * Return true if this SubSignatureRequestGroupedSigners object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public SubSignatureRequestGroupedSigners signers( - @javax.annotation.Nonnull List signers) { - this.signers = signers; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - public SubSignatureRequestGroupedSigners addSignersItem(SubSignatureRequestSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + SubSignatureRequestGroupedSigners subSignatureRequestGroupedSigners = (SubSignatureRequestGroupedSigners) o; + return Objects.equals(this.group, subSignatureRequestGroupedSigners.group) && + Objects.equals(this.signers, subSignatureRequestGroupedSigners.signers) && + Objects.equals(this.order, subSignatureRequestGroupedSigners.order); + } + + @Override + public int hashCode() { + return Objects.hash(group, signers, order); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubSignatureRequestGroupedSigners {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; } - this.signers.add(signersItem); - return this; - } - - /** - * Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, - * and `pin` are available to Grouped Signers. We will ignore all other properties, - * even though they are listed below. - * - * @return signers - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getSigners() { - return signers; - } - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSigners(@javax.annotation.Nonnull List signers) { - this.signers = signers; - } - - public SubSignatureRequestGroupedSigners order(@javax.annotation.Nullable Integer order) { - this.order = order; - return this; - } - - /** - * The order the group is required to sign in. Use this instead of Signer-level - * `order`. - * - * @return order - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getOrder() { - return order; - } - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrder(@javax.annotation.Nullable Integer order) { - this.order = order; + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); + } + } + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } - /** Return true if this SubSignatureRequestGroupedSigners object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); } - SubSignatureRequestGroupedSigners subSignatureRequestGroupedSigners = - (SubSignatureRequestGroupedSigners) o; - return Objects.equals(this.group, subSignatureRequestGroupedSigners.group) - && Objects.equals(this.signers, subSignatureRequestGroupedSigners.signers) - && Objects.equals(this.order, subSignatureRequestGroupedSigners.order); } + if (order != null) { + if (isFileTypeOrListOfFiles(order)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(group, signers, order); + if (order.getClass().equals(java.io.File.class) || + order.getClass().equals(Integer.class) || + order.getClass().equals(String.class) || + order.getClass().isEnum()) { + map.put("order", order); + } else if (isListOfFile(order)) { + for(int i = 0; i< getListSize(order); i++) { + map.put("order[" + i + "]", getFromList(order, i)); + } + } + else { + map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubSignatureRequestGroupedSigners {\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - if (order != null) { - if (isFileTypeOrListOfFiles(order)) { - fileTypeFound = true; - } - - if (order.getClass().equals(java.io.File.class) - || order.getClass().equals(Integer.class) - || order.getClass().equals(String.class) - || order.getClass().isEnum()) { - map.put("order", order); - } else if (isListOfFile(order)) { - for (int i = 0; i < getListSize(order); i++) { - map.put("order[" + i + "]", getFromList(order, i)); - } - } else { - map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java index 6bfe0c6eb..b0e206cae 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java @@ -10,454 +10,460 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SubSignatureRequestSigner */ + +import com.dropbox.sign.ApiException; +/** + * SubSignatureRequestSigner + */ @JsonPropertyOrder({ - SubSignatureRequestSigner.JSON_PROPERTY_NAME, - SubSignatureRequestSigner.JSON_PROPERTY_EMAIL_ADDRESS, - SubSignatureRequestSigner.JSON_PROPERTY_ORDER, - SubSignatureRequestSigner.JSON_PROPERTY_PIN, - SubSignatureRequestSigner.JSON_PROPERTY_SMS_PHONE_NUMBER, - SubSignatureRequestSigner.JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE + SubSignatureRequestSigner.JSON_PROPERTY_NAME, + SubSignatureRequestSigner.JSON_PROPERTY_EMAIL_ADDRESS, + SubSignatureRequestSigner.JSON_PROPERTY_ORDER, + SubSignatureRequestSigner.JSON_PROPERTY_PIN, + SubSignatureRequestSigner.JSON_PROPERTY_SMS_PHONE_NUMBER, + SubSignatureRequestSigner.JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubSignatureRequestSigner { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull private String name; - - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nonnull private String emailAddress; - - public static final String JSON_PROPERTY_ORDER = "order"; - @javax.annotation.Nullable private Integer order; - - public static final String JSON_PROPERTY_PIN = "pin"; - @javax.annotation.Nullable private String pin; - - public static final String JSON_PROPERTY_SMS_PHONE_NUMBER = "sms_phone_number"; - @javax.annotation.Nullable private String smsPhoneNumber; - - /** - * Specifies the feature used with the `sms_phone_number`. Default - * `authentication`. If `authentication`, signer is sent a verification code - * via SMS that is required to access the document. If `delivery`, a link to complete - * the signature request is delivered via SMS (_and_ email). - */ - public enum SmsPhoneNumberTypeEnum { - AUTHENTICATION(String.valueOf("authentication")), - - DELIVERY(String.valueOf("delivery")); - - private String value; - - SmsPhoneNumberTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SmsPhoneNumberTypeEnum fromValue(String value) { - for (SmsPhoneNumberTypeEnum b : SmsPhoneNumberTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE = "sms_phone_number_type"; - @javax.annotation.Nullable private SmsPhoneNumberTypeEnum smsPhoneNumberType; - - public SubSignatureRequestSigner() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubSignatureRequestSigner init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubSignatureRequestSigner.class); - } - - public static SubSignatureRequestSigner init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubSignatureRequestSigner.class); - } - - public SubSignatureRequestSigner name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name of the signer. - * - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - - public SubSignatureRequestSigner emailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address of the signer. - * - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getEmailAddress() { - return emailAddress; - } - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nonnull + private String emailAddress; + + public static final String JSON_PROPERTY_ORDER = "order"; + @javax.annotation.Nullable + private Integer order; + + public static final String JSON_PROPERTY_PIN = "pin"; + @javax.annotation.Nullable + private String pin; + + public static final String JSON_PROPERTY_SMS_PHONE_NUMBER = "sms_phone_number"; + @javax.annotation.Nullable + private String smsPhoneNumber; + + /** + * Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). + */ + public enum SmsPhoneNumberTypeEnum { + AUTHENTICATION(String.valueOf("authentication")), + + DELIVERY(String.valueOf("delivery")); + + private String value; + + SmsPhoneNumberTypeEnum(String value) { + this.value = value; } - public SubSignatureRequestSigner order(@javax.annotation.Nullable Integer order) { - this.order = order; - return this; + @JsonValue + public String getValue() { + return value; } - /** - * The order the signer is required to sign in. - * - * @return order - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getOrder() { - return order; - } - - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrder(@javax.annotation.Nullable Integer order) { - this.order = order; - } - - public SubSignatureRequestSigner pin(@javax.annotation.Nullable String pin) { - this.pin = pin; - return this; - } - - /** - * The 4- to 12-character access code that will secure this signer's signature page. - * - * @return pin - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPin() { - return pin; + @Override + public String toString() { + return String.valueOf(value); } - @JsonProperty(JSON_PROPERTY_PIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPin(@javax.annotation.Nullable String pin) { - this.pin = pin; + @JsonCreator + public static SmsPhoneNumberTypeEnum fromValue(String value) { + for (SmsPhoneNumberTypeEnum b : SmsPhoneNumberTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - public SubSignatureRequestSigner smsPhoneNumber( - @javax.annotation.Nullable String smsPhoneNumber) { - this.smsPhoneNumber = smsPhoneNumber; - return this; + } + + public static final String JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE = "sms_phone_number_type"; + @javax.annotation.Nullable + private SmsPhoneNumberTypeEnum smsPhoneNumberType; + + public SubSignatureRequestSigner() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubSignatureRequestSigner init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubSignatureRequestSigner.class); + } + + static public SubSignatureRequestSigner init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubSignatureRequestSigner.class + ); + } + + public SubSignatureRequestSigner name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the signer. + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SubSignatureRequestSigner emailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The email address of the signer. + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + } + + + public SubSignatureRequestSigner order(@javax.annotation.Nullable Integer order) { + this.order = order; + return this; + } + + /** + * The order the signer is required to sign in. + * @return order + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getOrder() { + return order; + } + + + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(@javax.annotation.Nullable Integer order) { + this.order = order; + } + + + public SubSignatureRequestSigner pin(@javax.annotation.Nullable String pin) { + this.pin = pin; + return this; + } + + /** + * The 4- to 12-character access code that will secure this signer's signature page. + * @return pin + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPin() { + return pin; + } + + + @JsonProperty(JSON_PROPERTY_PIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPin(@javax.annotation.Nullable String pin) { + this.pin = pin; + } + + + public SubSignatureRequestSigner smsPhoneNumber(@javax.annotation.Nullable String smsPhoneNumber) { + this.smsPhoneNumber = smsPhoneNumber; + return this; + } + + /** + * An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. + * @return smsPhoneNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSmsPhoneNumber() { + return smsPhoneNumber; + } + + + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsPhoneNumber(@javax.annotation.Nullable String smsPhoneNumber) { + this.smsPhoneNumber = smsPhoneNumber; + } + + + public SubSignatureRequestSigner smsPhoneNumberType(@javax.annotation.Nullable SmsPhoneNumberTypeEnum smsPhoneNumberType) { + this.smsPhoneNumberType = smsPhoneNumberType; + return this; + } + + /** + * Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). + * @return smsPhoneNumberType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SmsPhoneNumberTypeEnum getSmsPhoneNumberType() { + return smsPhoneNumberType; + } + + + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsPhoneNumberType(@javax.annotation.Nullable SmsPhoneNumberTypeEnum smsPhoneNumberType) { + this.smsPhoneNumberType = smsPhoneNumberType; + } + + + /** + * Return true if this SubSignatureRequestSigner object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * An E.164 formatted phone number. By using the feature, you agree you are responsible for - * obtaining a signer's consent to receive text messages from Dropbox Sign related to this - * signature request and confirm you have obtained such consent from all signers prior to - * enabling SMS delivery for this signature request. [Learn - * more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). - * **NOTE:** Not available in test mode and requires a Standard plan or higher. - * - * @return smsPhoneNumber - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmsPhoneNumber() { - return smsPhoneNumber; + if (o == null || getClass() != o.getClass()) { + return false; } + SubSignatureRequestSigner subSignatureRequestSigner = (SubSignatureRequestSigner) o; + return Objects.equals(this.name, subSignatureRequestSigner.name) && + Objects.equals(this.emailAddress, subSignatureRequestSigner.emailAddress) && + Objects.equals(this.order, subSignatureRequestSigner.order) && + Objects.equals(this.pin, subSignatureRequestSigner.pin) && + Objects.equals(this.smsPhoneNumber, subSignatureRequestSigner.smsPhoneNumber) && + Objects.equals(this.smsPhoneNumberType, subSignatureRequestSigner.smsPhoneNumberType); + } + + @Override + public int hashCode() { + return Objects.hash(name, emailAddress, order, pin, smsPhoneNumber, smsPhoneNumberType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubSignatureRequestSigner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" smsPhoneNumber: ").append(toIndentedString(smsPhoneNumber)).append("\n"); + sb.append(" smsPhoneNumberType: ").append(toIndentedString(smsPhoneNumberType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsPhoneNumber(@javax.annotation.Nullable String smsPhoneNumber) { - this.smsPhoneNumber = smsPhoneNumber; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - public SubSignatureRequestSigner smsPhoneNumberType( - @javax.annotation.Nullable SmsPhoneNumberTypeEnum smsPhoneNumberType) { - this.smsPhoneNumberType = smsPhoneNumberType; - return this; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } + if (order != null) { + if (isFileTypeOrListOfFiles(order)) { + fileTypeFound = true; + } - /** - * Specifies the feature used with the `sms_phone_number`. Default - * `authentication`. If `authentication`, signer is sent a verification code - * via SMS that is required to access the document. If `delivery`, a link to complete - * the signature request is delivered via SMS (_and_ email). - * - * @return smsPhoneNumberType - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SmsPhoneNumberTypeEnum getSmsPhoneNumberType() { - return smsPhoneNumberType; + if (order.getClass().equals(java.io.File.class) || + order.getClass().equals(Integer.class) || + order.getClass().equals(String.class) || + order.getClass().isEnum()) { + map.put("order", order); + } else if (isListOfFile(order)) { + for(int i = 0; i< getListSize(order); i++) { + map.put("order[" + i + "]", getFromList(order, i)); + } + } + else { + map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + } } + if (pin != null) { + if (isFileTypeOrListOfFiles(pin)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsPhoneNumberType( - @javax.annotation.Nullable SmsPhoneNumberTypeEnum smsPhoneNumberType) { - this.smsPhoneNumberType = smsPhoneNumberType; + if (pin.getClass().equals(java.io.File.class) || + pin.getClass().equals(Integer.class) || + pin.getClass().equals(String.class) || + pin.getClass().isEnum()) { + map.put("pin", pin); + } else if (isListOfFile(pin)) { + for(int i = 0; i< getListSize(pin); i++) { + map.put("pin[" + i + "]", getFromList(pin, i)); + } + } + else { + map.put("pin", JSON.getDefault().getMapper().writeValueAsString(pin)); + } } + if (smsPhoneNumber != null) { + if (isFileTypeOrListOfFiles(smsPhoneNumber)) { + fileTypeFound = true; + } - /** Return true if this SubSignatureRequestSigner object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (smsPhoneNumber.getClass().equals(java.io.File.class) || + smsPhoneNumber.getClass().equals(Integer.class) || + smsPhoneNumber.getClass().equals(String.class) || + smsPhoneNumber.getClass().isEnum()) { + map.put("sms_phone_number", smsPhoneNumber); + } else if (isListOfFile(smsPhoneNumber)) { + for(int i = 0; i< getListSize(smsPhoneNumber); i++) { + map.put("sms_phone_number[" + i + "]", getFromList(smsPhoneNumber, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("sms_phone_number", JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumber)); } - SubSignatureRequestSigner subSignatureRequestSigner = (SubSignatureRequestSigner) o; - return Objects.equals(this.name, subSignatureRequestSigner.name) - && Objects.equals(this.emailAddress, subSignatureRequestSigner.emailAddress) - && Objects.equals(this.order, subSignatureRequestSigner.order) - && Objects.equals(this.pin, subSignatureRequestSigner.pin) - && Objects.equals(this.smsPhoneNumber, subSignatureRequestSigner.smsPhoneNumber) - && Objects.equals( - this.smsPhoneNumberType, subSignatureRequestSigner.smsPhoneNumberType); } + if (smsPhoneNumberType != null) { + if (isFileTypeOrListOfFiles(smsPhoneNumberType)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(name, emailAddress, order, pin, smsPhoneNumber, smsPhoneNumberType); + if (smsPhoneNumberType.getClass().equals(java.io.File.class) || + smsPhoneNumberType.getClass().equals(Integer.class) || + smsPhoneNumberType.getClass().equals(String.class) || + smsPhoneNumberType.getClass().isEnum()) { + map.put("sms_phone_number_type", smsPhoneNumberType); + } else if (isListOfFile(smsPhoneNumberType)) { + for(int i = 0; i< getListSize(smsPhoneNumberType); i++) { + map.put("sms_phone_number_type[" + i + "]", getFromList(smsPhoneNumberType, i)); + } + } + else { + map.put("sms_phone_number_type", JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumberType)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubSignatureRequestSigner {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); - sb.append(" smsPhoneNumber: ").append(toIndentedString(smsPhoneNumber)).append("\n"); - sb.append(" smsPhoneNumberType: ") - .append(toIndentedString(smsPhoneNumberType)) - .append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - if (order != null) { - if (isFileTypeOrListOfFiles(order)) { - fileTypeFound = true; - } - - if (order.getClass().equals(java.io.File.class) - || order.getClass().equals(Integer.class) - || order.getClass().equals(String.class) - || order.getClass().isEnum()) { - map.put("order", order); - } else if (isListOfFile(order)) { - for (int i = 0; i < getListSize(order); i++) { - map.put("order[" + i + "]", getFromList(order, i)); - } - } else { - map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); - } - } - if (pin != null) { - if (isFileTypeOrListOfFiles(pin)) { - fileTypeFound = true; - } - - if (pin.getClass().equals(java.io.File.class) - || pin.getClass().equals(Integer.class) - || pin.getClass().equals(String.class) - || pin.getClass().isEnum()) { - map.put("pin", pin); - } else if (isListOfFile(pin)) { - for (int i = 0; i < getListSize(pin); i++) { - map.put("pin[" + i + "]", getFromList(pin, i)); - } - } else { - map.put("pin", JSON.getDefault().getMapper().writeValueAsString(pin)); - } - } - if (smsPhoneNumber != null) { - if (isFileTypeOrListOfFiles(smsPhoneNumber)) { - fileTypeFound = true; - } - - if (smsPhoneNumber.getClass().equals(java.io.File.class) - || smsPhoneNumber.getClass().equals(Integer.class) - || smsPhoneNumber.getClass().equals(String.class) - || smsPhoneNumber.getClass().isEnum()) { - map.put("sms_phone_number", smsPhoneNumber); - } else if (isListOfFile(smsPhoneNumber)) { - for (int i = 0; i < getListSize(smsPhoneNumber); i++) { - map.put("sms_phone_number[" + i + "]", getFromList(smsPhoneNumber, i)); - } - } else { - map.put( - "sms_phone_number", - JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumber)); - } - } - if (smsPhoneNumberType != null) { - if (isFileTypeOrListOfFiles(smsPhoneNumberType)) { - fileTypeFound = true; - } - - if (smsPhoneNumberType.getClass().equals(java.io.File.class) - || smsPhoneNumberType.getClass().equals(Integer.class) - || smsPhoneNumberType.getClass().equals(String.class) - || smsPhoneNumberType.getClass().isEnum()) { - map.put("sms_phone_number_type", smsPhoneNumberType); - } else if (isListOfFile(smsPhoneNumberType)) { - for (int i = 0; i < getListSize(smsPhoneNumberType); i++) { - map.put( - "sms_phone_number_type[" + i + "]", - getFromList(smsPhoneNumberType, i)); - } - } else { - map.put( - "sms_phone_number_type", - JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumberType)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java index a43dfa702..d88d1f378 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java @@ -10,459 +10,460 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SubSignatureRequestTemplateSigner */ + +import com.dropbox.sign.ApiException; +/** + * SubSignatureRequestTemplateSigner + */ @JsonPropertyOrder({ - SubSignatureRequestTemplateSigner.JSON_PROPERTY_ROLE, - SubSignatureRequestTemplateSigner.JSON_PROPERTY_NAME, - SubSignatureRequestTemplateSigner.JSON_PROPERTY_EMAIL_ADDRESS, - SubSignatureRequestTemplateSigner.JSON_PROPERTY_PIN, - SubSignatureRequestTemplateSigner.JSON_PROPERTY_SMS_PHONE_NUMBER, - SubSignatureRequestTemplateSigner.JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE + SubSignatureRequestTemplateSigner.JSON_PROPERTY_ROLE, + SubSignatureRequestTemplateSigner.JSON_PROPERTY_NAME, + SubSignatureRequestTemplateSigner.JSON_PROPERTY_EMAIL_ADDRESS, + SubSignatureRequestTemplateSigner.JSON_PROPERTY_PIN, + SubSignatureRequestTemplateSigner.JSON_PROPERTY_SMS_PHONE_NUMBER, + SubSignatureRequestTemplateSigner.JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubSignatureRequestTemplateSigner { - public static final String JSON_PROPERTY_ROLE = "role"; - @javax.annotation.Nonnull private String role; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull private String name; - - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nonnull private String emailAddress; - - public static final String JSON_PROPERTY_PIN = "pin"; - @javax.annotation.Nullable private String pin; - - public static final String JSON_PROPERTY_SMS_PHONE_NUMBER = "sms_phone_number"; - @javax.annotation.Nullable private String smsPhoneNumber; - - /** - * Specifies the feature used with the `sms_phone_number`. Default - * `authentication`. If `authentication`, signer is sent a verification code - * via SMS that is required to access the document. If `delivery`, a link to complete - * the signature request is delivered via SMS (_and_ email). - */ - public enum SmsPhoneNumberTypeEnum { - AUTHENTICATION(String.valueOf("authentication")), - - DELIVERY(String.valueOf("delivery")); - - private String value; - - SmsPhoneNumberTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SmsPhoneNumberTypeEnum fromValue(String value) { - for (SmsPhoneNumberTypeEnum b : SmsPhoneNumberTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE = "sms_phone_number_type"; - @javax.annotation.Nullable private SmsPhoneNumberTypeEnum smsPhoneNumberType; - - public SubSignatureRequestTemplateSigner() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubSignatureRequestTemplateSigner init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubSignatureRequestTemplateSigner.class); - } - - public static SubSignatureRequestTemplateSigner init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubSignatureRequestTemplateSigner.class); - } - - public SubSignatureRequestTemplateSigner role(@javax.annotation.Nonnull String role) { - this.role = role; - return this; - } - - /** - * Must match an existing role in chosen Template(s). It's case-sensitive. - * - * @return role - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRole() { - return role; - } - - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRole(@javax.annotation.Nonnull String role) { - this.role = role; - } - - public SubSignatureRequestTemplateSigner name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - - /** - * The name of the signer. - * - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; + public static final String JSON_PROPERTY_ROLE = "role"; + @javax.annotation.Nonnull + private String role; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nonnull + private String emailAddress; + + public static final String JSON_PROPERTY_PIN = "pin"; + @javax.annotation.Nullable + private String pin; + + public static final String JSON_PROPERTY_SMS_PHONE_NUMBER = "sms_phone_number"; + @javax.annotation.Nullable + private String smsPhoneNumber; + + /** + * Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). + */ + public enum SmsPhoneNumberTypeEnum { + AUTHENTICATION(String.valueOf("authentication")), + + DELIVERY(String.valueOf("delivery")); + + private String value; + + SmsPhoneNumberTypeEnum(String value) { + this.value = value; } - public SubSignatureRequestTemplateSigner emailAddress( - @javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; - return this; + @JsonValue + public String getValue() { + return value; } - /** - * The email address of the signer. - * - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getEmailAddress() { - return emailAddress; - } - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; - } - - public SubSignatureRequestTemplateSigner pin(@javax.annotation.Nullable String pin) { - this.pin = pin; - return this; - } - - /** - * The 4- to 12-character access code that will secure this signer's signature page. - * - * @return pin - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPin() { - return pin; + @Override + public String toString() { + return String.valueOf(value); } - @JsonProperty(JSON_PROPERTY_PIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPin(@javax.annotation.Nullable String pin) { - this.pin = pin; + @JsonCreator + public static SmsPhoneNumberTypeEnum fromValue(String value) { + for (SmsPhoneNumberTypeEnum b : SmsPhoneNumberTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - public SubSignatureRequestTemplateSigner smsPhoneNumber( - @javax.annotation.Nullable String smsPhoneNumber) { - this.smsPhoneNumber = smsPhoneNumber; - return this; + } + + public static final String JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE = "sms_phone_number_type"; + @javax.annotation.Nullable + private SmsPhoneNumberTypeEnum smsPhoneNumberType; + + public SubSignatureRequestTemplateSigner() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubSignatureRequestTemplateSigner init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubSignatureRequestTemplateSigner.class); + } + + static public SubSignatureRequestTemplateSigner init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubSignatureRequestTemplateSigner.class + ); + } + + public SubSignatureRequestTemplateSigner role(@javax.annotation.Nonnull String role) { + this.role = role; + return this; + } + + /** + * Must match an existing role in chosen Template(s). It's case-sensitive. + * @return role + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRole() { + return role; + } + + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRole(@javax.annotation.Nonnull String role) { + this.role = role; + } + + + public SubSignatureRequestTemplateSigner name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the signer. + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SubSignatureRequestTemplateSigner emailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The email address of the signer. + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + } + + + public SubSignatureRequestTemplateSigner pin(@javax.annotation.Nullable String pin) { + this.pin = pin; + return this; + } + + /** + * The 4- to 12-character access code that will secure this signer's signature page. + * @return pin + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPin() { + return pin; + } + + + @JsonProperty(JSON_PROPERTY_PIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPin(@javax.annotation.Nullable String pin) { + this.pin = pin; + } + + + public SubSignatureRequestTemplateSigner smsPhoneNumber(@javax.annotation.Nullable String smsPhoneNumber) { + this.smsPhoneNumber = smsPhoneNumber; + return this; + } + + /** + * An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. + * @return smsPhoneNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSmsPhoneNumber() { + return smsPhoneNumber; + } + + + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsPhoneNumber(@javax.annotation.Nullable String smsPhoneNumber) { + this.smsPhoneNumber = smsPhoneNumber; + } + + + public SubSignatureRequestTemplateSigner smsPhoneNumberType(@javax.annotation.Nullable SmsPhoneNumberTypeEnum smsPhoneNumberType) { + this.smsPhoneNumberType = smsPhoneNumberType; + return this; + } + + /** + * Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). + * @return smsPhoneNumberType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SmsPhoneNumberTypeEnum getSmsPhoneNumberType() { + return smsPhoneNumberType; + } + + + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsPhoneNumberType(@javax.annotation.Nullable SmsPhoneNumberTypeEnum smsPhoneNumberType) { + this.smsPhoneNumberType = smsPhoneNumberType; + } + + + /** + * Return true if this SubSignatureRequestTemplateSigner object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * An E.164 formatted phone number. By using the feature, you agree you are responsible for - * obtaining a signer's consent to receive text messages from Dropbox Sign related to this - * signature request and confirm you have obtained such consent from all signers prior to - * enabling SMS delivery for this signature request. [Learn - * more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). - * **NOTE:** Not available in test mode and requires a Standard plan or higher. - * - * @return smsPhoneNumber - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmsPhoneNumber() { - return smsPhoneNumber; + if (o == null || getClass() != o.getClass()) { + return false; } + SubSignatureRequestTemplateSigner subSignatureRequestTemplateSigner = (SubSignatureRequestTemplateSigner) o; + return Objects.equals(this.role, subSignatureRequestTemplateSigner.role) && + Objects.equals(this.name, subSignatureRequestTemplateSigner.name) && + Objects.equals(this.emailAddress, subSignatureRequestTemplateSigner.emailAddress) && + Objects.equals(this.pin, subSignatureRequestTemplateSigner.pin) && + Objects.equals(this.smsPhoneNumber, subSignatureRequestTemplateSigner.smsPhoneNumber) && + Objects.equals(this.smsPhoneNumberType, subSignatureRequestTemplateSigner.smsPhoneNumberType); + } + + @Override + public int hashCode() { + return Objects.hash(role, name, emailAddress, pin, smsPhoneNumber, smsPhoneNumberType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubSignatureRequestTemplateSigner {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" smsPhoneNumber: ").append(toIndentedString(smsPhoneNumber)).append("\n"); + sb.append(" smsPhoneNumberType: ").append(toIndentedString(smsPhoneNumberType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (role != null) { + if (isFileTypeOrListOfFiles(role)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsPhoneNumber(@javax.annotation.Nullable String smsPhoneNumber) { - this.smsPhoneNumber = smsPhoneNumber; + if (role.getClass().equals(java.io.File.class) || + role.getClass().equals(Integer.class) || + role.getClass().equals(String.class) || + role.getClass().isEnum()) { + map.put("role", role); + } else if (isListOfFile(role)) { + for(int i = 0; i< getListSize(role); i++) { + map.put("role[" + i + "]", getFromList(role, i)); + } + } + else { + map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - public SubSignatureRequestTemplateSigner smsPhoneNumberType( - @javax.annotation.Nullable SmsPhoneNumberTypeEnum smsPhoneNumberType) { - this.smsPhoneNumberType = smsPhoneNumberType; - return this; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - /** - * Specifies the feature used with the `sms_phone_number`. Default - * `authentication`. If `authentication`, signer is sent a verification code - * via SMS that is required to access the document. If `delivery`, a link to complete - * the signature request is delivered via SMS (_and_ email). - * - * @return smsPhoneNumberType - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SmsPhoneNumberTypeEnum getSmsPhoneNumberType() { - return smsPhoneNumberType; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } + if (pin != null) { + if (isFileTypeOrListOfFiles(pin)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsPhoneNumberType( - @javax.annotation.Nullable SmsPhoneNumberTypeEnum smsPhoneNumberType) { - this.smsPhoneNumberType = smsPhoneNumberType; + if (pin.getClass().equals(java.io.File.class) || + pin.getClass().equals(Integer.class) || + pin.getClass().equals(String.class) || + pin.getClass().isEnum()) { + map.put("pin", pin); + } else if (isListOfFile(pin)) { + for(int i = 0; i< getListSize(pin); i++) { + map.put("pin[" + i + "]", getFromList(pin, i)); + } + } + else { + map.put("pin", JSON.getDefault().getMapper().writeValueAsString(pin)); + } } + if (smsPhoneNumber != null) { + if (isFileTypeOrListOfFiles(smsPhoneNumber)) { + fileTypeFound = true; + } - /** Return true if this SubSignatureRequestTemplateSigner object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (smsPhoneNumber.getClass().equals(java.io.File.class) || + smsPhoneNumber.getClass().equals(Integer.class) || + smsPhoneNumber.getClass().equals(String.class) || + smsPhoneNumber.getClass().isEnum()) { + map.put("sms_phone_number", smsPhoneNumber); + } else if (isListOfFile(smsPhoneNumber)) { + for(int i = 0; i< getListSize(smsPhoneNumber); i++) { + map.put("sms_phone_number[" + i + "]", getFromList(smsPhoneNumber, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("sms_phone_number", JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumber)); } - SubSignatureRequestTemplateSigner subSignatureRequestTemplateSigner = - (SubSignatureRequestTemplateSigner) o; - return Objects.equals(this.role, subSignatureRequestTemplateSigner.role) - && Objects.equals(this.name, subSignatureRequestTemplateSigner.name) - && Objects.equals(this.emailAddress, subSignatureRequestTemplateSigner.emailAddress) - && Objects.equals(this.pin, subSignatureRequestTemplateSigner.pin) - && Objects.equals( - this.smsPhoneNumber, subSignatureRequestTemplateSigner.smsPhoneNumber) - && Objects.equals( - this.smsPhoneNumberType, - subSignatureRequestTemplateSigner.smsPhoneNumberType); } + if (smsPhoneNumberType != null) { + if (isFileTypeOrListOfFiles(smsPhoneNumberType)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(role, name, emailAddress, pin, smsPhoneNumber, smsPhoneNumberType); + if (smsPhoneNumberType.getClass().equals(java.io.File.class) || + smsPhoneNumberType.getClass().equals(Integer.class) || + smsPhoneNumberType.getClass().equals(String.class) || + smsPhoneNumberType.getClass().isEnum()) { + map.put("sms_phone_number_type", smsPhoneNumberType); + } else if (isListOfFile(smsPhoneNumberType)) { + for(int i = 0; i< getListSize(smsPhoneNumberType); i++) { + map.put("sms_phone_number_type[" + i + "]", getFromList(smsPhoneNumberType, i)); + } + } + else { + map.put("sms_phone_number_type", JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumberType)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubSignatureRequestTemplateSigner {\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); - sb.append(" smsPhoneNumber: ").append(toIndentedString(smsPhoneNumber)).append("\n"); - sb.append(" smsPhoneNumberType: ") - .append(toIndentedString(smsPhoneNumberType)) - .append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (role != null) { - if (isFileTypeOrListOfFiles(role)) { - fileTypeFound = true; - } - - if (role.getClass().equals(java.io.File.class) - || role.getClass().equals(Integer.class) - || role.getClass().equals(String.class) - || role.getClass().isEnum()) { - map.put("role", role); - } else if (isListOfFile(role)) { - for (int i = 0; i < getListSize(role); i++) { - map.put("role[" + i + "]", getFromList(role, i)); - } - } else { - map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - if (pin != null) { - if (isFileTypeOrListOfFiles(pin)) { - fileTypeFound = true; - } - - if (pin.getClass().equals(java.io.File.class) - || pin.getClass().equals(Integer.class) - || pin.getClass().equals(String.class) - || pin.getClass().isEnum()) { - map.put("pin", pin); - } else if (isListOfFile(pin)) { - for (int i = 0; i < getListSize(pin); i++) { - map.put("pin[" + i + "]", getFromList(pin, i)); - } - } else { - map.put("pin", JSON.getDefault().getMapper().writeValueAsString(pin)); - } - } - if (smsPhoneNumber != null) { - if (isFileTypeOrListOfFiles(smsPhoneNumber)) { - fileTypeFound = true; - } - - if (smsPhoneNumber.getClass().equals(java.io.File.class) - || smsPhoneNumber.getClass().equals(Integer.class) - || smsPhoneNumber.getClass().equals(String.class) - || smsPhoneNumber.getClass().isEnum()) { - map.put("sms_phone_number", smsPhoneNumber); - } else if (isListOfFile(smsPhoneNumber)) { - for (int i = 0; i < getListSize(smsPhoneNumber); i++) { - map.put("sms_phone_number[" + i + "]", getFromList(smsPhoneNumber, i)); - } - } else { - map.put( - "sms_phone_number", - JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumber)); - } - } - if (smsPhoneNumberType != null) { - if (isFileTypeOrListOfFiles(smsPhoneNumberType)) { - fileTypeFound = true; - } - - if (smsPhoneNumberType.getClass().equals(java.io.File.class) - || smsPhoneNumberType.getClass().equals(Integer.class) - || smsPhoneNumberType.getClass().equals(String.class) - || smsPhoneNumberType.getClass().isEnum()) { - map.put("sms_phone_number_type", smsPhoneNumberType); - } else if (isListOfFile(smsPhoneNumberType)) { - for (int i = 0; i < getListSize(smsPhoneNumberType); i++) { - map.put( - "sms_phone_number_type[" + i + "]", - getFromList(smsPhoneNumberType, i)); - } - } else { - map.put( - "sms_phone_number_type", - JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumberType)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSigningOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSigningOptions.java index 0dea6a670..bfd1c117a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSigningOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSigningOptions.java @@ -10,388 +10,413 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; + +import com.dropbox.sign.ApiException; /** - * This allows the requester to specify the types allowed for creating a signature. **NOTE:** If - * `signing_options` are not defined in the request, the allowed types will default to - * those specified in the account settings. + * This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings. */ @JsonPropertyOrder({ - SubSigningOptions.JSON_PROPERTY_DEFAULT_TYPE, - SubSigningOptions.JSON_PROPERTY_DRAW, - SubSigningOptions.JSON_PROPERTY_PHONE, - SubSigningOptions.JSON_PROPERTY_TYPE, - SubSigningOptions.JSON_PROPERTY_UPLOAD + SubSigningOptions.JSON_PROPERTY_DEFAULT_TYPE, + SubSigningOptions.JSON_PROPERTY_DRAW, + SubSigningOptions.JSON_PROPERTY_PHONE, + SubSigningOptions.JSON_PROPERTY_TYPE, + SubSigningOptions.JSON_PROPERTY_UPLOAD }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubSigningOptions { - /** The default type shown (limited to the listed types) */ - public enum DefaultTypeEnum { - DRAW(String.valueOf("draw")), - - PHONE(String.valueOf("phone")), - - TYPE(String.valueOf("type")), - - UPLOAD(String.valueOf("upload")); - - private String value; - - DefaultTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static DefaultTypeEnum fromValue(String value) { - for (DefaultTypeEnum b : DefaultTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_DEFAULT_TYPE = "default_type"; - @javax.annotation.Nonnull private DefaultTypeEnum defaultType; - - public static final String JSON_PROPERTY_DRAW = "draw"; - @javax.annotation.Nullable private Boolean draw = false; - - public static final String JSON_PROPERTY_PHONE = "phone"; - @javax.annotation.Nullable private Boolean phone = false; - - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable private Boolean type = false; - - public static final String JSON_PROPERTY_UPLOAD = "upload"; - @javax.annotation.Nullable private Boolean upload = false; - - public SubSigningOptions() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubSigningOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubSigningOptions.class); - } - - public static SubSigningOptions init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubSigningOptions.class); - } - - public SubSigningOptions defaultType(@javax.annotation.Nonnull DefaultTypeEnum defaultType) { - this.defaultType = defaultType; - return this; - } - - /** - * The default type shown (limited to the listed types) - * - * @return defaultType - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_DEFAULT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public DefaultTypeEnum getDefaultType() { - return defaultType; - } - - @JsonProperty(JSON_PROPERTY_DEFAULT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDefaultType(@javax.annotation.Nonnull DefaultTypeEnum defaultType) { - this.defaultType = defaultType; - } - - public SubSigningOptions draw(@javax.annotation.Nullable Boolean draw) { - this.draw = draw; - return this; + /** + * The default type shown (limited to the listed types) + */ + public enum DefaultTypeEnum { + DRAW(String.valueOf("draw")), + + PHONE(String.valueOf("phone")), + + TYPE(String.valueOf("type")), + + UPLOAD(String.valueOf("upload")); + + private String value; + + DefaultTypeEnum(String value) { + this.value = value; } - /** - * Allows drawing the signature - * - * @return draw - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DRAW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getDraw() { - return draw; + @JsonValue + public String getValue() { + return value; } - @JsonProperty(JSON_PROPERTY_DRAW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDraw(@javax.annotation.Nullable Boolean draw) { - this.draw = draw; - } - - public SubSigningOptions phone(@javax.annotation.Nullable Boolean phone) { - this.phone = phone; - return this; - } - - /** - * Allows using a smartphone to email the signature - * - * @return phone - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPhone() { - return phone; - } - - @JsonProperty(JSON_PROPERTY_PHONE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPhone(@javax.annotation.Nullable Boolean phone) { - this.phone = phone; + @Override + public String toString() { + return String.valueOf(value); } - public SubSigningOptions type(@javax.annotation.Nullable Boolean type) { - this.type = type; - return this; + @JsonCreator + public static DefaultTypeEnum fromValue(String value) { + for (DefaultTypeEnum b : DefaultTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - /** - * Allows typing the signature - * - * @return type - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getType() { - return type; + } + + public static final String JSON_PROPERTY_DEFAULT_TYPE = "default_type"; + @javax.annotation.Nonnull + private DefaultTypeEnum defaultType; + + public static final String JSON_PROPERTY_DRAW = "draw"; + @javax.annotation.Nullable + private Boolean draw = false; + + public static final String JSON_PROPERTY_PHONE = "phone"; + @javax.annotation.Nullable + private Boolean phone = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private Boolean type = false; + + public static final String JSON_PROPERTY_UPLOAD = "upload"; + @javax.annotation.Nullable + private Boolean upload = false; + + public SubSigningOptions() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubSigningOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubSigningOptions.class); + } + + static public SubSigningOptions init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubSigningOptions.class + ); + } + + public SubSigningOptions defaultType(@javax.annotation.Nonnull DefaultTypeEnum defaultType) { + this.defaultType = defaultType; + return this; + } + + /** + * The default type shown (limited to the listed types) + * @return defaultType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DEFAULT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public DefaultTypeEnum getDefaultType() { + return defaultType; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDefaultType(@javax.annotation.Nonnull DefaultTypeEnum defaultType) { + this.defaultType = defaultType; + } + + + public SubSigningOptions draw(@javax.annotation.Nullable Boolean draw) { + this.draw = draw; + return this; + } + + /** + * Allows drawing the signature + * @return draw + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DRAW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDraw() { + return draw; + } + + + @JsonProperty(JSON_PROPERTY_DRAW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDraw(@javax.annotation.Nullable Boolean draw) { + this.draw = draw; + } + + + public SubSigningOptions phone(@javax.annotation.Nullable Boolean phone) { + this.phone = phone; + return this; + } + + /** + * Allows using a smartphone to email the signature + * @return phone + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPhone() { + return phone; + } + + + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(@javax.annotation.Nullable Boolean phone) { + this.phone = phone; + } + + + public SubSigningOptions type(@javax.annotation.Nullable Boolean type) { + this.type = type; + return this; + } + + /** + * Allows typing the signature + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable Boolean type) { + this.type = type; + } + + + public SubSigningOptions upload(@javax.annotation.Nullable Boolean upload) { + this.upload = upload; + return this; + } + + /** + * Allows uploading the signature + * @return upload + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUpload() { + return upload; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpload(@javax.annotation.Nullable Boolean upload) { + this.upload = upload; + } + + + /** + * Return true if this SubSigningOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable Boolean type) { - this.type = type; + if (o == null || getClass() != o.getClass()) { + return false; } + SubSigningOptions subSigningOptions = (SubSigningOptions) o; + return Objects.equals(this.defaultType, subSigningOptions.defaultType) && + Objects.equals(this.draw, subSigningOptions.draw) && + Objects.equals(this.phone, subSigningOptions.phone) && + Objects.equals(this.type, subSigningOptions.type) && + Objects.equals(this.upload, subSigningOptions.upload); + } + + @Override + public int hashCode() { + return Objects.hash(defaultType, draw, phone, type, upload); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubSigningOptions {\n"); + sb.append(" defaultType: ").append(toIndentedString(defaultType)).append("\n"); + sb.append(" draw: ").append(toIndentedString(draw)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" upload: ").append(toIndentedString(upload)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (defaultType != null) { + if (isFileTypeOrListOfFiles(defaultType)) { + fileTypeFound = true; + } - public SubSigningOptions upload(@javax.annotation.Nullable Boolean upload) { - this.upload = upload; - return this; + if (defaultType.getClass().equals(java.io.File.class) || + defaultType.getClass().equals(Integer.class) || + defaultType.getClass().equals(String.class) || + defaultType.getClass().isEnum()) { + map.put("default_type", defaultType); + } else if (isListOfFile(defaultType)) { + for(int i = 0; i< getListSize(defaultType); i++) { + map.put("default_type[" + i + "]", getFromList(defaultType, i)); + } + } + else { + map.put("default_type", JSON.getDefault().getMapper().writeValueAsString(defaultType)); + } } + if (draw != null) { + if (isFileTypeOrListOfFiles(draw)) { + fileTypeFound = true; + } - /** - * Allows uploading the signature - * - * @return upload - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UPLOAD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getUpload() { - return upload; + if (draw.getClass().equals(java.io.File.class) || + draw.getClass().equals(Integer.class) || + draw.getClass().equals(String.class) || + draw.getClass().isEnum()) { + map.put("draw", draw); + } else if (isListOfFile(draw)) { + for(int i = 0; i< getListSize(draw); i++) { + map.put("draw[" + i + "]", getFromList(draw, i)); + } + } + else { + map.put("draw", JSON.getDefault().getMapper().writeValueAsString(draw)); + } } + if (phone != null) { + if (isFileTypeOrListOfFiles(phone)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_UPLOAD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUpload(@javax.annotation.Nullable Boolean upload) { - this.upload = upload; + if (phone.getClass().equals(java.io.File.class) || + phone.getClass().equals(Integer.class) || + phone.getClass().equals(String.class) || + phone.getClass().isEnum()) { + map.put("phone", phone); + } else if (isListOfFile(phone)) { + for(int i = 0; i< getListSize(phone); i++) { + map.put("phone[" + i + "]", getFromList(phone, i)); + } + } + else { + map.put("phone", JSON.getDefault().getMapper().writeValueAsString(phone)); + } } + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this SubSigningOptions object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - SubSigningOptions subSigningOptions = (SubSigningOptions) o; - return Objects.equals(this.defaultType, subSigningOptions.defaultType) - && Objects.equals(this.draw, subSigningOptions.draw) - && Objects.equals(this.phone, subSigningOptions.phone) - && Objects.equals(this.type, subSigningOptions.type) - && Objects.equals(this.upload, subSigningOptions.upload); } + if (upload != null) { + if (isFileTypeOrListOfFiles(upload)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(defaultType, draw, phone, type, upload); + if (upload.getClass().equals(java.io.File.class) || + upload.getClass().equals(Integer.class) || + upload.getClass().equals(String.class) || + upload.getClass().isEnum()) { + map.put("upload", upload); + } else if (isListOfFile(upload)) { + for(int i = 0; i< getListSize(upload); i++) { + map.put("upload[" + i + "]", getFromList(upload, i)); + } + } + else { + map.put("upload", JSON.getDefault().getMapper().writeValueAsString(upload)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubSigningOptions {\n"); - sb.append(" defaultType: ").append(toIndentedString(defaultType)).append("\n"); - sb.append(" draw: ").append(toIndentedString(draw)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" upload: ").append(toIndentedString(upload)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (defaultType != null) { - if (isFileTypeOrListOfFiles(defaultType)) { - fileTypeFound = true; - } - - if (defaultType.getClass().equals(java.io.File.class) - || defaultType.getClass().equals(Integer.class) - || defaultType.getClass().equals(String.class) - || defaultType.getClass().isEnum()) { - map.put("default_type", defaultType); - } else if (isListOfFile(defaultType)) { - for (int i = 0; i < getListSize(defaultType); i++) { - map.put("default_type[" + i + "]", getFromList(defaultType, i)); - } - } else { - map.put( - "default_type", - JSON.getDefault().getMapper().writeValueAsString(defaultType)); - } - } - if (draw != null) { - if (isFileTypeOrListOfFiles(draw)) { - fileTypeFound = true; - } - - if (draw.getClass().equals(java.io.File.class) - || draw.getClass().equals(Integer.class) - || draw.getClass().equals(String.class) - || draw.getClass().isEnum()) { - map.put("draw", draw); - } else if (isListOfFile(draw)) { - for (int i = 0; i < getListSize(draw); i++) { - map.put("draw[" + i + "]", getFromList(draw, i)); - } - } else { - map.put("draw", JSON.getDefault().getMapper().writeValueAsString(draw)); - } - } - if (phone != null) { - if (isFileTypeOrListOfFiles(phone)) { - fileTypeFound = true; - } - - if (phone.getClass().equals(java.io.File.class) - || phone.getClass().equals(Integer.class) - || phone.getClass().equals(String.class) - || phone.getClass().isEnum()) { - map.put("phone", phone); - } else if (isListOfFile(phone)) { - for (int i = 0; i < getListSize(phone); i++) { - map.put("phone[" + i + "]", getFromList(phone, i)); - } - } else { - map.put("phone", JSON.getDefault().getMapper().writeValueAsString(phone)); - } - } - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (upload != null) { - if (isFileTypeOrListOfFiles(upload)) { - fileTypeFound = true; - } - - if (upload.getClass().equals(java.io.File.class) - || upload.getClass().equals(Integer.class) - || upload.getClass().equals(String.class) - || upload.getClass().isEnum()) { - map.put("upload", upload); - } else if (isListOfFile(upload)) { - for (int i = 0; i < getListSize(upload); i++) { - map.put("upload[" + i + "]", getFromList(upload, i)); - } - } else { - map.put("upload", JSON.getDefault().getMapper().writeValueAsString(upload)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTeamResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTeamResponse.java index 34ff420c4..c5ef56d71 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTeamResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTeamResponse.java @@ -10,201 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** SubTeamResponse */ -@JsonPropertyOrder({SubTeamResponse.JSON_PROPERTY_TEAM_ID, SubTeamResponse.JSON_PROPERTY_NAME}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class SubTeamResponse { - public static final String JSON_PROPERTY_TEAM_ID = "team_id"; - @javax.annotation.Nullable private String teamId; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - public SubTeamResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubTeamResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubTeamResponse.class); - } - public static SubTeamResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubTeamResponse.class); - } - - public SubTeamResponse teamId(@javax.annotation.Nullable String teamId) { - this.teamId = teamId; - return this; - } - - /** - * The id of a team - * - * @return teamId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTeamId() { - return teamId; - } - - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTeamId(@javax.annotation.Nullable String teamId) { - this.teamId = teamId; - } - - public SubTeamResponse name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of a team - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } +import com.dropbox.sign.ApiException; +/** + * SubTeamResponse + */ +@JsonPropertyOrder({ + SubTeamResponse.JSON_PROPERTY_TEAM_ID, + SubTeamResponse.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SubTeamResponse { + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + @javax.annotation.Nullable + private String teamId; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public SubTeamResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubTeamResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubTeamResponse.class); + } + + static public SubTeamResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubTeamResponse.class + ); + } + + public SubTeamResponse teamId(@javax.annotation.Nullable String teamId) { + this.teamId = teamId; + return this; + } + + /** + * The id of a team + * @return teamId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTeamId() { + return teamId; + } + + + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTeamId(@javax.annotation.Nullable String teamId) { + this.teamId = teamId; + } + + + public SubTeamResponse name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of a team + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + /** + * Return true if this SubTeamResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubTeamResponse subTeamResponse = (SubTeamResponse) o; + return Objects.equals(this.teamId, subTeamResponse.teamId) && + Objects.equals(this.name, subTeamResponse.name); + } + + @Override + public int hashCode() { + return Objects.hash(teamId, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubTeamResponse {\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (teamId != null) { + if (isFileTypeOrListOfFiles(teamId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; + if (teamId.getClass().equals(java.io.File.class) || + teamId.getClass().equals(Integer.class) || + teamId.getClass().equals(String.class) || + teamId.getClass().isEnum()) { + map.put("team_id", teamId); + } else if (isListOfFile(teamId)) { + for(int i = 0; i< getListSize(teamId); i++) { + map.put("team_id[" + i + "]", getFromList(teamId, i)); + } + } + else { + map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** Return true if this SubTeamResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); } - SubTeamResponse subTeamResponse = (SubTeamResponse) o; - return Objects.equals(this.teamId, subTeamResponse.teamId) - && Objects.equals(this.name, subTeamResponse.name); } - - @Override - public int hashCode() { - return Objects.hash(teamId, name); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubTeamResponse {\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (teamId != null) { - if (isFileTypeOrListOfFiles(teamId)) { - fileTypeFound = true; - } - - if (teamId.getClass().equals(java.io.File.class) - || teamId.getClass().equals(Integer.class) - || teamId.getClass().equals(String.class) - || teamId.getClass().isEnum()) { - map.put("team_id", teamId); - } else if (isListOfFile(teamId)) { - for (int i = 0; i < getListSize(teamId); i++) { - map.put("team_id[" + i + "]", getFromList(teamId, i)); - } - } else { - map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTemplateRole.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTemplateRole.java index d1d482e85..0ec63c07e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTemplateRole.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTemplateRole.java @@ -10,202 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** SubTemplateRole */ -@JsonPropertyOrder({SubTemplateRole.JSON_PROPERTY_NAME, SubTemplateRole.JSON_PROPERTY_ORDER}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class SubTemplateRole { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_ORDER = "order"; - @javax.annotation.Nullable private Integer order; - public SubTemplateRole() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubTemplateRole init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubTemplateRole.class); - } - public static SubTemplateRole init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), SubTemplateRole.class); - } - - public SubTemplateRole name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The role name of the signer that will be displayed when the template is used to create a - * signature request. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public SubTemplateRole order(@javax.annotation.Nullable Integer order) { - this.order = order; - return this; - } - - /** - * The order in which this signer role is required to sign. - * - * @return order - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getOrder() { - return order; - } +import com.dropbox.sign.ApiException; +/** + * SubTemplateRole + */ +@JsonPropertyOrder({ + SubTemplateRole.JSON_PROPERTY_NAME, + SubTemplateRole.JSON_PROPERTY_ORDER +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class SubTemplateRole { + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_ORDER = "order"; + @javax.annotation.Nullable + private Integer order; + + public SubTemplateRole() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubTemplateRole init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubTemplateRole.class); + } + + static public SubTemplateRole init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubTemplateRole.class + ); + } + + public SubTemplateRole name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The role name of the signer that will be displayed when the template is used to create a signature request. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SubTemplateRole order(@javax.annotation.Nullable Integer order) { + this.order = order; + return this; + } + + /** + * The order in which this signer role is required to sign. + * @return order + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getOrder() { + return order; + } + + + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(@javax.annotation.Nullable Integer order) { + this.order = order; + } + + + /** + * Return true if this SubTemplateRole object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubTemplateRole subTemplateRole = (SubTemplateRole) o; + return Objects.equals(this.name, subTemplateRole.name) && + Objects.equals(this.order, subTemplateRole.order); + } + + @Override + public int hashCode() { + return Objects.hash(name, order); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubTemplateRole {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrder(@javax.annotation.Nullable Integer order) { - this.order = order; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (order != null) { + if (isFileTypeOrListOfFiles(order)) { + fileTypeFound = true; + } - /** Return true if this SubTemplateRole object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (order.getClass().equals(java.io.File.class) || + order.getClass().equals(Integer.class) || + order.getClass().equals(String.class) || + order.getClass().isEnum()) { + map.put("order", order); + } else if (isListOfFile(order)) { + for(int i = 0; i< getListSize(order); i++) { + map.put("order[" + i + "]", getFromList(order, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); } - SubTemplateRole subTemplateRole = (SubTemplateRole) o; - return Objects.equals(this.name, subTemplateRole.name) - && Objects.equals(this.order, subTemplateRole.order); } - - @Override - public int hashCode() { - return Objects.hash(name, order); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubTemplateRole {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (order != null) { - if (isFileTypeOrListOfFiles(order)) { - fileTypeFound = true; - } - - if (order.getClass().equals(java.io.File.class) - || order.getClass().equals(Integer.class) - || order.getClass().equals(String.class) - || order.getClass().isEnum()) { - map.put("order", order); - } else if (isListOfFile(order)) { - for (int i = 0; i < getListSize(order); i++) { - map.put("order[" + i + "]", getFromList(order, i)); - } - } else { - map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java index e7761bd14..0c77cabee 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java @@ -10,255 +10,272 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SubUnclaimedDraftSigner */ + +import com.dropbox.sign.ApiException; +/** + * SubUnclaimedDraftSigner + */ @JsonPropertyOrder({ - SubUnclaimedDraftSigner.JSON_PROPERTY_EMAIL_ADDRESS, - SubUnclaimedDraftSigner.JSON_PROPERTY_NAME, - SubUnclaimedDraftSigner.JSON_PROPERTY_ORDER + SubUnclaimedDraftSigner.JSON_PROPERTY_EMAIL_ADDRESS, + SubUnclaimedDraftSigner.JSON_PROPERTY_NAME, + SubUnclaimedDraftSigner.JSON_PROPERTY_ORDER }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubUnclaimedDraftSigner { - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nonnull private String emailAddress; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nonnull + private String emailAddress; - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull private String name; + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; - public static final String JSON_PROPERTY_ORDER = "order"; - @javax.annotation.Nullable private Integer order; + public static final String JSON_PROPERTY_ORDER = "order"; + @javax.annotation.Nullable + private Integer order; - public SubUnclaimedDraftSigner() {} + public SubUnclaimedDraftSigner() { + } - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubUnclaimedDraftSigner init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubUnclaimedDraftSigner.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubUnclaimedDraftSigner init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubUnclaimedDraftSigner.class); + } - public static SubUnclaimedDraftSigner init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), SubUnclaimedDraftSigner.class); - } + static public SubUnclaimedDraftSigner init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubUnclaimedDraftSigner.class + ); + } - public SubUnclaimedDraftSigner emailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; - return this; - } + public SubUnclaimedDraftSigner emailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + return this; + } - /** - * The email address of the signer. - * - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getEmailAddress() { - return emailAddress; - } + /** + * The email address of the signer. + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; - } + public String getEmailAddress() { + return emailAddress; + } - public SubUnclaimedDraftSigner name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - /** - * The name of the signer. - * - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + } - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - public SubUnclaimedDraftSigner order(@javax.annotation.Nullable Integer order) { - this.order = order; - return this; - } + public SubUnclaimedDraftSigner name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } - /** - * The order the signer is required to sign in. - * - * @return order - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getOrder() { - return order; - } + /** + * The name of the signer. + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SubUnclaimedDraftSigner order(@javax.annotation.Nullable Integer order) { + this.order = order; + return this; + } + + /** + * The order the signer is required to sign in. + * @return order + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrder(@javax.annotation.Nullable Integer order) { - this.order = order; + public Integer getOrder() { + return order; + } + + + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(@javax.annotation.Nullable Integer order) { + this.order = order; + } + + + /** + * Return true if this SubUnclaimedDraftSigner object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubUnclaimedDraftSigner subUnclaimedDraftSigner = (SubUnclaimedDraftSigner) o; + return Objects.equals(this.emailAddress, subUnclaimedDraftSigner.emailAddress) && + Objects.equals(this.name, subUnclaimedDraftSigner.name) && + Objects.equals(this.order, subUnclaimedDraftSigner.order); + } - /** Return true if this SubUnclaimedDraftSigner object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; + @Override + public int hashCode() { + return Objects.hash(emailAddress, name, order); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubUnclaimedDraftSigner {\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; } - SubUnclaimedDraftSigner subUnclaimedDraftSigner = (SubUnclaimedDraftSigner) o; - return Objects.equals(this.emailAddress, subUnclaimedDraftSigner.emailAddress) - && Objects.equals(this.name, subUnclaimedDraftSigner.name) - && Objects.equals(this.order, subUnclaimedDraftSigner.order); - } - @Override - public int hashCode() { - return Objects.hash(emailAddress, name, order); + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubUnclaimedDraftSigner {\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append("}"); - return sb.toString(); + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (order != null) { + if (isFileTypeOrListOfFiles(order)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + if (order.getClass().equals(java.io.File.class) || + order.getClass().equals(Integer.class) || + order.getClass().equals(String.class) || + order.getClass().isEnum()) { + map.put("order", order); + } else if (isListOfFile(order)) { + for(int i = 0; i< getListSize(order); i++) { + map.put("order[" + i + "]", getFromList(order, i)); } - if (order != null) { - if (isFileTypeOrListOfFiles(order)) { - fileTypeFound = true; - } - - if (order.getClass().equals(java.io.File.class) - || order.getClass().equals(Integer.class) - || order.getClass().equals(String.class) - || order.getClass().isEnum()) { - map.put("order", order); - } else if (isListOfFile(order)) { - for (int i = 0; i < getListSize(order); i++) { - map.put("order[" + i + "]", getFromList(order, i)); - } - } else { - map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java index 337c82ff8..0a85657dd 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java @@ -10,259 +10,272 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** SubUnclaimedDraftTemplateSigner */ + +import com.dropbox.sign.ApiException; +/** + * SubUnclaimedDraftTemplateSigner + */ @JsonPropertyOrder({ - SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_ROLE, - SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_NAME, - SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_EMAIL_ADDRESS + SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_ROLE, + SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_NAME, + SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_EMAIL_ADDRESS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubUnclaimedDraftTemplateSigner { - public static final String JSON_PROPERTY_ROLE = "role"; - @javax.annotation.Nonnull private String role; + public static final String JSON_PROPERTY_ROLE = "role"; + @javax.annotation.Nonnull + private String role; - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nonnull private String name; + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nonnull private String emailAddress; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nonnull + private String emailAddress; - public SubUnclaimedDraftTemplateSigner() {} + public SubUnclaimedDraftTemplateSigner() { + } - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubUnclaimedDraftTemplateSigner init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubUnclaimedDraftTemplateSigner.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubUnclaimedDraftTemplateSigner init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubUnclaimedDraftTemplateSigner.class); + } - public static SubUnclaimedDraftTemplateSigner init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - SubUnclaimedDraftTemplateSigner.class); - } + static public SubUnclaimedDraftTemplateSigner init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubUnclaimedDraftTemplateSigner.class + ); + } - public SubUnclaimedDraftTemplateSigner role(@javax.annotation.Nonnull String role) { - this.role = role; - return this; - } + public SubUnclaimedDraftTemplateSigner role(@javax.annotation.Nonnull String role) { + this.role = role; + return this; + } - /** - * Must match an existing role in chosen Template(s). - * - * @return role - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRole() { - return role; - } + /** + * Must match an existing role in chosen Template(s). + * @return role + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRole(@javax.annotation.Nonnull String role) { - this.role = role; - } + public String getRole() { + return role; + } - public SubUnclaimedDraftTemplateSigner name(@javax.annotation.Nonnull String name) { - this.name = name; - return this; - } - /** - * The name of the signer filling the role of `role`. - * - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRole(@javax.annotation.Nonnull String role) { + this.role = role; + } - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@javax.annotation.Nonnull String name) { - this.name = name; - } - public SubUnclaimedDraftTemplateSigner emailAddress( - @javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; - return this; - } + public SubUnclaimedDraftTemplateSigner name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } - /** - * The email address of the signer filling the role of `role`. - * - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getEmailAddress() { - return emailAddress; - } + /** + * The name of the signer filling the role of `role`. + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SubUnclaimedDraftTemplateSigner emailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The email address of the signer filling the role of `role`. + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { - this.emailAddress = emailAddress; + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(@javax.annotation.Nonnull String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this SubUnclaimedDraftTemplateSigner object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubUnclaimedDraftTemplateSigner subUnclaimedDraftTemplateSigner = (SubUnclaimedDraftTemplateSigner) o; + return Objects.equals(this.role, subUnclaimedDraftTemplateSigner.role) && + Objects.equals(this.name, subUnclaimedDraftTemplateSigner.name) && + Objects.equals(this.emailAddress, subUnclaimedDraftTemplateSigner.emailAddress); + } - /** Return true if this SubUnclaimedDraftTemplateSigner object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; + @Override + public int hashCode() { + return Objects.hash(role, name, emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubUnclaimedDraftTemplateSigner {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (role != null) { + if (isFileTypeOrListOfFiles(role)) { + fileTypeFound = true; } - SubUnclaimedDraftTemplateSigner subUnclaimedDraftTemplateSigner = - (SubUnclaimedDraftTemplateSigner) o; - return Objects.equals(this.role, subUnclaimedDraftTemplateSigner.role) - && Objects.equals(this.name, subUnclaimedDraftTemplateSigner.name) - && Objects.equals(this.emailAddress, subUnclaimedDraftTemplateSigner.emailAddress); - } - @Override - public int hashCode() { - return Objects.hash(role, name, emailAddress); + if (role.getClass().equals(java.io.File.class) || + role.getClass().equals(Integer.class) || + role.getClass().equals(String.class) || + role.getClass().isEnum()) { + map.put("role", role); + } else if (isListOfFile(role)) { + for(int i = 0; i< getListSize(role); i++) { + map.put("role[" + i + "]", getFromList(role, i)); + } + } + else { + map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubUnclaimedDraftTemplateSigner {\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append("}"); - return sb.toString(); + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (role != null) { - if (isFileTypeOrListOfFiles(role)) { - fileTypeFound = true; - } - - if (role.getClass().equals(java.io.File.class) - || role.getClass().equals(Integer.class) - || role.getClass().equals(String.class) - || role.getClass().isEnum()) { - map.put("role", role); - } else if (isListOfFile(role)) { - for (int i = 0; i < getListSize(role); i++) { - map.put("role[" + i + "]", getFromList(role, i)); - } - } else { - map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java index aaa5e980f..3ded27fe3 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java @@ -10,980 +10,919 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; + +import com.dropbox.sign.ApiException; /** - * An array of elements and values serialized to a string, to be used to customize the app's - * signer page. (Only applies to some API plans) Take a look at our [white labeling - * guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more. + * An array of elements and values serialized to a string, to be used to customize the app's signer page. (Only applies to some API plans) Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more. */ @JsonPropertyOrder({ - SubWhiteLabelingOptions.JSON_PROPERTY_HEADER_BACKGROUND_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_LEGAL_VERSION, - SubWhiteLabelingOptions.JSON_PROPERTY_LINK_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_PAGE_BACKGROUND_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER, - SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER, - SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER, - SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER, - SubWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR1, - SubWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR2, - SubWhiteLabelingOptions.JSON_PROPERTY_RESET_TO_DEFAULT + SubWhiteLabelingOptions.JSON_PROPERTY_HEADER_BACKGROUND_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_LEGAL_VERSION, + SubWhiteLabelingOptions.JSON_PROPERTY_LINK_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_PAGE_BACKGROUND_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER, + SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER, + SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER, + SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER, + SubWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR1, + SubWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR2, + SubWhiteLabelingOptions.JSON_PROPERTY_RESET_TO_DEFAULT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class SubWhiteLabelingOptions { - public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; - @javax.annotation.Nullable private String headerBackgroundColor = "#1a1a1a"; - - /** Gets or Sets legalVersion */ - public enum LegalVersionEnum { - TERMS1(String.valueOf("terms1")), - - TERMS2(String.valueOf("terms2")); - - private String value; - - LegalVersionEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } + public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; + @javax.annotation.Nullable + private String headerBackgroundColor = "#1a1a1a"; - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static LegalVersionEnum fromValue(String value) { - for (LegalVersionEnum b : LegalVersionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_LEGAL_VERSION = "legal_version"; - @javax.annotation.Nullable private LegalVersionEnum legalVersion = LegalVersionEnum.TERMS1; - - public static final String JSON_PROPERTY_LINK_COLOR = "link_color"; - @javax.annotation.Nullable private String linkColor = "#0061FE"; - - public static final String JSON_PROPERTY_PAGE_BACKGROUND_COLOR = "page_background_color"; - @javax.annotation.Nullable private String pageBackgroundColor = "#f7f8f9"; - - public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR = "primary_button_color"; - @javax.annotation.Nullable private String primaryButtonColor = "#0061FE"; - - public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER = - "primary_button_color_hover"; - @javax.annotation.Nullable private String primaryButtonColorHover = "#0061FE"; - - public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR = - "primary_button_text_color"; - @javax.annotation.Nullable private String primaryButtonTextColor = "#ffffff"; - - public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER = - "primary_button_text_color_hover"; - @javax.annotation.Nullable private String primaryButtonTextColorHover = "#ffffff"; - - public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR = "secondary_button_color"; - @javax.annotation.Nullable private String secondaryButtonColor = "#ffffff"; + /** + * Gets or Sets legalVersion + */ + public enum LegalVersionEnum { + TERMS1(String.valueOf("terms1")), + + TERMS2(String.valueOf("terms2")); - public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER = - "secondary_button_color_hover"; - @javax.annotation.Nullable private String secondaryButtonColorHover = "#ffffff"; - - public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR = - "secondary_button_text_color"; - @javax.annotation.Nullable private String secondaryButtonTextColor = "#0061FE"; - - public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER = - "secondary_button_text_color_hover"; - @javax.annotation.Nullable private String secondaryButtonTextColorHover = "#0061FE"; - - public static final String JSON_PROPERTY_TEXT_COLOR1 = "text_color1"; - @javax.annotation.Nullable private String textColor1 = "#808080"; - - public static final String JSON_PROPERTY_TEXT_COLOR2 = "text_color2"; - @javax.annotation.Nullable private String textColor2 = "#ffffff"; - - public static final String JSON_PROPERTY_RESET_TO_DEFAULT = "reset_to_default"; - @javax.annotation.Nullable private Boolean resetToDefault; - - public SubWhiteLabelingOptions() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static SubWhiteLabelingOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubWhiteLabelingOptions.class); - } - - public static SubWhiteLabelingOptions init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), SubWhiteLabelingOptions.class); - } - - public SubWhiteLabelingOptions headerBackgroundColor( - @javax.annotation.Nullable String headerBackgroundColor) { - this.headerBackgroundColor = headerBackgroundColor; - return this; - } + private String value; - /** - * Get headerBackgroundColor - * - * @return headerBackgroundColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getHeaderBackgroundColor() { - return headerBackgroundColor; + LegalVersionEnum(String value) { + this.value = value; } - @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaderBackgroundColor(@javax.annotation.Nullable String headerBackgroundColor) { - this.headerBackgroundColor = headerBackgroundColor; + @JsonValue + public String getValue() { + return value; } - public SubWhiteLabelingOptions legalVersion( - @javax.annotation.Nullable LegalVersionEnum legalVersion) { - this.legalVersion = legalVersion; - return this; - } - - /** - * Get legalVersion - * - * @return legalVersion - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public LegalVersionEnum getLegalVersion() { - return legalVersion; - } - - @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLegalVersion(@javax.annotation.Nullable LegalVersionEnum legalVersion) { - this.legalVersion = legalVersion; - } - - public SubWhiteLabelingOptions linkColor(@javax.annotation.Nullable String linkColor) { - this.linkColor = linkColor; - return this; - } - - /** - * Get linkColor - * - * @return linkColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LINK_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLinkColor() { - return linkColor; - } - - @JsonProperty(JSON_PROPERTY_LINK_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLinkColor(@javax.annotation.Nullable String linkColor) { - this.linkColor = linkColor; - } - - public SubWhiteLabelingOptions pageBackgroundColor( - @javax.annotation.Nullable String pageBackgroundColor) { - this.pageBackgroundColor = pageBackgroundColor; - return this; - } - - /** - * Get pageBackgroundColor - * - * @return pageBackgroundColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPageBackgroundColor() { - return pageBackgroundColor; - } - - @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPageBackgroundColor(@javax.annotation.Nullable String pageBackgroundColor) { - this.pageBackgroundColor = pageBackgroundColor; - } - - public SubWhiteLabelingOptions primaryButtonColor( - @javax.annotation.Nullable String primaryButtonColor) { - this.primaryButtonColor = primaryButtonColor; - return this; - } - - /** - * Get primaryButtonColor - * - * @return primaryButtonColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPrimaryButtonColor() { - return primaryButtonColor; - } - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonColor(@javax.annotation.Nullable String primaryButtonColor) { - this.primaryButtonColor = primaryButtonColor; - } - - public SubWhiteLabelingOptions primaryButtonColorHover( - @javax.annotation.Nullable String primaryButtonColorHover) { - this.primaryButtonColorHover = primaryButtonColorHover; - return this; - } - - /** - * Get primaryButtonColorHover - * - * @return primaryButtonColorHover - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPrimaryButtonColorHover() { - return primaryButtonColorHover; - } - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonColorHover( - @javax.annotation.Nullable String primaryButtonColorHover) { - this.primaryButtonColorHover = primaryButtonColorHover; - } - - public SubWhiteLabelingOptions primaryButtonTextColor( - @javax.annotation.Nullable String primaryButtonTextColor) { - this.primaryButtonTextColor = primaryButtonTextColor; - return this; - } - - /** - * Get primaryButtonTextColor - * - * @return primaryButtonTextColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPrimaryButtonTextColor() { - return primaryButtonTextColor; - } - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonTextColor( - @javax.annotation.Nullable String primaryButtonTextColor) { - this.primaryButtonTextColor = primaryButtonTextColor; - } - - public SubWhiteLabelingOptions primaryButtonTextColorHover( - @javax.annotation.Nullable String primaryButtonTextColorHover) { - this.primaryButtonTextColorHover = primaryButtonTextColorHover; - return this; - } - - /** - * Get primaryButtonTextColorHover - * - * @return primaryButtonTextColorHover - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPrimaryButtonTextColorHover() { - return primaryButtonTextColorHover; - } - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonTextColorHover( - @javax.annotation.Nullable String primaryButtonTextColorHover) { - this.primaryButtonTextColorHover = primaryButtonTextColorHover; - } - - public SubWhiteLabelingOptions secondaryButtonColor( - @javax.annotation.Nullable String secondaryButtonColor) { - this.secondaryButtonColor = secondaryButtonColor; - return this; - } - - /** - * Get secondaryButtonColor - * - * @return secondaryButtonColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSecondaryButtonColor() { - return secondaryButtonColor; - } - - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonColor(@javax.annotation.Nullable String secondaryButtonColor) { - this.secondaryButtonColor = secondaryButtonColor; - } - - public SubWhiteLabelingOptions secondaryButtonColorHover( - @javax.annotation.Nullable String secondaryButtonColorHover) { - this.secondaryButtonColorHover = secondaryButtonColorHover; - return this; - } - - /** - * Get secondaryButtonColorHover - * - * @return secondaryButtonColorHover - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSecondaryButtonColorHover() { - return secondaryButtonColorHover; - } - - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonColorHover( - @javax.annotation.Nullable String secondaryButtonColorHover) { - this.secondaryButtonColorHover = secondaryButtonColorHover; - } - - public SubWhiteLabelingOptions secondaryButtonTextColor( - @javax.annotation.Nullable String secondaryButtonTextColor) { - this.secondaryButtonTextColor = secondaryButtonTextColor; - return this; + @Override + public String toString() { + return String.valueOf(value); } - /** - * Get secondaryButtonTextColor - * - * @return secondaryButtonTextColor - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSecondaryButtonTextColor() { - return secondaryButtonTextColor; - } + @JsonCreator + public static LegalVersionEnum fromValue(String value) { + for (LegalVersionEnum b : LegalVersionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_LEGAL_VERSION = "legal_version"; + @javax.annotation.Nullable + private LegalVersionEnum legalVersion = LegalVersionEnum.TERMS1; + + public static final String JSON_PROPERTY_LINK_COLOR = "link_color"; + @javax.annotation.Nullable + private String linkColor = "#0061FE"; + + public static final String JSON_PROPERTY_PAGE_BACKGROUND_COLOR = "page_background_color"; + @javax.annotation.Nullable + private String pageBackgroundColor = "#f7f8f9"; + + public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR = "primary_button_color"; + @javax.annotation.Nullable + private String primaryButtonColor = "#0061FE"; + + public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER = "primary_button_color_hover"; + @javax.annotation.Nullable + private String primaryButtonColorHover = "#0061FE"; + + public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR = "primary_button_text_color"; + @javax.annotation.Nullable + private String primaryButtonTextColor = "#ffffff"; + + public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER = "primary_button_text_color_hover"; + @javax.annotation.Nullable + private String primaryButtonTextColorHover = "#ffffff"; + + public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR = "secondary_button_color"; + @javax.annotation.Nullable + private String secondaryButtonColor = "#ffffff"; + + public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER = "secondary_button_color_hover"; + @javax.annotation.Nullable + private String secondaryButtonColorHover = "#ffffff"; + + public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR = "secondary_button_text_color"; + @javax.annotation.Nullable + private String secondaryButtonTextColor = "#0061FE"; + + public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER = "secondary_button_text_color_hover"; + @javax.annotation.Nullable + private String secondaryButtonTextColorHover = "#0061FE"; + + public static final String JSON_PROPERTY_TEXT_COLOR1 = "text_color1"; + @javax.annotation.Nullable + private String textColor1 = "#808080"; + + public static final String JSON_PROPERTY_TEXT_COLOR2 = "text_color2"; + @javax.annotation.Nullable + private String textColor2 = "#ffffff"; + + public static final String JSON_PROPERTY_RESET_TO_DEFAULT = "reset_to_default"; + @javax.annotation.Nullable + private Boolean resetToDefault; + + public SubWhiteLabelingOptions() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public SubWhiteLabelingOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubWhiteLabelingOptions.class); + } + + static public SubWhiteLabelingOptions init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + SubWhiteLabelingOptions.class + ); + } + + public SubWhiteLabelingOptions headerBackgroundColor(@javax.annotation.Nullable String headerBackgroundColor) { + this.headerBackgroundColor = headerBackgroundColor; + return this; + } + + /** + * Get headerBackgroundColor + * @return headerBackgroundColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHeaderBackgroundColor() { + return headerBackgroundColor; + } + + + @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderBackgroundColor(@javax.annotation.Nullable String headerBackgroundColor) { + this.headerBackgroundColor = headerBackgroundColor; + } + + + public SubWhiteLabelingOptions legalVersion(@javax.annotation.Nullable LegalVersionEnum legalVersion) { + this.legalVersion = legalVersion; + return this; + } + + /** + * Get legalVersion + * @return legalVersion + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LegalVersionEnum getLegalVersion() { + return legalVersion; + } + + + @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLegalVersion(@javax.annotation.Nullable LegalVersionEnum legalVersion) { + this.legalVersion = legalVersion; + } + + + public SubWhiteLabelingOptions linkColor(@javax.annotation.Nullable String linkColor) { + this.linkColor = linkColor; + return this; + } + + /** + * Get linkColor + * @return linkColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINK_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLinkColor() { + return linkColor; + } + + + @JsonProperty(JSON_PROPERTY_LINK_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkColor(@javax.annotation.Nullable String linkColor) { + this.linkColor = linkColor; + } + + + public SubWhiteLabelingOptions pageBackgroundColor(@javax.annotation.Nullable String pageBackgroundColor) { + this.pageBackgroundColor = pageBackgroundColor; + return this; + } + + /** + * Get pageBackgroundColor + * @return pageBackgroundColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPageBackgroundColor() { + return pageBackgroundColor; + } + + + @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageBackgroundColor(@javax.annotation.Nullable String pageBackgroundColor) { + this.pageBackgroundColor = pageBackgroundColor; + } + + + public SubWhiteLabelingOptions primaryButtonColor(@javax.annotation.Nullable String primaryButtonColor) { + this.primaryButtonColor = primaryButtonColor; + return this; + } + + /** + * Get primaryButtonColor + * @return primaryButtonColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrimaryButtonColor() { + return primaryButtonColor; + } + + + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonColor(@javax.annotation.Nullable String primaryButtonColor) { + this.primaryButtonColor = primaryButtonColor; + } + + + public SubWhiteLabelingOptions primaryButtonColorHover(@javax.annotation.Nullable String primaryButtonColorHover) { + this.primaryButtonColorHover = primaryButtonColorHover; + return this; + } + + /** + * Get primaryButtonColorHover + * @return primaryButtonColorHover + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrimaryButtonColorHover() { + return primaryButtonColorHover; + } + + + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonColorHover(@javax.annotation.Nullable String primaryButtonColorHover) { + this.primaryButtonColorHover = primaryButtonColorHover; + } + + + public SubWhiteLabelingOptions primaryButtonTextColor(@javax.annotation.Nullable String primaryButtonTextColor) { + this.primaryButtonTextColor = primaryButtonTextColor; + return this; + } + + /** + * Get primaryButtonTextColor + * @return primaryButtonTextColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrimaryButtonTextColor() { + return primaryButtonTextColor; + } + + + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonTextColor(@javax.annotation.Nullable String primaryButtonTextColor) { + this.primaryButtonTextColor = primaryButtonTextColor; + } + + + public SubWhiteLabelingOptions primaryButtonTextColorHover(@javax.annotation.Nullable String primaryButtonTextColorHover) { + this.primaryButtonTextColorHover = primaryButtonTextColorHover; + return this; + } + + /** + * Get primaryButtonTextColorHover + * @return primaryButtonTextColorHover + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrimaryButtonTextColorHover() { + return primaryButtonTextColorHover; + } + + + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonTextColorHover(@javax.annotation.Nullable String primaryButtonTextColorHover) { + this.primaryButtonTextColorHover = primaryButtonTextColorHover; + } + + + public SubWhiteLabelingOptions secondaryButtonColor(@javax.annotation.Nullable String secondaryButtonColor) { + this.secondaryButtonColor = secondaryButtonColor; + return this; + } + + /** + * Get secondaryButtonColor + * @return secondaryButtonColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSecondaryButtonColor() { + return secondaryButtonColor; + } + + + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonColor(@javax.annotation.Nullable String secondaryButtonColor) { + this.secondaryButtonColor = secondaryButtonColor; + } + + + public SubWhiteLabelingOptions secondaryButtonColorHover(@javax.annotation.Nullable String secondaryButtonColorHover) { + this.secondaryButtonColorHover = secondaryButtonColorHover; + return this; + } + + /** + * Get secondaryButtonColorHover + * @return secondaryButtonColorHover + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSecondaryButtonColorHover() { + return secondaryButtonColorHover; + } + + + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonColorHover(@javax.annotation.Nullable String secondaryButtonColorHover) { + this.secondaryButtonColorHover = secondaryButtonColorHover; + } + + + public SubWhiteLabelingOptions secondaryButtonTextColor(@javax.annotation.Nullable String secondaryButtonTextColor) { + this.secondaryButtonTextColor = secondaryButtonTextColor; + return this; + } + + /** + * Get secondaryButtonTextColor + * @return secondaryButtonTextColor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSecondaryButtonTextColor() { + return secondaryButtonTextColor; + } + + + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonTextColor(@javax.annotation.Nullable String secondaryButtonTextColor) { + this.secondaryButtonTextColor = secondaryButtonTextColor; + } + + + public SubWhiteLabelingOptions secondaryButtonTextColorHover(@javax.annotation.Nullable String secondaryButtonTextColorHover) { + this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; + return this; + } + + /** + * Get secondaryButtonTextColorHover + * @return secondaryButtonTextColorHover + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSecondaryButtonTextColorHover() { + return secondaryButtonTextColorHover; + } + + + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonTextColorHover(@javax.annotation.Nullable String secondaryButtonTextColorHover) { + this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; + } + + + public SubWhiteLabelingOptions textColor1(@javax.annotation.Nullable String textColor1) { + this.textColor1 = textColor1; + return this; + } + + /** + * Get textColor1 + * @return textColor1 + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTextColor1() { + return textColor1; + } + + + @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTextColor1(@javax.annotation.Nullable String textColor1) { + this.textColor1 = textColor1; + } + + + public SubWhiteLabelingOptions textColor2(@javax.annotation.Nullable String textColor2) { + this.textColor2 = textColor2; + return this; + } + + /** + * Get textColor2 + * @return textColor2 + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTextColor2() { + return textColor2; + } + + + @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTextColor2(@javax.annotation.Nullable String textColor2) { + this.textColor2 = textColor2; + } + + + public SubWhiteLabelingOptions resetToDefault(@javax.annotation.Nullable Boolean resetToDefault) { + this.resetToDefault = resetToDefault; + return this; + } + + /** + * Resets white labeling options to defaults. Only useful when updating an API App. + * @return resetToDefault + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESET_TO_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getResetToDefault() { + return resetToDefault; + } + + + @JsonProperty(JSON_PROPERTY_RESET_TO_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResetToDefault(@javax.annotation.Nullable Boolean resetToDefault) { + this.resetToDefault = resetToDefault; + } + + + /** + * Return true if this SubWhiteLabelingOptions object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubWhiteLabelingOptions subWhiteLabelingOptions = (SubWhiteLabelingOptions) o; + return Objects.equals(this.headerBackgroundColor, subWhiteLabelingOptions.headerBackgroundColor) && + Objects.equals(this.legalVersion, subWhiteLabelingOptions.legalVersion) && + Objects.equals(this.linkColor, subWhiteLabelingOptions.linkColor) && + Objects.equals(this.pageBackgroundColor, subWhiteLabelingOptions.pageBackgroundColor) && + Objects.equals(this.primaryButtonColor, subWhiteLabelingOptions.primaryButtonColor) && + Objects.equals(this.primaryButtonColorHover, subWhiteLabelingOptions.primaryButtonColorHover) && + Objects.equals(this.primaryButtonTextColor, subWhiteLabelingOptions.primaryButtonTextColor) && + Objects.equals(this.primaryButtonTextColorHover, subWhiteLabelingOptions.primaryButtonTextColorHover) && + Objects.equals(this.secondaryButtonColor, subWhiteLabelingOptions.secondaryButtonColor) && + Objects.equals(this.secondaryButtonColorHover, subWhiteLabelingOptions.secondaryButtonColorHover) && + Objects.equals(this.secondaryButtonTextColor, subWhiteLabelingOptions.secondaryButtonTextColor) && + Objects.equals(this.secondaryButtonTextColorHover, subWhiteLabelingOptions.secondaryButtonTextColorHover) && + Objects.equals(this.textColor1, subWhiteLabelingOptions.textColor1) && + Objects.equals(this.textColor2, subWhiteLabelingOptions.textColor2) && + Objects.equals(this.resetToDefault, subWhiteLabelingOptions.resetToDefault); + } + + @Override + public int hashCode() { + return Objects.hash(headerBackgroundColor, legalVersion, linkColor, pageBackgroundColor, primaryButtonColor, primaryButtonColorHover, primaryButtonTextColor, primaryButtonTextColorHover, secondaryButtonColor, secondaryButtonColorHover, secondaryButtonTextColor, secondaryButtonTextColorHover, textColor1, textColor2, resetToDefault); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubWhiteLabelingOptions {\n"); + sb.append(" headerBackgroundColor: ").append(toIndentedString(headerBackgroundColor)).append("\n"); + sb.append(" legalVersion: ").append(toIndentedString(legalVersion)).append("\n"); + sb.append(" linkColor: ").append(toIndentedString(linkColor)).append("\n"); + sb.append(" pageBackgroundColor: ").append(toIndentedString(pageBackgroundColor)).append("\n"); + sb.append(" primaryButtonColor: ").append(toIndentedString(primaryButtonColor)).append("\n"); + sb.append(" primaryButtonColorHover: ").append(toIndentedString(primaryButtonColorHover)).append("\n"); + sb.append(" primaryButtonTextColor: ").append(toIndentedString(primaryButtonTextColor)).append("\n"); + sb.append(" primaryButtonTextColorHover: ").append(toIndentedString(primaryButtonTextColorHover)).append("\n"); + sb.append(" secondaryButtonColor: ").append(toIndentedString(secondaryButtonColor)).append("\n"); + sb.append(" secondaryButtonColorHover: ").append(toIndentedString(secondaryButtonColorHover)).append("\n"); + sb.append(" secondaryButtonTextColor: ").append(toIndentedString(secondaryButtonTextColor)).append("\n"); + sb.append(" secondaryButtonTextColorHover: ").append(toIndentedString(secondaryButtonTextColorHover)).append("\n"); + sb.append(" textColor1: ").append(toIndentedString(textColor1)).append("\n"); + sb.append(" textColor2: ").append(toIndentedString(textColor2)).append("\n"); + sb.append(" resetToDefault: ").append(toIndentedString(resetToDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (headerBackgroundColor != null) { + if (isFileTypeOrListOfFiles(headerBackgroundColor)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonTextColor( - @javax.annotation.Nullable String secondaryButtonTextColor) { - this.secondaryButtonTextColor = secondaryButtonTextColor; + if (headerBackgroundColor.getClass().equals(java.io.File.class) || + headerBackgroundColor.getClass().equals(Integer.class) || + headerBackgroundColor.getClass().equals(String.class) || + headerBackgroundColor.getClass().isEnum()) { + map.put("header_background_color", headerBackgroundColor); + } else if (isListOfFile(headerBackgroundColor)) { + for(int i = 0; i< getListSize(headerBackgroundColor); i++) { + map.put("header_background_color[" + i + "]", getFromList(headerBackgroundColor, i)); + } + } + else { + map.put("header_background_color", JSON.getDefault().getMapper().writeValueAsString(headerBackgroundColor)); + } } + if (legalVersion != null) { + if (isFileTypeOrListOfFiles(legalVersion)) { + fileTypeFound = true; + } - public SubWhiteLabelingOptions secondaryButtonTextColorHover( - @javax.annotation.Nullable String secondaryButtonTextColorHover) { - this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; - return this; + if (legalVersion.getClass().equals(java.io.File.class) || + legalVersion.getClass().equals(Integer.class) || + legalVersion.getClass().equals(String.class) || + legalVersion.getClass().isEnum()) { + map.put("legal_version", legalVersion); + } else if (isListOfFile(legalVersion)) { + for(int i = 0; i< getListSize(legalVersion); i++) { + map.put("legal_version[" + i + "]", getFromList(legalVersion, i)); + } + } + else { + map.put("legal_version", JSON.getDefault().getMapper().writeValueAsString(legalVersion)); + } } + if (linkColor != null) { + if (isFileTypeOrListOfFiles(linkColor)) { + fileTypeFound = true; + } - /** - * Get secondaryButtonTextColorHover - * - * @return secondaryButtonTextColorHover - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSecondaryButtonTextColorHover() { - return secondaryButtonTextColorHover; + if (linkColor.getClass().equals(java.io.File.class) || + linkColor.getClass().equals(Integer.class) || + linkColor.getClass().equals(String.class) || + linkColor.getClass().isEnum()) { + map.put("link_color", linkColor); + } else if (isListOfFile(linkColor)) { + for(int i = 0; i< getListSize(linkColor); i++) { + map.put("link_color[" + i + "]", getFromList(linkColor, i)); + } + } + else { + map.put("link_color", JSON.getDefault().getMapper().writeValueAsString(linkColor)); + } } + if (pageBackgroundColor != null) { + if (isFileTypeOrListOfFiles(pageBackgroundColor)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonTextColorHover( - @javax.annotation.Nullable String secondaryButtonTextColorHover) { - this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; + if (pageBackgroundColor.getClass().equals(java.io.File.class) || + pageBackgroundColor.getClass().equals(Integer.class) || + pageBackgroundColor.getClass().equals(String.class) || + pageBackgroundColor.getClass().isEnum()) { + map.put("page_background_color", pageBackgroundColor); + } else if (isListOfFile(pageBackgroundColor)) { + for(int i = 0; i< getListSize(pageBackgroundColor); i++) { + map.put("page_background_color[" + i + "]", getFromList(pageBackgroundColor, i)); + } + } + else { + map.put("page_background_color", JSON.getDefault().getMapper().writeValueAsString(pageBackgroundColor)); + } } + if (primaryButtonColor != null) { + if (isFileTypeOrListOfFiles(primaryButtonColor)) { + fileTypeFound = true; + } - public SubWhiteLabelingOptions textColor1(@javax.annotation.Nullable String textColor1) { - this.textColor1 = textColor1; - return this; + if (primaryButtonColor.getClass().equals(java.io.File.class) || + primaryButtonColor.getClass().equals(Integer.class) || + primaryButtonColor.getClass().equals(String.class) || + primaryButtonColor.getClass().isEnum()) { + map.put("primary_button_color", primaryButtonColor); + } else if (isListOfFile(primaryButtonColor)) { + for(int i = 0; i< getListSize(primaryButtonColor); i++) { + map.put("primary_button_color[" + i + "]", getFromList(primaryButtonColor, i)); + } + } + else { + map.put("primary_button_color", JSON.getDefault().getMapper().writeValueAsString(primaryButtonColor)); + } } + if (primaryButtonColorHover != null) { + if (isFileTypeOrListOfFiles(primaryButtonColorHover)) { + fileTypeFound = true; + } - /** - * Get textColor1 - * - * @return textColor1 - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTextColor1() { - return textColor1; + if (primaryButtonColorHover.getClass().equals(java.io.File.class) || + primaryButtonColorHover.getClass().equals(Integer.class) || + primaryButtonColorHover.getClass().equals(String.class) || + primaryButtonColorHover.getClass().isEnum()) { + map.put("primary_button_color_hover", primaryButtonColorHover); + } else if (isListOfFile(primaryButtonColorHover)) { + for(int i = 0; i< getListSize(primaryButtonColorHover); i++) { + map.put("primary_button_color_hover[" + i + "]", getFromList(primaryButtonColorHover, i)); + } + } + else { + map.put("primary_button_color_hover", JSON.getDefault().getMapper().writeValueAsString(primaryButtonColorHover)); + } } + if (primaryButtonTextColor != null) { + if (isFileTypeOrListOfFiles(primaryButtonTextColor)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTextColor1(@javax.annotation.Nullable String textColor1) { - this.textColor1 = textColor1; + if (primaryButtonTextColor.getClass().equals(java.io.File.class) || + primaryButtonTextColor.getClass().equals(Integer.class) || + primaryButtonTextColor.getClass().equals(String.class) || + primaryButtonTextColor.getClass().isEnum()) { + map.put("primary_button_text_color", primaryButtonTextColor); + } else if (isListOfFile(primaryButtonTextColor)) { + for(int i = 0; i< getListSize(primaryButtonTextColor); i++) { + map.put("primary_button_text_color[" + i + "]", getFromList(primaryButtonTextColor, i)); + } + } + else { + map.put("primary_button_text_color", JSON.getDefault().getMapper().writeValueAsString(primaryButtonTextColor)); + } } + if (primaryButtonTextColorHover != null) { + if (isFileTypeOrListOfFiles(primaryButtonTextColorHover)) { + fileTypeFound = true; + } - public SubWhiteLabelingOptions textColor2(@javax.annotation.Nullable String textColor2) { - this.textColor2 = textColor2; - return this; + if (primaryButtonTextColorHover.getClass().equals(java.io.File.class) || + primaryButtonTextColorHover.getClass().equals(Integer.class) || + primaryButtonTextColorHover.getClass().equals(String.class) || + primaryButtonTextColorHover.getClass().isEnum()) { + map.put("primary_button_text_color_hover", primaryButtonTextColorHover); + } else if (isListOfFile(primaryButtonTextColorHover)) { + for(int i = 0; i< getListSize(primaryButtonTextColorHover); i++) { + map.put("primary_button_text_color_hover[" + i + "]", getFromList(primaryButtonTextColorHover, i)); + } + } + else { + map.put("primary_button_text_color_hover", JSON.getDefault().getMapper().writeValueAsString(primaryButtonTextColorHover)); + } } + if (secondaryButtonColor != null) { + if (isFileTypeOrListOfFiles(secondaryButtonColor)) { + fileTypeFound = true; + } - /** - * Get textColor2 - * - * @return textColor2 - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTextColor2() { - return textColor2; + if (secondaryButtonColor.getClass().equals(java.io.File.class) || + secondaryButtonColor.getClass().equals(Integer.class) || + secondaryButtonColor.getClass().equals(String.class) || + secondaryButtonColor.getClass().isEnum()) { + map.put("secondary_button_color", secondaryButtonColor); + } else if (isListOfFile(secondaryButtonColor)) { + for(int i = 0; i< getListSize(secondaryButtonColor); i++) { + map.put("secondary_button_color[" + i + "]", getFromList(secondaryButtonColor, i)); + } + } + else { + map.put("secondary_button_color", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonColor)); + } } + if (secondaryButtonColorHover != null) { + if (isFileTypeOrListOfFiles(secondaryButtonColorHover)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTextColor2(@javax.annotation.Nullable String textColor2) { - this.textColor2 = textColor2; + if (secondaryButtonColorHover.getClass().equals(java.io.File.class) || + secondaryButtonColorHover.getClass().equals(Integer.class) || + secondaryButtonColorHover.getClass().equals(String.class) || + secondaryButtonColorHover.getClass().isEnum()) { + map.put("secondary_button_color_hover", secondaryButtonColorHover); + } else if (isListOfFile(secondaryButtonColorHover)) { + for(int i = 0; i< getListSize(secondaryButtonColorHover); i++) { + map.put("secondary_button_color_hover[" + i + "]", getFromList(secondaryButtonColorHover, i)); + } + } + else { + map.put("secondary_button_color_hover", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonColorHover)); + } } + if (secondaryButtonTextColor != null) { + if (isFileTypeOrListOfFiles(secondaryButtonTextColor)) { + fileTypeFound = true; + } - public SubWhiteLabelingOptions resetToDefault( - @javax.annotation.Nullable Boolean resetToDefault) { - this.resetToDefault = resetToDefault; - return this; + if (secondaryButtonTextColor.getClass().equals(java.io.File.class) || + secondaryButtonTextColor.getClass().equals(Integer.class) || + secondaryButtonTextColor.getClass().equals(String.class) || + secondaryButtonTextColor.getClass().isEnum()) { + map.put("secondary_button_text_color", secondaryButtonTextColor); + } else if (isListOfFile(secondaryButtonTextColor)) { + for(int i = 0; i< getListSize(secondaryButtonTextColor); i++) { + map.put("secondary_button_text_color[" + i + "]", getFromList(secondaryButtonTextColor, i)); + } + } + else { + map.put("secondary_button_text_color", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonTextColor)); + } } + if (secondaryButtonTextColorHover != null) { + if (isFileTypeOrListOfFiles(secondaryButtonTextColorHover)) { + fileTypeFound = true; + } - /** - * Resets white labeling options to defaults. Only useful when updating an API App. - * - * @return resetToDefault - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RESET_TO_DEFAULT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getResetToDefault() { - return resetToDefault; + if (secondaryButtonTextColorHover.getClass().equals(java.io.File.class) || + secondaryButtonTextColorHover.getClass().equals(Integer.class) || + secondaryButtonTextColorHover.getClass().equals(String.class) || + secondaryButtonTextColorHover.getClass().isEnum()) { + map.put("secondary_button_text_color_hover", secondaryButtonTextColorHover); + } else if (isListOfFile(secondaryButtonTextColorHover)) { + for(int i = 0; i< getListSize(secondaryButtonTextColorHover); i++) { + map.put("secondary_button_text_color_hover[" + i + "]", getFromList(secondaryButtonTextColorHover, i)); + } + } + else { + map.put("secondary_button_text_color_hover", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonTextColorHover)); + } } + if (textColor1 != null) { + if (isFileTypeOrListOfFiles(textColor1)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_RESET_TO_DEFAULT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setResetToDefault(@javax.annotation.Nullable Boolean resetToDefault) { - this.resetToDefault = resetToDefault; + if (textColor1.getClass().equals(java.io.File.class) || + textColor1.getClass().equals(Integer.class) || + textColor1.getClass().equals(String.class) || + textColor1.getClass().isEnum()) { + map.put("text_color1", textColor1); + } else if (isListOfFile(textColor1)) { + for(int i = 0; i< getListSize(textColor1); i++) { + map.put("text_color1[" + i + "]", getFromList(textColor1, i)); + } + } + else { + map.put("text_color1", JSON.getDefault().getMapper().writeValueAsString(textColor1)); + } } + if (textColor2 != null) { + if (isFileTypeOrListOfFiles(textColor2)) { + fileTypeFound = true; + } - /** Return true if this SubWhiteLabelingOptions object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubWhiteLabelingOptions subWhiteLabelingOptions = (SubWhiteLabelingOptions) o; - return Objects.equals( - this.headerBackgroundColor, subWhiteLabelingOptions.headerBackgroundColor) - && Objects.equals(this.legalVersion, subWhiteLabelingOptions.legalVersion) - && Objects.equals(this.linkColor, subWhiteLabelingOptions.linkColor) - && Objects.equals( - this.pageBackgroundColor, subWhiteLabelingOptions.pageBackgroundColor) - && Objects.equals( - this.primaryButtonColor, subWhiteLabelingOptions.primaryButtonColor) - && Objects.equals( - this.primaryButtonColorHover, - subWhiteLabelingOptions.primaryButtonColorHover) - && Objects.equals( - this.primaryButtonTextColor, subWhiteLabelingOptions.primaryButtonTextColor) - && Objects.equals( - this.primaryButtonTextColorHover, - subWhiteLabelingOptions.primaryButtonTextColorHover) - && Objects.equals( - this.secondaryButtonColor, subWhiteLabelingOptions.secondaryButtonColor) - && Objects.equals( - this.secondaryButtonColorHover, - subWhiteLabelingOptions.secondaryButtonColorHover) - && Objects.equals( - this.secondaryButtonTextColor, - subWhiteLabelingOptions.secondaryButtonTextColor) - && Objects.equals( - this.secondaryButtonTextColorHover, - subWhiteLabelingOptions.secondaryButtonTextColorHover) - && Objects.equals(this.textColor1, subWhiteLabelingOptions.textColor1) - && Objects.equals(this.textColor2, subWhiteLabelingOptions.textColor2) - && Objects.equals(this.resetToDefault, subWhiteLabelingOptions.resetToDefault); + if (textColor2.getClass().equals(java.io.File.class) || + textColor2.getClass().equals(Integer.class) || + textColor2.getClass().equals(String.class) || + textColor2.getClass().isEnum()) { + map.put("text_color2", textColor2); + } else if (isListOfFile(textColor2)) { + for(int i = 0; i< getListSize(textColor2); i++) { + map.put("text_color2[" + i + "]", getFromList(textColor2, i)); + } + } + else { + map.put("text_color2", JSON.getDefault().getMapper().writeValueAsString(textColor2)); + } } + if (resetToDefault != null) { + if (isFileTypeOrListOfFiles(resetToDefault)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - headerBackgroundColor, - legalVersion, - linkColor, - pageBackgroundColor, - primaryButtonColor, - primaryButtonColorHover, - primaryButtonTextColor, - primaryButtonTextColorHover, - secondaryButtonColor, - secondaryButtonColorHover, - secondaryButtonTextColor, - secondaryButtonTextColorHover, - textColor1, - textColor2, - resetToDefault); + if (resetToDefault.getClass().equals(java.io.File.class) || + resetToDefault.getClass().equals(Integer.class) || + resetToDefault.getClass().equals(String.class) || + resetToDefault.getClass().isEnum()) { + map.put("reset_to_default", resetToDefault); + } else if (isListOfFile(resetToDefault)) { + for(int i = 0; i< getListSize(resetToDefault); i++) { + map.put("reset_to_default[" + i + "]", getFromList(resetToDefault, i)); + } + } + else { + map.put("reset_to_default", JSON.getDefault().getMapper().writeValueAsString(resetToDefault)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubWhiteLabelingOptions {\n"); - sb.append(" headerBackgroundColor: ") - .append(toIndentedString(headerBackgroundColor)) - .append("\n"); - sb.append(" legalVersion: ").append(toIndentedString(legalVersion)).append("\n"); - sb.append(" linkColor: ").append(toIndentedString(linkColor)).append("\n"); - sb.append(" pageBackgroundColor: ") - .append(toIndentedString(pageBackgroundColor)) - .append("\n"); - sb.append(" primaryButtonColor: ") - .append(toIndentedString(primaryButtonColor)) - .append("\n"); - sb.append(" primaryButtonColorHover: ") - .append(toIndentedString(primaryButtonColorHover)) - .append("\n"); - sb.append(" primaryButtonTextColor: ") - .append(toIndentedString(primaryButtonTextColor)) - .append("\n"); - sb.append(" primaryButtonTextColorHover: ") - .append(toIndentedString(primaryButtonTextColorHover)) - .append("\n"); - sb.append(" secondaryButtonColor: ") - .append(toIndentedString(secondaryButtonColor)) - .append("\n"); - sb.append(" secondaryButtonColorHover: ") - .append(toIndentedString(secondaryButtonColorHover)) - .append("\n"); - sb.append(" secondaryButtonTextColor: ") - .append(toIndentedString(secondaryButtonTextColor)) - .append("\n"); - sb.append(" secondaryButtonTextColorHover: ") - .append(toIndentedString(secondaryButtonTextColorHover)) - .append("\n"); - sb.append(" textColor1: ").append(toIndentedString(textColor1)).append("\n"); - sb.append(" textColor2: ").append(toIndentedString(textColor2)).append("\n"); - sb.append(" resetToDefault: ").append(toIndentedString(resetToDefault)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (headerBackgroundColor != null) { - if (isFileTypeOrListOfFiles(headerBackgroundColor)) { - fileTypeFound = true; - } - - if (headerBackgroundColor.getClass().equals(java.io.File.class) - || headerBackgroundColor.getClass().equals(Integer.class) - || headerBackgroundColor.getClass().equals(String.class) - || headerBackgroundColor.getClass().isEnum()) { - map.put("header_background_color", headerBackgroundColor); - } else if (isListOfFile(headerBackgroundColor)) { - for (int i = 0; i < getListSize(headerBackgroundColor); i++) { - map.put( - "header_background_color[" + i + "]", - getFromList(headerBackgroundColor, i)); - } - } else { - map.put( - "header_background_color", - JSON.getDefault() - .getMapper() - .writeValueAsString(headerBackgroundColor)); - } - } - if (legalVersion != null) { - if (isFileTypeOrListOfFiles(legalVersion)) { - fileTypeFound = true; - } - - if (legalVersion.getClass().equals(java.io.File.class) - || legalVersion.getClass().equals(Integer.class) - || legalVersion.getClass().equals(String.class) - || legalVersion.getClass().isEnum()) { - map.put("legal_version", legalVersion); - } else if (isListOfFile(legalVersion)) { - for (int i = 0; i < getListSize(legalVersion); i++) { - map.put("legal_version[" + i + "]", getFromList(legalVersion, i)); - } - } else { - map.put( - "legal_version", - JSON.getDefault().getMapper().writeValueAsString(legalVersion)); - } - } - if (linkColor != null) { - if (isFileTypeOrListOfFiles(linkColor)) { - fileTypeFound = true; - } - - if (linkColor.getClass().equals(java.io.File.class) - || linkColor.getClass().equals(Integer.class) - || linkColor.getClass().equals(String.class) - || linkColor.getClass().isEnum()) { - map.put("link_color", linkColor); - } else if (isListOfFile(linkColor)) { - for (int i = 0; i < getListSize(linkColor); i++) { - map.put("link_color[" + i + "]", getFromList(linkColor, i)); - } - } else { - map.put( - "link_color", - JSON.getDefault().getMapper().writeValueAsString(linkColor)); - } - } - if (pageBackgroundColor != null) { - if (isFileTypeOrListOfFiles(pageBackgroundColor)) { - fileTypeFound = true; - } - - if (pageBackgroundColor.getClass().equals(java.io.File.class) - || pageBackgroundColor.getClass().equals(Integer.class) - || pageBackgroundColor.getClass().equals(String.class) - || pageBackgroundColor.getClass().isEnum()) { - map.put("page_background_color", pageBackgroundColor); - } else if (isListOfFile(pageBackgroundColor)) { - for (int i = 0; i < getListSize(pageBackgroundColor); i++) { - map.put( - "page_background_color[" + i + "]", - getFromList(pageBackgroundColor, i)); - } - } else { - map.put( - "page_background_color", - JSON.getDefault().getMapper().writeValueAsString(pageBackgroundColor)); - } - } - if (primaryButtonColor != null) { - if (isFileTypeOrListOfFiles(primaryButtonColor)) { - fileTypeFound = true; - } - - if (primaryButtonColor.getClass().equals(java.io.File.class) - || primaryButtonColor.getClass().equals(Integer.class) - || primaryButtonColor.getClass().equals(String.class) - || primaryButtonColor.getClass().isEnum()) { - map.put("primary_button_color", primaryButtonColor); - } else if (isListOfFile(primaryButtonColor)) { - for (int i = 0; i < getListSize(primaryButtonColor); i++) { - map.put( - "primary_button_color[" + i + "]", - getFromList(primaryButtonColor, i)); - } - } else { - map.put( - "primary_button_color", - JSON.getDefault().getMapper().writeValueAsString(primaryButtonColor)); - } - } - if (primaryButtonColorHover != null) { - if (isFileTypeOrListOfFiles(primaryButtonColorHover)) { - fileTypeFound = true; - } - - if (primaryButtonColorHover.getClass().equals(java.io.File.class) - || primaryButtonColorHover.getClass().equals(Integer.class) - || primaryButtonColorHover.getClass().equals(String.class) - || primaryButtonColorHover.getClass().isEnum()) { - map.put("primary_button_color_hover", primaryButtonColorHover); - } else if (isListOfFile(primaryButtonColorHover)) { - for (int i = 0; i < getListSize(primaryButtonColorHover); i++) { - map.put( - "primary_button_color_hover[" + i + "]", - getFromList(primaryButtonColorHover, i)); - } - } else { - map.put( - "primary_button_color_hover", - JSON.getDefault() - .getMapper() - .writeValueAsString(primaryButtonColorHover)); - } - } - if (primaryButtonTextColor != null) { - if (isFileTypeOrListOfFiles(primaryButtonTextColor)) { - fileTypeFound = true; - } - - if (primaryButtonTextColor.getClass().equals(java.io.File.class) - || primaryButtonTextColor.getClass().equals(Integer.class) - || primaryButtonTextColor.getClass().equals(String.class) - || primaryButtonTextColor.getClass().isEnum()) { - map.put("primary_button_text_color", primaryButtonTextColor); - } else if (isListOfFile(primaryButtonTextColor)) { - for (int i = 0; i < getListSize(primaryButtonTextColor); i++) { - map.put( - "primary_button_text_color[" + i + "]", - getFromList(primaryButtonTextColor, i)); - } - } else { - map.put( - "primary_button_text_color", - JSON.getDefault() - .getMapper() - .writeValueAsString(primaryButtonTextColor)); - } - } - if (primaryButtonTextColorHover != null) { - if (isFileTypeOrListOfFiles(primaryButtonTextColorHover)) { - fileTypeFound = true; - } - - if (primaryButtonTextColorHover.getClass().equals(java.io.File.class) - || primaryButtonTextColorHover.getClass().equals(Integer.class) - || primaryButtonTextColorHover.getClass().equals(String.class) - || primaryButtonTextColorHover.getClass().isEnum()) { - map.put("primary_button_text_color_hover", primaryButtonTextColorHover); - } else if (isListOfFile(primaryButtonTextColorHover)) { - for (int i = 0; i < getListSize(primaryButtonTextColorHover); i++) { - map.put( - "primary_button_text_color_hover[" + i + "]", - getFromList(primaryButtonTextColorHover, i)); - } - } else { - map.put( - "primary_button_text_color_hover", - JSON.getDefault() - .getMapper() - .writeValueAsString(primaryButtonTextColorHover)); - } - } - if (secondaryButtonColor != null) { - if (isFileTypeOrListOfFiles(secondaryButtonColor)) { - fileTypeFound = true; - } - - if (secondaryButtonColor.getClass().equals(java.io.File.class) - || secondaryButtonColor.getClass().equals(Integer.class) - || secondaryButtonColor.getClass().equals(String.class) - || secondaryButtonColor.getClass().isEnum()) { - map.put("secondary_button_color", secondaryButtonColor); - } else if (isListOfFile(secondaryButtonColor)) { - for (int i = 0; i < getListSize(secondaryButtonColor); i++) { - map.put( - "secondary_button_color[" + i + "]", - getFromList(secondaryButtonColor, i)); - } - } else { - map.put( - "secondary_button_color", - JSON.getDefault().getMapper().writeValueAsString(secondaryButtonColor)); - } - } - if (secondaryButtonColorHover != null) { - if (isFileTypeOrListOfFiles(secondaryButtonColorHover)) { - fileTypeFound = true; - } - - if (secondaryButtonColorHover.getClass().equals(java.io.File.class) - || secondaryButtonColorHover.getClass().equals(Integer.class) - || secondaryButtonColorHover.getClass().equals(String.class) - || secondaryButtonColorHover.getClass().isEnum()) { - map.put("secondary_button_color_hover", secondaryButtonColorHover); - } else if (isListOfFile(secondaryButtonColorHover)) { - for (int i = 0; i < getListSize(secondaryButtonColorHover); i++) { - map.put( - "secondary_button_color_hover[" + i + "]", - getFromList(secondaryButtonColorHover, i)); - } - } else { - map.put( - "secondary_button_color_hover", - JSON.getDefault() - .getMapper() - .writeValueAsString(secondaryButtonColorHover)); - } - } - if (secondaryButtonTextColor != null) { - if (isFileTypeOrListOfFiles(secondaryButtonTextColor)) { - fileTypeFound = true; - } - - if (secondaryButtonTextColor.getClass().equals(java.io.File.class) - || secondaryButtonTextColor.getClass().equals(Integer.class) - || secondaryButtonTextColor.getClass().equals(String.class) - || secondaryButtonTextColor.getClass().isEnum()) { - map.put("secondary_button_text_color", secondaryButtonTextColor); - } else if (isListOfFile(secondaryButtonTextColor)) { - for (int i = 0; i < getListSize(secondaryButtonTextColor); i++) { - map.put( - "secondary_button_text_color[" + i + "]", - getFromList(secondaryButtonTextColor, i)); - } - } else { - map.put( - "secondary_button_text_color", - JSON.getDefault() - .getMapper() - .writeValueAsString(secondaryButtonTextColor)); - } - } - if (secondaryButtonTextColorHover != null) { - if (isFileTypeOrListOfFiles(secondaryButtonTextColorHover)) { - fileTypeFound = true; - } - - if (secondaryButtonTextColorHover.getClass().equals(java.io.File.class) - || secondaryButtonTextColorHover.getClass().equals(Integer.class) - || secondaryButtonTextColorHover.getClass().equals(String.class) - || secondaryButtonTextColorHover.getClass().isEnum()) { - map.put("secondary_button_text_color_hover", secondaryButtonTextColorHover); - } else if (isListOfFile(secondaryButtonTextColorHover)) { - for (int i = 0; i < getListSize(secondaryButtonTextColorHover); i++) { - map.put( - "secondary_button_text_color_hover[" + i + "]", - getFromList(secondaryButtonTextColorHover, i)); - } - } else { - map.put( - "secondary_button_text_color_hover", - JSON.getDefault() - .getMapper() - .writeValueAsString(secondaryButtonTextColorHover)); - } - } - if (textColor1 != null) { - if (isFileTypeOrListOfFiles(textColor1)) { - fileTypeFound = true; - } - - if (textColor1.getClass().equals(java.io.File.class) - || textColor1.getClass().equals(Integer.class) - || textColor1.getClass().equals(String.class) - || textColor1.getClass().isEnum()) { - map.put("text_color1", textColor1); - } else if (isListOfFile(textColor1)) { - for (int i = 0; i < getListSize(textColor1); i++) { - map.put("text_color1[" + i + "]", getFromList(textColor1, i)); - } - } else { - map.put( - "text_color1", - JSON.getDefault().getMapper().writeValueAsString(textColor1)); - } - } - if (textColor2 != null) { - if (isFileTypeOrListOfFiles(textColor2)) { - fileTypeFound = true; - } - - if (textColor2.getClass().equals(java.io.File.class) - || textColor2.getClass().equals(Integer.class) - || textColor2.getClass().equals(String.class) - || textColor2.getClass().isEnum()) { - map.put("text_color2", textColor2); - } else if (isListOfFile(textColor2)) { - for (int i = 0; i < getListSize(textColor2); i++) { - map.put("text_color2[" + i + "]", getFromList(textColor2, i)); - } - } else { - map.put( - "text_color2", - JSON.getDefault().getMapper().writeValueAsString(textColor2)); - } - } - if (resetToDefault != null) { - if (isFileTypeOrListOfFiles(resetToDefault)) { - fileTypeFound = true; - } - - if (resetToDefault.getClass().equals(java.io.File.class) - || resetToDefault.getClass().equals(Integer.class) - || resetToDefault.getClass().equals(String.class) - || resetToDefault.getClass().isEnum()) { - map.put("reset_to_default", resetToDefault); - } else if (isListOfFile(resetToDefault)) { - for (int i = 0; i < getListSize(resetToDefault); i++) { - map.put("reset_to_default[" + i + "]", getFromList(resetToDefault, i)); - } - } else { - map.put( - "reset_to_default", - JSON.getDefault().getMapper().writeValueAsString(resetToDefault)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java index 0c25c96b8..691ae1f17 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java @@ -10,299 +10,311 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TeamAddMemberRequest */ + +import com.dropbox.sign.ApiException; +/** + * TeamAddMemberRequest + */ @JsonPropertyOrder({ - TeamAddMemberRequest.JSON_PROPERTY_ACCOUNT_ID, - TeamAddMemberRequest.JSON_PROPERTY_EMAIL_ADDRESS, - TeamAddMemberRequest.JSON_PROPERTY_ROLE + TeamAddMemberRequest.JSON_PROPERTY_ACCOUNT_ID, + TeamAddMemberRequest.JSON_PROPERTY_EMAIL_ADDRESS, + TeamAddMemberRequest.JSON_PROPERTY_ROLE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TeamAddMemberRequest { - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - @javax.annotation.Nullable private String accountId; - - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; - - /** - * A role member will take in a new Team. **NOTE:** This parameter is used only if - * `team_id` is provided. - */ - public enum RoleEnum { - MEMBER(String.valueOf("Member")), - - DEVELOPER(String.valueOf("Developer")), - - TEAM_MANAGER(String.valueOf("Team Manager")), - - ADMIN(String.valueOf("Admin")); - - private String value; - - RoleEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static RoleEnum fromValue(String value) { - for (RoleEnum b : RoleEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_ROLE = "role"; - @javax.annotation.Nullable private RoleEnum role; - - public TeamAddMemberRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamAddMemberRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamAddMemberRequest.class); - } - - public static TeamAddMemberRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamAddMemberRequest.class); - } - - public TeamAddMemberRequest accountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; - } - - /** - * `account_id` or `email_address` is required. If both are provided, the - * account id prevails. Account id of the user to invite to your Team. - * - * @return accountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccountId() { - return accountId; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + @javax.annotation.Nullable + private String accountId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; + + /** + * A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided. + */ + public enum RoleEnum { + MEMBER(String.valueOf("Member")), + + DEVELOPER(String.valueOf("Developer")), + + TEAM_MANAGER(String.valueOf("Team Manager")), + + ADMIN(String.valueOf("Admin")); + + private String value; + + RoleEnum(String value) { + this.value = value; } - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; + @JsonValue + public String getValue() { + return value; } - public TeamAddMemberRequest emailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * `account_id` or `email_address` is required, If both are provided, the - * account id prevails. Email address of the user to invite to your Team. - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; + @Override + public String toString() { + return String.valueOf(value); } - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; + @JsonCreator + public static RoleEnum fromValue(String value) { + for (RoleEnum b : RoleEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - public TeamAddMemberRequest role(@javax.annotation.Nullable RoleEnum role) { - this.role = role; - return this; + } + + public static final String JSON_PROPERTY_ROLE = "role"; + @javax.annotation.Nullable + private RoleEnum role; + + public TeamAddMemberRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamAddMemberRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamAddMemberRequest.class); + } + + static public TeamAddMemberRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamAddMemberRequest.class + ); + } + + public TeamAddMemberRequest accountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + return this; + } + + /** + * `account_id` or `email_address` is required. If both are provided, the account id prevails. Account id of the user to invite to your Team. + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + } + + + public TeamAddMemberRequest emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * `account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team. + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + public TeamAddMemberRequest role(@javax.annotation.Nullable RoleEnum role) { + this.role = role; + return this; + } + + /** + * A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided. + * @return role + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public RoleEnum getRole() { + return role; + } + + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(@javax.annotation.Nullable RoleEnum role) { + this.role = role; + } + + + /** + * Return true if this TeamAddMemberRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * A role member will take in a new Team. **NOTE:** This parameter is used only if - * `team_id` is provided. - * - * @return role - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public RoleEnum getRole() { - return role; + if (o == null || getClass() != o.getClass()) { + return false; } + TeamAddMemberRequest teamAddMemberRequest = (TeamAddMemberRequest) o; + return Objects.equals(this.accountId, teamAddMemberRequest.accountId) && + Objects.equals(this.emailAddress, teamAddMemberRequest.emailAddress) && + Objects.equals(this.role, teamAddMemberRequest.role); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress, role); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamAddMemberRequest {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRole(@javax.annotation.Nullable RoleEnum role) { - this.role = role; + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - /** Return true if this TeamAddMemberRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); } - TeamAddMemberRequest teamAddMemberRequest = (TeamAddMemberRequest) o; - return Objects.equals(this.accountId, teamAddMemberRequest.accountId) - && Objects.equals(this.emailAddress, teamAddMemberRequest.emailAddress) - && Objects.equals(this.role, teamAddMemberRequest.role); } + if (role != null) { + if (isFileTypeOrListOfFiles(role)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress, role); + if (role.getClass().equals(java.io.File.class) || + role.getClass().equals(Integer.class) || + role.getClass().equals(String.class) || + role.getClass().isEnum()) { + map.put("role", role); + } else if (isListOfFile(role)) { + for(int i = 0; i< getListSize(role); i++) { + map.put("role[" + i + "]", getFromList(role, i)); + } + } + else { + map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamAddMemberRequest {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } - - if (accountId.getClass().equals(java.io.File.class) - || accountId.getClass().equals(Integer.class) - || accountId.getClass().equals(String.class) - || accountId.getClass().isEnum()) { - map.put("account_id", accountId); - } else if (isListOfFile(accountId)) { - for (int i = 0; i < getListSize(accountId); i++) { - map.put("account_id[" + i + "]", getFromList(accountId, i)); - } - } else { - map.put( - "account_id", - JSON.getDefault().getMapper().writeValueAsString(accountId)); - } - } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - if (role != null) { - if (isFileTypeOrListOfFiles(role)) { - fileTypeFound = true; - } - - if (role.getClass().equals(java.io.File.class) - || role.getClass().equals(Integer.class) - || role.getClass().equals(String.class) - || role.getClass().isEnum()) { - map.put("role", role); - } else if (isListOfFile(role)) { - for (int i = 0; i < getListSize(role); i++) { - map.put("role[" + i + "]", getFromList(role, i)); - } - } else { - map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java index 2766e1d20..6e7b63453 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java @@ -10,156 +10,170 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TeamCreateRequest */ -@JsonPropertyOrder({TeamCreateRequest.JSON_PROPERTY_NAME}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class TeamCreateRequest { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name = "Untitled Team"; - - public TeamCreateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamCreateRequest.class); - } - public static TeamCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamCreateRequest.class); - } - - public TeamCreateRequest name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of your Team. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; +import com.dropbox.sign.ApiException; +/** + * TeamCreateRequest + */ +@JsonPropertyOrder({ + TeamCreateRequest.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class TeamCreateRequest { + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name = "Untitled Team"; + + public TeamCreateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamCreateRequest.class); + } + + static public TeamCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamCreateRequest.class + ); + } + + public TeamCreateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of your Team. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + /** + * Return true if this TeamCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; + if (o == null || getClass() != o.getClass()) { + return false; } + TeamCreateRequest teamCreateRequest = (TeamCreateRequest) o; + return Objects.equals(this.name, teamCreateRequest.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamCreateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** Return true if this TeamCreateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); } - TeamCreateRequest teamCreateRequest = (TeamCreateRequest) o; - return Objects.equals(this.name, teamCreateRequest.name); } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamCreateRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java index b26c99715..00f2a2a6e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java @@ -10,215 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TeamInfoResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** TeamGetInfoResponse */ + +import com.dropbox.sign.ApiException; +/** + * TeamGetInfoResponse + */ @JsonPropertyOrder({ - TeamGetInfoResponse.JSON_PROPERTY_TEAM, - TeamGetInfoResponse.JSON_PROPERTY_WARNINGS + TeamGetInfoResponse.JSON_PROPERTY_TEAM, + TeamGetInfoResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TeamGetInfoResponse { - public static final String JSON_PROPERTY_TEAM = "team"; - @javax.annotation.Nonnull private TeamInfoResponse team; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public TeamGetInfoResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamGetInfoResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamGetInfoResponse.class); - } - - public static TeamGetInfoResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamGetInfoResponse.class); - } - - public TeamGetInfoResponse team(@javax.annotation.Nonnull TeamInfoResponse team) { - this.team = team; - return this; - } - - /** - * Get team - * - * @return team - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TeamInfoResponse getTeam() { - return team; - } - - @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTeam(@javax.annotation.Nonnull TeamInfoResponse team) { - this.team = team; - } - - public TeamGetInfoResponse warnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public TeamGetInfoResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_TEAM = "team"; + @javax.annotation.Nonnull + private TeamInfoResponse team; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public TeamGetInfoResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamGetInfoResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamGetInfoResponse.class); + } + + static public TeamGetInfoResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamGetInfoResponse.class + ); + } + + public TeamGetInfoResponse team(@javax.annotation.Nonnull TeamInfoResponse team) { + this.team = team; + return this; + } + + /** + * Get team + * @return team + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TeamInfoResponse getTeam() { + return team; + } + + + @JsonProperty(JSON_PROPERTY_TEAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTeam(@javax.annotation.Nonnull TeamInfoResponse team) { + this.team = team; + } + + + public TeamGetInfoResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TeamGetInfoResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this TeamGetInfoResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamGetInfoResponse teamGetInfoResponse = (TeamGetInfoResponse) o; + return Objects.equals(this.team, teamGetInfoResponse.team) && + Objects.equals(this.warnings, teamGetInfoResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(team, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamGetInfoResponse {\n"); + sb.append(" team: ").append(toIndentedString(team)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (team != null) { + if (isFileTypeOrListOfFiles(team)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this TeamGetInfoResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (team.getClass().equals(java.io.File.class) || + team.getClass().equals(Integer.class) || + team.getClass().equals(String.class) || + team.getClass().isEnum()) { + map.put("team", team); + } else if (isListOfFile(team)) { + for(int i = 0; i< getListSize(team); i++) { + map.put("team[" + i + "]", getFromList(team, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("team", JSON.getDefault().getMapper().writeValueAsString(team)); } - TeamGetInfoResponse teamGetInfoResponse = (TeamGetInfoResponse) o; - return Objects.equals(this.team, teamGetInfoResponse.team) - && Objects.equals(this.warnings, teamGetInfoResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(team, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamGetInfoResponse {\n"); - sb.append(" team: ").append(toIndentedString(team)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (team != null) { - if (isFileTypeOrListOfFiles(team)) { - fileTypeFound = true; - } - - if (team.getClass().equals(java.io.File.class) - || team.getClass().equals(Integer.class) - || team.getClass().equals(String.class) - || team.getClass().isEnum()) { - map.put("team", team); - } else if (isListOfFile(team)) { - for (int i = 0; i < getListSize(team); i++) { - map.put("team[" + i + "]", getFromList(team, i)); - } - } else { - map.put("team", JSON.getDefault().getMapper().writeValueAsString(team)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetResponse.java index 2bee16d9e..a6e283786 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetResponse.java @@ -10,212 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TeamResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** TeamGetResponse */ -@JsonPropertyOrder({TeamGetResponse.JSON_PROPERTY_TEAM, TeamGetResponse.JSON_PROPERTY_WARNINGS}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class TeamGetResponse { - public static final String JSON_PROPERTY_TEAM = "team"; - @javax.annotation.Nonnull private TeamResponse team; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public TeamGetResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamGetResponse.class); - } - - public static TeamGetResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamGetResponse.class); - } - - public TeamGetResponse team(@javax.annotation.Nonnull TeamResponse team) { - this.team = team; - return this; - } - - /** - * Get team - * - * @return team - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TeamResponse getTeam() { - return team; - } - - @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTeam(@javax.annotation.Nonnull TeamResponse team) { - this.team = team; - } +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; - public TeamGetResponse warnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - public TeamGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); +import com.dropbox.sign.ApiException; +/** + * TeamGetResponse + */ +@JsonPropertyOrder({ + TeamGetResponse.JSON_PROPERTY_TEAM, + TeamGetResponse.JSON_PROPERTY_WARNINGS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class TeamGetResponse { + public static final String JSON_PROPERTY_TEAM = "team"; + @javax.annotation.Nonnull + private TeamResponse team; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public TeamGetResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamGetResponse.class); + } + + static public TeamGetResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamGetResponse.class + ); + } + + public TeamGetResponse team(@javax.annotation.Nonnull TeamResponse team) { + this.team = team; + return this; + } + + /** + * Get team + * @return team + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TeamResponse getTeam() { + return team; + } + + + @JsonProperty(JSON_PROPERTY_TEAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTeam(@javax.annotation.Nonnull TeamResponse team) { + this.team = team; + } + + + public TeamGetResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TeamGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this TeamGetResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamGetResponse teamGetResponse = (TeamGetResponse) o; + return Objects.equals(this.team, teamGetResponse.team) && + Objects.equals(this.warnings, teamGetResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(team, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamGetResponse {\n"); + sb.append(" team: ").append(toIndentedString(team)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (team != null) { + if (isFileTypeOrListOfFiles(team)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this TeamGetResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (team.getClass().equals(java.io.File.class) || + team.getClass().equals(Integer.class) || + team.getClass().equals(String.class) || + team.getClass().isEnum()) { + map.put("team", team); + } else if (isListOfFile(team)) { + for(int i = 0; i< getListSize(team); i++) { + map.put("team[" + i + "]", getFromList(team, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("team", JSON.getDefault().getMapper().writeValueAsString(team)); } - TeamGetResponse teamGetResponse = (TeamGetResponse) o; - return Objects.equals(this.team, teamGetResponse.team) - && Objects.equals(this.warnings, teamGetResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(team, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamGetResponse {\n"); - sb.append(" team: ").append(toIndentedString(team)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (team != null) { - if (isFileTypeOrListOfFiles(team)) { - fileTypeFound = true; - } - - if (team.getClass().equals(java.io.File.class) - || team.getClass().equals(Integer.class) - || team.getClass().equals(String.class) - || team.getClass().isEnum()) { - map.put("team", team); - } else if (isListOfFile(team)) { - for (int i = 0; i < getListSize(team); i++) { - map.put("team[" + i + "]", getFromList(team, i)); - } - } else { - map.put("team", JSON.getDefault().getMapper().writeValueAsString(team)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java index 09b1f9c66..7071bd741 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java @@ -10,348 +10,375 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TeamParentResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TeamInfoResponse */ + +import com.dropbox.sign.ApiException; +/** + * TeamInfoResponse + */ @JsonPropertyOrder({ - TeamInfoResponse.JSON_PROPERTY_TEAM_ID, - TeamInfoResponse.JSON_PROPERTY_TEAM_PARENT, - TeamInfoResponse.JSON_PROPERTY_NAME, - TeamInfoResponse.JSON_PROPERTY_NUM_MEMBERS, - TeamInfoResponse.JSON_PROPERTY_NUM_SUB_TEAMS + TeamInfoResponse.JSON_PROPERTY_TEAM_ID, + TeamInfoResponse.JSON_PROPERTY_TEAM_PARENT, + TeamInfoResponse.JSON_PROPERTY_NAME, + TeamInfoResponse.JSON_PROPERTY_NUM_MEMBERS, + TeamInfoResponse.JSON_PROPERTY_NUM_SUB_TEAMS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TeamInfoResponse { - public static final String JSON_PROPERTY_TEAM_ID = "team_id"; - @javax.annotation.Nullable private String teamId; - - public static final String JSON_PROPERTY_TEAM_PARENT = "team_parent"; - @javax.annotation.Nullable private TeamParentResponse teamParent; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_NUM_MEMBERS = "num_members"; - @javax.annotation.Nullable private Integer numMembers; - - public static final String JSON_PROPERTY_NUM_SUB_TEAMS = "num_sub_teams"; - @javax.annotation.Nullable private Integer numSubTeams; - - public TeamInfoResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamInfoResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamInfoResponse.class); - } - - public static TeamInfoResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamInfoResponse.class); - } - - public TeamInfoResponse teamId(@javax.annotation.Nullable String teamId) { - this.teamId = teamId; - return this; - } - - /** - * The id of a team - * - * @return teamId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTeamId() { - return teamId; - } - - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTeamId(@javax.annotation.Nullable String teamId) { - this.teamId = teamId; - } - - public TeamInfoResponse teamParent(@javax.annotation.Nullable TeamParentResponse teamParent) { - this.teamParent = teamParent; - return this; - } - - /** - * Get teamParent - * - * @return teamParent - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEAM_PARENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TeamParentResponse getTeamParent() { - return teamParent; - } - - @JsonProperty(JSON_PROPERTY_TEAM_PARENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTeamParent(@javax.annotation.Nullable TeamParentResponse teamParent) { - this.teamParent = teamParent; + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + @javax.annotation.Nullable + private String teamId; + + public static final String JSON_PROPERTY_TEAM_PARENT = "team_parent"; + @javax.annotation.Nullable + private TeamParentResponse teamParent; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_NUM_MEMBERS = "num_members"; + @javax.annotation.Nullable + private Integer numMembers; + + public static final String JSON_PROPERTY_NUM_SUB_TEAMS = "num_sub_teams"; + @javax.annotation.Nullable + private Integer numSubTeams; + + public TeamInfoResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamInfoResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamInfoResponse.class); + } + + static public TeamInfoResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamInfoResponse.class + ); + } + + public TeamInfoResponse teamId(@javax.annotation.Nullable String teamId) { + this.teamId = teamId; + return this; + } + + /** + * The id of a team + * @return teamId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTeamId() { + return teamId; + } + + + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTeamId(@javax.annotation.Nullable String teamId) { + this.teamId = teamId; + } + + + public TeamInfoResponse teamParent(@javax.annotation.Nullable TeamParentResponse teamParent) { + this.teamParent = teamParent; + return this; + } + + /** + * Get teamParent + * @return teamParent + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_PARENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TeamParentResponse getTeamParent() { + return teamParent; + } + + + @JsonProperty(JSON_PROPERTY_TEAM_PARENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTeamParent(@javax.annotation.Nullable TeamParentResponse teamParent) { + this.teamParent = teamParent; + } + + + public TeamInfoResponse name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of a team + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public TeamInfoResponse numMembers(@javax.annotation.Nullable Integer numMembers) { + this.numMembers = numMembers; + return this; + } + + /** + * Number of members within a team + * @return numMembers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_MEMBERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getNumMembers() { + return numMembers; + } + + + @JsonProperty(JSON_PROPERTY_NUM_MEMBERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumMembers(@javax.annotation.Nullable Integer numMembers) { + this.numMembers = numMembers; + } + + + public TeamInfoResponse numSubTeams(@javax.annotation.Nullable Integer numSubTeams) { + this.numSubTeams = numSubTeams; + return this; + } + + /** + * Number of sub teams within a team + * @return numSubTeams + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_SUB_TEAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getNumSubTeams() { + return numSubTeams; + } + + + @JsonProperty(JSON_PROPERTY_NUM_SUB_TEAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumSubTeams(@javax.annotation.Nullable Integer numSubTeams) { + this.numSubTeams = numSubTeams; + } + + + /** + * Return true if this TeamInfoResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public TeamInfoResponse name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of a team - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public TeamInfoResponse numMembers(@javax.annotation.Nullable Integer numMembers) { - this.numMembers = numMembers; - return this; - } - - /** - * Number of members within a team - * - * @return numMembers - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getNumMembers() { - return numMembers; - } - - @JsonProperty(JSON_PROPERTY_NUM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumMembers(@javax.annotation.Nullable Integer numMembers) { - this.numMembers = numMembers; + if (o == null || getClass() != o.getClass()) { + return false; } + TeamInfoResponse teamInfoResponse = (TeamInfoResponse) o; + return Objects.equals(this.teamId, teamInfoResponse.teamId) && + Objects.equals(this.teamParent, teamInfoResponse.teamParent) && + Objects.equals(this.name, teamInfoResponse.name) && + Objects.equals(this.numMembers, teamInfoResponse.numMembers) && + Objects.equals(this.numSubTeams, teamInfoResponse.numSubTeams); + } + + @Override + public int hashCode() { + return Objects.hash(teamId, teamParent, name, numMembers, numSubTeams); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamInfoResponse {\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" teamParent: ").append(toIndentedString(teamParent)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" numMembers: ").append(toIndentedString(numMembers)).append("\n"); + sb.append(" numSubTeams: ").append(toIndentedString(numSubTeams)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (teamId != null) { + if (isFileTypeOrListOfFiles(teamId)) { + fileTypeFound = true; + } - public TeamInfoResponse numSubTeams(@javax.annotation.Nullable Integer numSubTeams) { - this.numSubTeams = numSubTeams; - return this; + if (teamId.getClass().equals(java.io.File.class) || + teamId.getClass().equals(Integer.class) || + teamId.getClass().equals(String.class) || + teamId.getClass().isEnum()) { + map.put("team_id", teamId); + } else if (isListOfFile(teamId)) { + for(int i = 0; i< getListSize(teamId); i++) { + map.put("team_id[" + i + "]", getFromList(teamId, i)); + } + } + else { + map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); + } } + if (teamParent != null) { + if (isFileTypeOrListOfFiles(teamParent)) { + fileTypeFound = true; + } - /** - * Number of sub teams within a team - * - * @return numSubTeams - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getNumSubTeams() { - return numSubTeams; + if (teamParent.getClass().equals(java.io.File.class) || + teamParent.getClass().equals(Integer.class) || + teamParent.getClass().equals(String.class) || + teamParent.getClass().isEnum()) { + map.put("team_parent", teamParent); + } else if (isListOfFile(teamParent)) { + for(int i = 0; i< getListSize(teamParent); i++) { + map.put("team_parent[" + i + "]", getFromList(teamParent, i)); + } + } + else { + map.put("team_parent", JSON.getDefault().getMapper().writeValueAsString(teamParent)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_NUM_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumSubTeams(@javax.annotation.Nullable Integer numSubTeams) { - this.numSubTeams = numSubTeams; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (numMembers != null) { + if (isFileTypeOrListOfFiles(numMembers)) { + fileTypeFound = true; + } - /** Return true if this TeamInfoResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (numMembers.getClass().equals(java.io.File.class) || + numMembers.getClass().equals(Integer.class) || + numMembers.getClass().equals(String.class) || + numMembers.getClass().isEnum()) { + map.put("num_members", numMembers); + } else if (isListOfFile(numMembers)) { + for(int i = 0; i< getListSize(numMembers); i++) { + map.put("num_members[" + i + "]", getFromList(numMembers, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("num_members", JSON.getDefault().getMapper().writeValueAsString(numMembers)); } - TeamInfoResponse teamInfoResponse = (TeamInfoResponse) o; - return Objects.equals(this.teamId, teamInfoResponse.teamId) - && Objects.equals(this.teamParent, teamInfoResponse.teamParent) - && Objects.equals(this.name, teamInfoResponse.name) - && Objects.equals(this.numMembers, teamInfoResponse.numMembers) - && Objects.equals(this.numSubTeams, teamInfoResponse.numSubTeams); } + if (numSubTeams != null) { + if (isFileTypeOrListOfFiles(numSubTeams)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(teamId, teamParent, name, numMembers, numSubTeams); + if (numSubTeams.getClass().equals(java.io.File.class) || + numSubTeams.getClass().equals(Integer.class) || + numSubTeams.getClass().equals(String.class) || + numSubTeams.getClass().isEnum()) { + map.put("num_sub_teams", numSubTeams); + } else if (isListOfFile(numSubTeams)) { + for(int i = 0; i< getListSize(numSubTeams); i++) { + map.put("num_sub_teams[" + i + "]", getFromList(numSubTeams, i)); + } + } + else { + map.put("num_sub_teams", JSON.getDefault().getMapper().writeValueAsString(numSubTeams)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamInfoResponse {\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" teamParent: ").append(toIndentedString(teamParent)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" numMembers: ").append(toIndentedString(numMembers)).append("\n"); - sb.append(" numSubTeams: ").append(toIndentedString(numSubTeams)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (teamId != null) { - if (isFileTypeOrListOfFiles(teamId)) { - fileTypeFound = true; - } - - if (teamId.getClass().equals(java.io.File.class) - || teamId.getClass().equals(Integer.class) - || teamId.getClass().equals(String.class) - || teamId.getClass().isEnum()) { - map.put("team_id", teamId); - } else if (isListOfFile(teamId)) { - for (int i = 0; i < getListSize(teamId); i++) { - map.put("team_id[" + i + "]", getFromList(teamId, i)); - } - } else { - map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); - } - } - if (teamParent != null) { - if (isFileTypeOrListOfFiles(teamParent)) { - fileTypeFound = true; - } - - if (teamParent.getClass().equals(java.io.File.class) - || teamParent.getClass().equals(Integer.class) - || teamParent.getClass().equals(String.class) - || teamParent.getClass().isEnum()) { - map.put("team_parent", teamParent); - } else if (isListOfFile(teamParent)) { - for (int i = 0; i < getListSize(teamParent); i++) { - map.put("team_parent[" + i + "]", getFromList(teamParent, i)); - } - } else { - map.put( - "team_parent", - JSON.getDefault().getMapper().writeValueAsString(teamParent)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (numMembers != null) { - if (isFileTypeOrListOfFiles(numMembers)) { - fileTypeFound = true; - } - - if (numMembers.getClass().equals(java.io.File.class) - || numMembers.getClass().equals(Integer.class) - || numMembers.getClass().equals(String.class) - || numMembers.getClass().isEnum()) { - map.put("num_members", numMembers); - } else if (isListOfFile(numMembers)) { - for (int i = 0; i < getListSize(numMembers); i++) { - map.put("num_members[" + i + "]", getFromList(numMembers, i)); - } - } else { - map.put( - "num_members", - JSON.getDefault().getMapper().writeValueAsString(numMembers)); - } - } - if (numSubTeams != null) { - if (isFileTypeOrListOfFiles(numSubTeams)) { - fileTypeFound = true; - } - - if (numSubTeams.getClass().equals(java.io.File.class) - || numSubTeams.getClass().equals(Integer.class) - || numSubTeams.getClass().equals(String.class) - || numSubTeams.getClass().isEnum()) { - map.put("num_sub_teams", numSubTeams); - } else if (isListOfFile(numSubTeams)) { - for (int i = 0; i < getListSize(numSubTeams); i++) { - map.put("num_sub_teams[" + i + "]", getFromList(numSubTeams, i)); - } - } else { - map.put( - "num_sub_teams", - JSON.getDefault().getMapper().writeValueAsString(numSubTeams)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java index 05bcf91b5..e6fc3c307 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java @@ -10,394 +10,425 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TeamInviteResponse */ + +import com.dropbox.sign.ApiException; +/** + * TeamInviteResponse + */ @JsonPropertyOrder({ - TeamInviteResponse.JSON_PROPERTY_EMAIL_ADDRESS, - TeamInviteResponse.JSON_PROPERTY_TEAM_ID, - TeamInviteResponse.JSON_PROPERTY_ROLE, - TeamInviteResponse.JSON_PROPERTY_SENT_AT, - TeamInviteResponse.JSON_PROPERTY_REDEEMED_AT, - TeamInviteResponse.JSON_PROPERTY_EXPIRES_AT + TeamInviteResponse.JSON_PROPERTY_EMAIL_ADDRESS, + TeamInviteResponse.JSON_PROPERTY_TEAM_ID, + TeamInviteResponse.JSON_PROPERTY_ROLE, + TeamInviteResponse.JSON_PROPERTY_SENT_AT, + TeamInviteResponse.JSON_PROPERTY_REDEEMED_AT, + TeamInviteResponse.JSON_PROPERTY_EXPIRES_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TeamInviteResponse { - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; - - public static final String JSON_PROPERTY_TEAM_ID = "team_id"; - @javax.annotation.Nullable private String teamId; - - public static final String JSON_PROPERTY_ROLE = "role"; - @javax.annotation.Nullable private String role; - - public static final String JSON_PROPERTY_SENT_AT = "sent_at"; - @javax.annotation.Nullable private Integer sentAt; - - public static final String JSON_PROPERTY_REDEEMED_AT = "redeemed_at"; - @javax.annotation.Nullable private Integer redeemedAt; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public TeamInviteResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamInviteResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamInviteResponse.class); + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; + + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + @javax.annotation.Nullable + private String teamId; + + public static final String JSON_PROPERTY_ROLE = "role"; + @javax.annotation.Nullable + private String role; + + public static final String JSON_PROPERTY_SENT_AT = "sent_at"; + @javax.annotation.Nullable + private Integer sentAt; + + public static final String JSON_PROPERTY_REDEEMED_AT = "redeemed_at"; + @javax.annotation.Nullable + private Integer redeemedAt; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public TeamInviteResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamInviteResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamInviteResponse.class); + } + + static public TeamInviteResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamInviteResponse.class + ); + } + + public TeamInviteResponse emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Email address of the user invited to this team. + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + public TeamInviteResponse teamId(@javax.annotation.Nullable String teamId) { + this.teamId = teamId; + return this; + } + + /** + * Id of the team. + * @return teamId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTeamId() { + return teamId; + } + + + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTeamId(@javax.annotation.Nullable String teamId) { + this.teamId = teamId; + } + + + public TeamInviteResponse role(@javax.annotation.Nullable String role) { + this.role = role; + return this; + } + + /** + * Role of the user invited to this team. + * @return role + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRole() { + return role; + } + + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(@javax.annotation.Nullable String role) { + this.role = role; + } + + + public TeamInviteResponse sentAt(@javax.annotation.Nullable Integer sentAt) { + this.sentAt = sentAt; + return this; + } + + /** + * Timestamp when the invitation was sent. + * @return sentAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SENT_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSentAt() { + return sentAt; + } + + + @JsonProperty(JSON_PROPERTY_SENT_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSentAt(@javax.annotation.Nullable Integer sentAt) { + this.sentAt = sentAt; + } + + + public TeamInviteResponse redeemedAt(@javax.annotation.Nullable Integer redeemedAt) { + this.redeemedAt = redeemedAt; + return this; + } + + /** + * Timestamp when the invitation was redeemed. + * @return redeemedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REDEEMED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getRedeemedAt() { + return redeemedAt; + } + + + @JsonProperty(JSON_PROPERTY_REDEEMED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRedeemedAt(@javax.annotation.Nullable Integer redeemedAt) { + this.redeemedAt = redeemedAt; + } + + + public TeamInviteResponse expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * Timestamp when the invitation is expiring. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this TeamInviteResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public static TeamInviteResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamInviteResponse.class); - } - - public TeamInviteResponse emailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * Email address of the user invited to this team. - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; - } - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - } - - public TeamInviteResponse teamId(@javax.annotation.Nullable String teamId) { - this.teamId = teamId; - return this; - } - - /** - * Id of the team. - * - * @return teamId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTeamId() { - return teamId; - } - - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTeamId(@javax.annotation.Nullable String teamId) { - this.teamId = teamId; - } - - public TeamInviteResponse role(@javax.annotation.Nullable String role) { - this.role = role; - return this; - } - - /** - * Role of the user invited to this team. - * - * @return role - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRole() { - return role; - } - - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRole(@javax.annotation.Nullable String role) { - this.role = role; - } - - public TeamInviteResponse sentAt(@javax.annotation.Nullable Integer sentAt) { - this.sentAt = sentAt; - return this; - } - - /** - * Timestamp when the invitation was sent. - * - * @return sentAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SENT_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getSentAt() { - return sentAt; - } - - @JsonProperty(JSON_PROPERTY_SENT_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSentAt(@javax.annotation.Nullable Integer sentAt) { - this.sentAt = sentAt; - } - - public TeamInviteResponse redeemedAt(@javax.annotation.Nullable Integer redeemedAt) { - this.redeemedAt = redeemedAt; - return this; - } - - /** - * Timestamp when the invitation was redeemed. - * - * @return redeemedAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REDEEMED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getRedeemedAt() { - return redeemedAt; + if (o == null || getClass() != o.getClass()) { + return false; } + TeamInviteResponse teamInviteResponse = (TeamInviteResponse) o; + return Objects.equals(this.emailAddress, teamInviteResponse.emailAddress) && + Objects.equals(this.teamId, teamInviteResponse.teamId) && + Objects.equals(this.role, teamInviteResponse.role) && + Objects.equals(this.sentAt, teamInviteResponse.sentAt) && + Objects.equals(this.redeemedAt, teamInviteResponse.redeemedAt) && + Objects.equals(this.expiresAt, teamInviteResponse.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(emailAddress, teamId, role, sentAt, redeemedAt, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamInviteResponse {\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" sentAt: ").append(toIndentedString(sentAt)).append("\n"); + sb.append(" redeemedAt: ").append(toIndentedString(redeemedAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_REDEEMED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRedeemedAt(@javax.annotation.Nullable Integer redeemedAt) { - this.redeemedAt = redeemedAt; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } + if (teamId != null) { + if (isFileTypeOrListOfFiles(teamId)) { + fileTypeFound = true; + } - public TeamInviteResponse expiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; + if (teamId.getClass().equals(java.io.File.class) || + teamId.getClass().equals(Integer.class) || + teamId.getClass().equals(String.class) || + teamId.getClass().isEnum()) { + map.put("team_id", teamId); + } else if (isListOfFile(teamId)) { + for(int i = 0; i< getListSize(teamId); i++) { + map.put("team_id[" + i + "]", getFromList(teamId, i)); + } + } + else { + map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); + } } + if (role != null) { + if (isFileTypeOrListOfFiles(role)) { + fileTypeFound = true; + } - /** - * Timestamp when the invitation is expiring. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; + if (role.getClass().equals(java.io.File.class) || + role.getClass().equals(Integer.class) || + role.getClass().equals(String.class) || + role.getClass().isEnum()) { + map.put("role", role); + } else if (isListOfFile(role)) { + for(int i = 0; i< getListSize(role); i++) { + map.put("role[" + i + "]", getFromList(role, i)); + } + } + else { + map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + } } + if (sentAt != null) { + if (isFileTypeOrListOfFiles(sentAt)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; + if (sentAt.getClass().equals(java.io.File.class) || + sentAt.getClass().equals(Integer.class) || + sentAt.getClass().equals(String.class) || + sentAt.getClass().isEnum()) { + map.put("sent_at", sentAt); + } else if (isListOfFile(sentAt)) { + for(int i = 0; i< getListSize(sentAt); i++) { + map.put("sent_at[" + i + "]", getFromList(sentAt, i)); + } + } + else { + map.put("sent_at", JSON.getDefault().getMapper().writeValueAsString(sentAt)); + } } + if (redeemedAt != null) { + if (isFileTypeOrListOfFiles(redeemedAt)) { + fileTypeFound = true; + } - /** Return true if this TeamInviteResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (redeemedAt.getClass().equals(java.io.File.class) || + redeemedAt.getClass().equals(Integer.class) || + redeemedAt.getClass().equals(String.class) || + redeemedAt.getClass().isEnum()) { + map.put("redeemed_at", redeemedAt); + } else if (isListOfFile(redeemedAt)) { + for(int i = 0; i< getListSize(redeemedAt); i++) { + map.put("redeemed_at[" + i + "]", getFromList(redeemedAt, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("redeemed_at", JSON.getDefault().getMapper().writeValueAsString(redeemedAt)); } - TeamInviteResponse teamInviteResponse = (TeamInviteResponse) o; - return Objects.equals(this.emailAddress, teamInviteResponse.emailAddress) - && Objects.equals(this.teamId, teamInviteResponse.teamId) - && Objects.equals(this.role, teamInviteResponse.role) - && Objects.equals(this.sentAt, teamInviteResponse.sentAt) - && Objects.equals(this.redeemedAt, teamInviteResponse.redeemedAt) - && Objects.equals(this.expiresAt, teamInviteResponse.expiresAt); } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(emailAddress, teamId, role, sentAt, redeemedAt, expiresAt); + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamInviteResponse {\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" sentAt: ").append(toIndentedString(sentAt)).append("\n"); - sb.append(" redeemedAt: ").append(toIndentedString(redeemedAt)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - if (teamId != null) { - if (isFileTypeOrListOfFiles(teamId)) { - fileTypeFound = true; - } - - if (teamId.getClass().equals(java.io.File.class) - || teamId.getClass().equals(Integer.class) - || teamId.getClass().equals(String.class) - || teamId.getClass().isEnum()) { - map.put("team_id", teamId); - } else if (isListOfFile(teamId)) { - for (int i = 0; i < getListSize(teamId); i++) { - map.put("team_id[" + i + "]", getFromList(teamId, i)); - } - } else { - map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); - } - } - if (role != null) { - if (isFileTypeOrListOfFiles(role)) { - fileTypeFound = true; - } - - if (role.getClass().equals(java.io.File.class) - || role.getClass().equals(Integer.class) - || role.getClass().equals(String.class) - || role.getClass().isEnum()) { - map.put("role", role); - } else if (isListOfFile(role)) { - for (int i = 0; i < getListSize(role); i++) { - map.put("role[" + i + "]", getFromList(role, i)); - } - } else { - map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); - } - } - if (sentAt != null) { - if (isFileTypeOrListOfFiles(sentAt)) { - fileTypeFound = true; - } - - if (sentAt.getClass().equals(java.io.File.class) - || sentAt.getClass().equals(Integer.class) - || sentAt.getClass().equals(String.class) - || sentAt.getClass().isEnum()) { - map.put("sent_at", sentAt); - } else if (isListOfFile(sentAt)) { - for (int i = 0; i < getListSize(sentAt); i++) { - map.put("sent_at[" + i + "]", getFromList(sentAt, i)); - } - } else { - map.put("sent_at", JSON.getDefault().getMapper().writeValueAsString(sentAt)); - } - } - if (redeemedAt != null) { - if (isFileTypeOrListOfFiles(redeemedAt)) { - fileTypeFound = true; - } - - if (redeemedAt.getClass().equals(java.io.File.class) - || redeemedAt.getClass().equals(Integer.class) - || redeemedAt.getClass().equals(String.class) - || redeemedAt.getClass().isEnum()) { - map.put("redeemed_at", redeemedAt); - } else if (isListOfFile(redeemedAt)) { - for (int i = 0; i < getListSize(redeemedAt); i++) { - map.put("redeemed_at[" + i + "]", getFromList(redeemedAt, i)); - } - } else { - map.put( - "redeemed_at", - JSON.getDefault().getMapper().writeValueAsString(redeemedAt)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java index 0fee37e1f..fea7a11ab 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java @@ -10,226 +10,241 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TeamInviteResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** TeamInvitesResponse */ +import com.dropbox.sign.ApiException; +/** + * TeamInvitesResponse + */ @JsonPropertyOrder({ - TeamInvitesResponse.JSON_PROPERTY_TEAM_INVITES, - TeamInvitesResponse.JSON_PROPERTY_WARNINGS + TeamInvitesResponse.JSON_PROPERTY_TEAM_INVITES, + TeamInvitesResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TeamInvitesResponse { - public static final String JSON_PROPERTY_TEAM_INVITES = "team_invites"; - @javax.annotation.Nonnull private List teamInvites = new ArrayList<>(); - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public TeamInvitesResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamInvitesResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamInvitesResponse.class); - } - - public static TeamInvitesResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamInvitesResponse.class); - } - - public TeamInvitesResponse teamInvites( - @javax.annotation.Nonnull List teamInvites) { - this.teamInvites = teamInvites; - return this; - } - - public TeamInvitesResponse addTeamInvitesItem(TeamInviteResponse teamInvitesItem) { - if (this.teamInvites == null) { - this.teamInvites = new ArrayList<>(); + public static final String JSON_PROPERTY_TEAM_INVITES = "team_invites"; + @javax.annotation.Nonnull + private List teamInvites = new ArrayList<>(); + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public TeamInvitesResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamInvitesResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamInvitesResponse.class); + } + + static public TeamInvitesResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamInvitesResponse.class + ); + } + + public TeamInvitesResponse teamInvites(@javax.annotation.Nonnull List teamInvites) { + this.teamInvites = teamInvites; + return this; + } + + public TeamInvitesResponse addTeamInvitesItem(TeamInviteResponse teamInvitesItem) { + if (this.teamInvites == null) { + this.teamInvites = new ArrayList<>(); + } + this.teamInvites.add(teamInvitesItem); + return this; + } + + /** + * Contains a list of team invites and their roles. + * @return teamInvites + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEAM_INVITES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTeamInvites() { + return teamInvites; + } + + + @JsonProperty(JSON_PROPERTY_TEAM_INVITES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTeamInvites(@javax.annotation.Nonnull List teamInvites) { + this.teamInvites = teamInvites; + } + + + public TeamInvitesResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TeamInvitesResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * Get warnings + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this TeamInvitesResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamInvitesResponse teamInvitesResponse = (TeamInvitesResponse) o; + return Objects.equals(this.teamInvites, teamInvitesResponse.teamInvites) && + Objects.equals(this.warnings, teamInvitesResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(teamInvites, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamInvitesResponse {\n"); + sb.append(" teamInvites: ").append(toIndentedString(teamInvites)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (teamInvites != null) { + if (isFileTypeOrListOfFiles(teamInvites)) { + fileTypeFound = true; } - this.teamInvites.add(teamInvitesItem); - return this; - } - /** - * Contains a list of team invites and their roles. - * - * @return teamInvites - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEAM_INVITES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getTeamInvites() { - return teamInvites; - } - - @JsonProperty(JSON_PROPERTY_TEAM_INVITES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTeamInvites(@javax.annotation.Nonnull List teamInvites) { - this.teamInvites = teamInvites; - } - - public TeamInvitesResponse warnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public TeamInvitesResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + if (teamInvites.getClass().equals(java.io.File.class) || + teamInvites.getClass().equals(Integer.class) || + teamInvites.getClass().equals(String.class) || + teamInvites.getClass().isEnum()) { + map.put("team_invites", teamInvites); + } else if (isListOfFile(teamInvites)) { + for(int i = 0; i< getListSize(teamInvites); i++) { + map.put("team_invites[" + i + "]", getFromList(teamInvites, i)); + } + } + else { + map.put("team_invites", JSON.getDefault().getMapper().writeValueAsString(teamInvites)); } - this.warnings.add(warningsItem); - return this; - } - - /** - * Get warnings - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - /** Return true if this TeamInvitesResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); } - TeamInvitesResponse teamInvitesResponse = (TeamInvitesResponse) o; - return Objects.equals(this.teamInvites, teamInvitesResponse.teamInvites) - && Objects.equals(this.warnings, teamInvitesResponse.warnings); } - - @Override - public int hashCode() { - return Objects.hash(teamInvites, warnings); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamInvitesResponse {\n"); - sb.append(" teamInvites: ").append(toIndentedString(teamInvites)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (teamInvites != null) { - if (isFileTypeOrListOfFiles(teamInvites)) { - fileTypeFound = true; - } - - if (teamInvites.getClass().equals(java.io.File.class) - || teamInvites.getClass().equals(Integer.class) - || teamInvites.getClass().equals(String.class) - || teamInvites.getClass().isEnum()) { - map.put("team_invites", teamInvites); - } else if (isListOfFile(teamInvites)) { - for (int i = 0; i < getListSize(teamInvites); i++) { - map.put("team_invites[" + i + "]", getFromList(teamInvites, i)); - } - } else { - map.put( - "team_invites", - JSON.getDefault().getMapper().writeValueAsString(teamInvites)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } - - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java index ce80c5eb7..3843b2df0 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java @@ -10,254 +10,272 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TeamMemberResponse */ + +import com.dropbox.sign.ApiException; +/** + * TeamMemberResponse + */ @JsonPropertyOrder({ - TeamMemberResponse.JSON_PROPERTY_ACCOUNT_ID, - TeamMemberResponse.JSON_PROPERTY_EMAIL_ADDRESS, - TeamMemberResponse.JSON_PROPERTY_ROLE + TeamMemberResponse.JSON_PROPERTY_ACCOUNT_ID, + TeamMemberResponse.JSON_PROPERTY_EMAIL_ADDRESS, + TeamMemberResponse.JSON_PROPERTY_ROLE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TeamMemberResponse { - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - @javax.annotation.Nullable private String accountId; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + @javax.annotation.Nullable + private String accountId; - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; - public static final String JSON_PROPERTY_ROLE = "role"; - @javax.annotation.Nullable private String role; + public static final String JSON_PROPERTY_ROLE = "role"; + @javax.annotation.Nullable + private String role; - public TeamMemberResponse() {} + public TeamMemberResponse() { + } - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamMemberResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamMemberResponse.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamMemberResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamMemberResponse.class); + } - public static TeamMemberResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamMemberResponse.class); - } + static public TeamMemberResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamMemberResponse.class + ); + } - public TeamMemberResponse accountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; - } + public TeamMemberResponse accountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + return this; + } - /** - * Account id of the team member. - * - * @return accountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccountId() { - return accountId; - } + /** + * Account id of the team member. + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - } + public String getAccountId() { + return accountId; + } - public TeamMemberResponse emailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - /** - * Email address of the team member. - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; - } + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + } - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - } - public TeamMemberResponse role(@javax.annotation.Nullable String role) { - this.role = role; - return this; - } + public TeamMemberResponse emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } - /** - * The specific role a member has on the team. - * - * @return role - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRole() { - return role; - } + /** + * Email address of the team member. + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + public TeamMemberResponse role(@javax.annotation.Nullable String role) { + this.role = role; + return this; + } + + /** + * The specific role a member has on the team. + * @return role + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRole(@javax.annotation.Nullable String role) { - this.role = role; + public String getRole() { + return role; + } + + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(@javax.annotation.Nullable String role) { + this.role = role; + } + + + /** + * Return true if this TeamMemberResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamMemberResponse teamMemberResponse = (TeamMemberResponse) o; + return Objects.equals(this.accountId, teamMemberResponse.accountId) && + Objects.equals(this.emailAddress, teamMemberResponse.emailAddress) && + Objects.equals(this.role, teamMemberResponse.role); + } - /** Return true if this TeamMemberResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress, role); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamMemberResponse {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; } - TeamMemberResponse teamMemberResponse = (TeamMemberResponse) o; - return Objects.equals(this.accountId, teamMemberResponse.accountId) - && Objects.equals(this.emailAddress, teamMemberResponse.emailAddress) - && Objects.equals(this.role, teamMemberResponse.role); - } - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress, role); + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamMemberResponse {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append("}"); - return sb.toString(); + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } + if (role != null) { + if (isFileTypeOrListOfFiles(role)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } - - if (accountId.getClass().equals(java.io.File.class) - || accountId.getClass().equals(Integer.class) - || accountId.getClass().equals(String.class) - || accountId.getClass().isEnum()) { - map.put("account_id", accountId); - } else if (isListOfFile(accountId)) { - for (int i = 0; i < getListSize(accountId); i++) { - map.put("account_id[" + i + "]", getFromList(accountId, i)); - } - } else { - map.put( - "account_id", - JSON.getDefault().getMapper().writeValueAsString(accountId)); - } - } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } + if (role.getClass().equals(java.io.File.class) || + role.getClass().equals(Integer.class) || + role.getClass().equals(String.class) || + role.getClass().isEnum()) { + map.put("role", role); + } else if (isListOfFile(role)) { + for(int i = 0; i< getListSize(role); i++) { + map.put("role[" + i + "]", getFromList(role, i)); } - if (role != null) { - if (isFileTypeOrListOfFiles(role)) { - fileTypeFound = true; - } - - if (role.getClass().equals(java.io.File.class) - || role.getClass().equals(Integer.class) - || role.getClass().equals(String.class) - || role.getClass().isEnum()) { - map.put("role", role); - } else if (isListOfFile(role)) { - for (int i = 0; i < getListSize(role); i++) { - map.put("role[" + i + "]", getFromList(role, i)); - } - } else { - map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java index 8dd4d104c..d8223d138 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java @@ -10,275 +10,293 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.ListInfoResponse; +import com.dropbox.sign.model.TeamMemberResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** TeamMembersResponse */ +import com.dropbox.sign.ApiException; +/** + * TeamMembersResponse + */ @JsonPropertyOrder({ - TeamMembersResponse.JSON_PROPERTY_TEAM_MEMBERS, - TeamMembersResponse.JSON_PROPERTY_LIST_INFO, - TeamMembersResponse.JSON_PROPERTY_WARNINGS + TeamMembersResponse.JSON_PROPERTY_TEAM_MEMBERS, + TeamMembersResponse.JSON_PROPERTY_LIST_INFO, + TeamMembersResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TeamMembersResponse { - public static final String JSON_PROPERTY_TEAM_MEMBERS = "team_members"; - @javax.annotation.Nonnull private List teamMembers = new ArrayList<>(); - - public static final String JSON_PROPERTY_LIST_INFO = "list_info"; - @javax.annotation.Nonnull private ListInfoResponse listInfo; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public TeamMembersResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamMembersResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamMembersResponse.class); - } - - public static TeamMembersResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamMembersResponse.class); + public static final String JSON_PROPERTY_TEAM_MEMBERS = "team_members"; + @javax.annotation.Nonnull + private List teamMembers = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + @javax.annotation.Nonnull + private ListInfoResponse listInfo; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public TeamMembersResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamMembersResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamMembersResponse.class); + } + + static public TeamMembersResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamMembersResponse.class + ); + } + + public TeamMembersResponse teamMembers(@javax.annotation.Nonnull List teamMembers) { + this.teamMembers = teamMembers; + return this; + } + + public TeamMembersResponse addTeamMembersItem(TeamMemberResponse teamMembersItem) { + if (this.teamMembers == null) { + this.teamMembers = new ArrayList<>(); } - - public TeamMembersResponse teamMembers( - @javax.annotation.Nonnull List teamMembers) { - this.teamMembers = teamMembers; - return this; - } - - public TeamMembersResponse addTeamMembersItem(TeamMemberResponse teamMembersItem) { - if (this.teamMembers == null) { - this.teamMembers = new ArrayList<>(); - } - this.teamMembers.add(teamMembersItem); - return this; + this.teamMembers.add(teamMembersItem); + return this; + } + + /** + * Contains a list of team members and their roles for a specific team. + * @return teamMembers + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTeamMembers() { + return teamMembers; + } + + + @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTeamMembers(@javax.annotation.Nonnull List teamMembers) { + this.teamMembers = teamMembers; + } + + + public TeamMembersResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; + } + + /** + * Get listInfo + * @return listInfo + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ListInfoResponse getListInfo() { + return listInfo; + } + + + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + } + + + public TeamMembersResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TeamMembersResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } - - /** - * Contains a list of team members and their roles for a specific team. - * - * @return teamMembers - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getTeamMembers() { - return teamMembers; - } - - @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTeamMembers(@javax.annotation.Nonnull List teamMembers) { - this.teamMembers = teamMembers; + this.warnings.add(warningsItem); + return this; + } + + /** + * Get warnings + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this TeamMembersResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public TeamMembersResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - /** - * Get listInfo - * - * @return listInfo - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ListInfoResponse getListInfo() { - return listInfo; - } - - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - } - - public TeamMembersResponse warnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public TeamMembersResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + TeamMembersResponse teamMembersResponse = (TeamMembersResponse) o; + return Objects.equals(this.teamMembers, teamMembersResponse.teamMembers) && + Objects.equals(this.listInfo, teamMembersResponse.listInfo) && + Objects.equals(this.warnings, teamMembersResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(teamMembers, listInfo, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamMembersResponse {\n"); + sb.append(" teamMembers: ").append(toIndentedString(teamMembers)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (teamMembers != null) { + if (isFileTypeOrListOfFiles(teamMembers)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * Get warnings - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; + if (teamMembers.getClass().equals(java.io.File.class) || + teamMembers.getClass().equals(Integer.class) || + teamMembers.getClass().equals(String.class) || + teamMembers.getClass().isEnum()) { + map.put("team_members", teamMembers); + } else if (isListOfFile(teamMembers)) { + for(int i = 0; i< getListSize(teamMembers); i++) { + map.put("team_members[" + i + "]", getFromList(teamMembers, i)); + } + } + else { + map.put("team_members", JSON.getDefault().getMapper().writeValueAsString(teamMembers)); + } } + if (listInfo != null) { + if (isFileTypeOrListOfFiles(listInfo)) { + fileTypeFound = true; + } - /** Return true if this TeamMembersResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (listInfo.getClass().equals(java.io.File.class) || + listInfo.getClass().equals(Integer.class) || + listInfo.getClass().equals(String.class) || + listInfo.getClass().isEnum()) { + map.put("list_info", listInfo); + } else if (isListOfFile(listInfo)) { + for(int i = 0; i< getListSize(listInfo); i++) { + map.put("list_info[" + i + "]", getFromList(listInfo, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("list_info", JSON.getDefault().getMapper().writeValueAsString(listInfo)); } - TeamMembersResponse teamMembersResponse = (TeamMembersResponse) o; - return Objects.equals(this.teamMembers, teamMembersResponse.teamMembers) - && Objects.equals(this.listInfo, teamMembersResponse.listInfo) - && Objects.equals(this.warnings, teamMembersResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(teamMembers, listInfo, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamMembersResponse {\n"); - sb.append(" teamMembers: ").append(toIndentedString(teamMembers)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (teamMembers != null) { - if (isFileTypeOrListOfFiles(teamMembers)) { - fileTypeFound = true; - } - - if (teamMembers.getClass().equals(java.io.File.class) - || teamMembers.getClass().equals(Integer.class) - || teamMembers.getClass().equals(String.class) - || teamMembers.getClass().isEnum()) { - map.put("team_members", teamMembers); - } else if (isListOfFile(teamMembers)) { - for (int i = 0; i < getListSize(teamMembers); i++) { - map.put("team_members[" + i + "]", getFromList(teamMembers, i)); - } - } else { - map.put( - "team_members", - JSON.getDefault().getMapper().writeValueAsString(teamMembers)); - } - } - if (listInfo != null) { - if (isFileTypeOrListOfFiles(listInfo)) { - fileTypeFound = true; - } - - if (listInfo.getClass().equals(java.io.File.class) - || listInfo.getClass().equals(Integer.class) - || listInfo.getClass().equals(String.class) - || listInfo.getClass().isEnum()) { - map.put("list_info", listInfo); - } else if (isListOfFile(listInfo)) { - for (int i = 0; i < getListSize(listInfo); i++) { - map.put("list_info[" + i + "]", getFromList(listInfo, i)); - } - } else { - map.put( - "list_info", - JSON.getDefault().getMapper().writeValueAsString(listInfo)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamParentResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamParentResponse.java index 9c8125e4b..0bb5083ef 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamParentResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamParentResponse.java @@ -10,204 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** Information about the parent team if a team has one, set to `null` otherwise. */ + +import com.dropbox.sign.ApiException; +/** + * Information about the parent team if a team has one, set to `null` otherwise. + */ @JsonPropertyOrder({ - TeamParentResponse.JSON_PROPERTY_TEAM_ID, - TeamParentResponse.JSON_PROPERTY_NAME + TeamParentResponse.JSON_PROPERTY_TEAM_ID, + TeamParentResponse.JSON_PROPERTY_NAME }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TeamParentResponse { - public static final String JSON_PROPERTY_TEAM_ID = "team_id"; - @javax.annotation.Nullable private String teamId; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public TeamParentResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamParentResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamParentResponse.class); - } - - public static TeamParentResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamParentResponse.class); - } - - public TeamParentResponse teamId(@javax.annotation.Nullable String teamId) { - this.teamId = teamId; - return this; - } - - /** - * The id of a team - * - * @return teamId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTeamId() { - return teamId; - } - - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTeamId(@javax.annotation.Nullable String teamId) { - this.teamId = teamId; - } - - public TeamParentResponse name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of a team - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + @javax.annotation.Nullable + private String teamId; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public TeamParentResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamParentResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamParentResponse.class); + } + + static public TeamParentResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamParentResponse.class + ); + } + + public TeamParentResponse teamId(@javax.annotation.Nullable String teamId) { + this.teamId = teamId; + return this; + } + + /** + * The id of a team + * @return teamId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTeamId() { + return teamId; + } + + + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTeamId(@javax.annotation.Nullable String teamId) { + this.teamId = teamId; + } + + + public TeamParentResponse name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of a team + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + /** + * Return true if this TeamParentResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamParentResponse teamParentResponse = (TeamParentResponse) o; + return Objects.equals(this.teamId, teamParentResponse.teamId) && + Objects.equals(this.name, teamParentResponse.name); + } + + @Override + public int hashCode() { + return Objects.hash(teamId, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamParentResponse {\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (teamId != null) { + if (isFileTypeOrListOfFiles(teamId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; + if (teamId.getClass().equals(java.io.File.class) || + teamId.getClass().equals(Integer.class) || + teamId.getClass().equals(String.class) || + teamId.getClass().isEnum()) { + map.put("team_id", teamId); + } else if (isListOfFile(teamId)) { + for(int i = 0; i< getListSize(teamId); i++) { + map.put("team_id[" + i + "]", getFromList(teamId, i)); + } + } + else { + map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** Return true if this TeamParentResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); } - TeamParentResponse teamParentResponse = (TeamParentResponse) o; - return Objects.equals(this.teamId, teamParentResponse.teamId) - && Objects.equals(this.name, teamParentResponse.name); } - - @Override - public int hashCode() { - return Objects.hash(teamId, name); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamParentResponse {\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (teamId != null) { - if (isFileTypeOrListOfFiles(teamId)) { - fileTypeFound = true; - } - - if (teamId.getClass().equals(java.io.File.class) - || teamId.getClass().equals(Integer.class) - || teamId.getClass().equals(String.class) - || teamId.getClass().isEnum()) { - map.put("team_id", teamId); - } else if (isListOfFile(teamId)) { - for (int i = 0; i < getListSize(teamId); i++) { - map.put("team_id[" + i + "]", getFromList(teamId, i)); - } - } else { - map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java index f78b47e7b..c6fd60f4d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java @@ -10,405 +10,413 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TeamRemoveMemberRequest */ + +import com.dropbox.sign.ApiException; +/** + * TeamRemoveMemberRequest + */ @JsonPropertyOrder({ - TeamRemoveMemberRequest.JSON_PROPERTY_ACCOUNT_ID, - TeamRemoveMemberRequest.JSON_PROPERTY_EMAIL_ADDRESS, - TeamRemoveMemberRequest.JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS, - TeamRemoveMemberRequest.JSON_PROPERTY_NEW_TEAM_ID, - TeamRemoveMemberRequest.JSON_PROPERTY_NEW_ROLE + TeamRemoveMemberRequest.JSON_PROPERTY_ACCOUNT_ID, + TeamRemoveMemberRequest.JSON_PROPERTY_EMAIL_ADDRESS, + TeamRemoveMemberRequest.JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS, + TeamRemoveMemberRequest.JSON_PROPERTY_NEW_TEAM_ID, + TeamRemoveMemberRequest.JSON_PROPERTY_NEW_ROLE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TeamRemoveMemberRequest { - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - @javax.annotation.Nullable private String accountId; - - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; - - public static final String JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS = "new_owner_email_address"; - @javax.annotation.Nullable private String newOwnerEmailAddress; - - public static final String JSON_PROPERTY_NEW_TEAM_ID = "new_team_id"; - @javax.annotation.Nullable private String newTeamId; - - /** - * A new role member will take in a new Team. **NOTE:** This parameter is used only if - * `new_team_id` is provided. - */ - public enum NewRoleEnum { - MEMBER(String.valueOf("Member")), - - DEVELOPER(String.valueOf("Developer")), - - TEAM_MANAGER(String.valueOf("Team Manager")), - - ADMIN(String.valueOf("Admin")); - - private String value; - - NewRoleEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static NewRoleEnum fromValue(String value) { - for (NewRoleEnum b : NewRoleEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_NEW_ROLE = "new_role"; - @javax.annotation.Nullable private NewRoleEnum newRole; - - public TeamRemoveMemberRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamRemoveMemberRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamRemoveMemberRequest.class); - } - - public static TeamRemoveMemberRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), TeamRemoveMemberRequest.class); - } - - public TeamRemoveMemberRequest accountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; - } - - /** - * **account_id** or **email_address** is required. If both are provided, the account id - * prevails. Account id to remove from your Team. - * - * @return accountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccountId() { - return accountId; - } - - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - } - - public TeamRemoveMemberRequest emailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * **account_id** or **email_address** is required. If both are provided, the account id - * prevails. Email address of the Account to remove from your Team. - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; - } - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - } - - public TeamRemoveMemberRequest newOwnerEmailAddress( - @javax.annotation.Nullable String newOwnerEmailAddress) { - this.newOwnerEmailAddress = newOwnerEmailAddress; - return this; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + @javax.annotation.Nullable + private String accountId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; + + public static final String JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS = "new_owner_email_address"; + @javax.annotation.Nullable + private String newOwnerEmailAddress; + + public static final String JSON_PROPERTY_NEW_TEAM_ID = "new_team_id"; + @javax.annotation.Nullable + private String newTeamId; + + /** + * A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided. + */ + public enum NewRoleEnum { + MEMBER(String.valueOf("Member")), + + DEVELOPER(String.valueOf("Developer")), + + TEAM_MANAGER(String.valueOf("Team Manager")), + + ADMIN(String.valueOf("Admin")); + + private String value; + + NewRoleEnum(String value) { + this.value = value; } - /** - * The email address of an Account on this Team to receive all documents, templates, and API - * apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, - * this data will remain with the removed Account. **NOTE:** Only available for Enterprise - * plans. - * - * @return newOwnerEmailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getNewOwnerEmailAddress() { - return newOwnerEmailAddress; + @JsonValue + public String getValue() { + return value; } - @JsonProperty(JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNewOwnerEmailAddress(@javax.annotation.Nullable String newOwnerEmailAddress) { - this.newOwnerEmailAddress = newOwnerEmailAddress; + @Override + public String toString() { + return String.valueOf(value); } - public TeamRemoveMemberRequest newTeamId(@javax.annotation.Nullable String newTeamId) { - this.newTeamId = newTeamId; - return this; + @JsonCreator + public static NewRoleEnum fromValue(String value) { + for (NewRoleEnum b : NewRoleEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - - /** - * Id of the new Team. - * - * @return newTeamId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NEW_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getNewTeamId() { - return newTeamId; + } + + public static final String JSON_PROPERTY_NEW_ROLE = "new_role"; + @javax.annotation.Nullable + private NewRoleEnum newRole; + + public TeamRemoveMemberRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamRemoveMemberRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamRemoveMemberRequest.class); + } + + static public TeamRemoveMemberRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamRemoveMemberRequest.class + ); + } + + public TeamRemoveMemberRequest accountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + return this; + } + + /** + * **account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team. + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + } + + + public TeamRemoveMemberRequest emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * **account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team. + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + public TeamRemoveMemberRequest newOwnerEmailAddress(@javax.annotation.Nullable String newOwnerEmailAddress) { + this.newOwnerEmailAddress = newOwnerEmailAddress; + return this; + } + + /** + * The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans. + * @return newOwnerEmailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNewOwnerEmailAddress() { + return newOwnerEmailAddress; + } + + + @JsonProperty(JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewOwnerEmailAddress(@javax.annotation.Nullable String newOwnerEmailAddress) { + this.newOwnerEmailAddress = newOwnerEmailAddress; + } + + + public TeamRemoveMemberRequest newTeamId(@javax.annotation.Nullable String newTeamId) { + this.newTeamId = newTeamId; + return this; + } + + /** + * Id of the new Team. + * @return newTeamId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEW_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNewTeamId() { + return newTeamId; + } + + + @JsonProperty(JSON_PROPERTY_NEW_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewTeamId(@javax.annotation.Nullable String newTeamId) { + this.newTeamId = newTeamId; + } + + + public TeamRemoveMemberRequest newRole(@javax.annotation.Nullable NewRoleEnum newRole) { + this.newRole = newRole; + return this; + } + + /** + * A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided. + * @return newRole + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEW_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public NewRoleEnum getNewRole() { + return newRole; + } + + + @JsonProperty(JSON_PROPERTY_NEW_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewRole(@javax.annotation.Nullable NewRoleEnum newRole) { + this.newRole = newRole; + } + + + /** + * Return true if this TeamRemoveMemberRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_NEW_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNewTeamId(@javax.annotation.Nullable String newTeamId) { - this.newTeamId = newTeamId; + if (o == null || getClass() != o.getClass()) { + return false; } + TeamRemoveMemberRequest teamRemoveMemberRequest = (TeamRemoveMemberRequest) o; + return Objects.equals(this.accountId, teamRemoveMemberRequest.accountId) && + Objects.equals(this.emailAddress, teamRemoveMemberRequest.emailAddress) && + Objects.equals(this.newOwnerEmailAddress, teamRemoveMemberRequest.newOwnerEmailAddress) && + Objects.equals(this.newTeamId, teamRemoveMemberRequest.newTeamId) && + Objects.equals(this.newRole, teamRemoveMemberRequest.newRole); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress, newOwnerEmailAddress, newTeamId, newRole); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamRemoveMemberRequest {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" newOwnerEmailAddress: ").append(toIndentedString(newOwnerEmailAddress)).append("\n"); + sb.append(" newTeamId: ").append(toIndentedString(newTeamId)).append("\n"); + sb.append(" newRole: ").append(toIndentedString(newRole)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } - public TeamRemoveMemberRequest newRole(@javax.annotation.Nullable NewRoleEnum newRole) { - this.newRole = newRole; - return this; + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - /** - * A new role member will take in a new Team. **NOTE:** This parameter is used only if - * `new_team_id` is provided. - * - * @return newRole - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NEW_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public NewRoleEnum getNewRole() { - return newRole; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } + if (newOwnerEmailAddress != null) { + if (isFileTypeOrListOfFiles(newOwnerEmailAddress)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_NEW_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNewRole(@javax.annotation.Nullable NewRoleEnum newRole) { - this.newRole = newRole; + if (newOwnerEmailAddress.getClass().equals(java.io.File.class) || + newOwnerEmailAddress.getClass().equals(Integer.class) || + newOwnerEmailAddress.getClass().equals(String.class) || + newOwnerEmailAddress.getClass().isEnum()) { + map.put("new_owner_email_address", newOwnerEmailAddress); + } else if (isListOfFile(newOwnerEmailAddress)) { + for(int i = 0; i< getListSize(newOwnerEmailAddress); i++) { + map.put("new_owner_email_address[" + i + "]", getFromList(newOwnerEmailAddress, i)); + } + } + else { + map.put("new_owner_email_address", JSON.getDefault().getMapper().writeValueAsString(newOwnerEmailAddress)); + } } + if (newTeamId != null) { + if (isFileTypeOrListOfFiles(newTeamId)) { + fileTypeFound = true; + } - /** Return true if this TeamRemoveMemberRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (newTeamId.getClass().equals(java.io.File.class) || + newTeamId.getClass().equals(Integer.class) || + newTeamId.getClass().equals(String.class) || + newTeamId.getClass().isEnum()) { + map.put("new_team_id", newTeamId); + } else if (isListOfFile(newTeamId)) { + for(int i = 0; i< getListSize(newTeamId); i++) { + map.put("new_team_id[" + i + "]", getFromList(newTeamId, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("new_team_id", JSON.getDefault().getMapper().writeValueAsString(newTeamId)); } - TeamRemoveMemberRequest teamRemoveMemberRequest = (TeamRemoveMemberRequest) o; - return Objects.equals(this.accountId, teamRemoveMemberRequest.accountId) - && Objects.equals(this.emailAddress, teamRemoveMemberRequest.emailAddress) - && Objects.equals( - this.newOwnerEmailAddress, teamRemoveMemberRequest.newOwnerEmailAddress) - && Objects.equals(this.newTeamId, teamRemoveMemberRequest.newTeamId) - && Objects.equals(this.newRole, teamRemoveMemberRequest.newRole); } + if (newRole != null) { + if (isFileTypeOrListOfFiles(newRole)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress, newOwnerEmailAddress, newTeamId, newRole); + if (newRole.getClass().equals(java.io.File.class) || + newRole.getClass().equals(Integer.class) || + newRole.getClass().equals(String.class) || + newRole.getClass().isEnum()) { + map.put("new_role", newRole); + } else if (isListOfFile(newRole)) { + for(int i = 0; i< getListSize(newRole); i++) { + map.put("new_role[" + i + "]", getFromList(newRole, i)); + } + } + else { + map.put("new_role", JSON.getDefault().getMapper().writeValueAsString(newRole)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamRemoveMemberRequest {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" newOwnerEmailAddress: ") - .append(toIndentedString(newOwnerEmailAddress)) - .append("\n"); - sb.append(" newTeamId: ").append(toIndentedString(newTeamId)).append("\n"); - sb.append(" newRole: ").append(toIndentedString(newRole)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } - - if (accountId.getClass().equals(java.io.File.class) - || accountId.getClass().equals(Integer.class) - || accountId.getClass().equals(String.class) - || accountId.getClass().isEnum()) { - map.put("account_id", accountId); - } else if (isListOfFile(accountId)) { - for (int i = 0; i < getListSize(accountId); i++) { - map.put("account_id[" + i + "]", getFromList(accountId, i)); - } - } else { - map.put( - "account_id", - JSON.getDefault().getMapper().writeValueAsString(accountId)); - } - } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - if (newOwnerEmailAddress != null) { - if (isFileTypeOrListOfFiles(newOwnerEmailAddress)) { - fileTypeFound = true; - } - - if (newOwnerEmailAddress.getClass().equals(java.io.File.class) - || newOwnerEmailAddress.getClass().equals(Integer.class) - || newOwnerEmailAddress.getClass().equals(String.class) - || newOwnerEmailAddress.getClass().isEnum()) { - map.put("new_owner_email_address", newOwnerEmailAddress); - } else if (isListOfFile(newOwnerEmailAddress)) { - for (int i = 0; i < getListSize(newOwnerEmailAddress); i++) { - map.put( - "new_owner_email_address[" + i + "]", - getFromList(newOwnerEmailAddress, i)); - } - } else { - map.put( - "new_owner_email_address", - JSON.getDefault().getMapper().writeValueAsString(newOwnerEmailAddress)); - } - } - if (newTeamId != null) { - if (isFileTypeOrListOfFiles(newTeamId)) { - fileTypeFound = true; - } - - if (newTeamId.getClass().equals(java.io.File.class) - || newTeamId.getClass().equals(Integer.class) - || newTeamId.getClass().equals(String.class) - || newTeamId.getClass().isEnum()) { - map.put("new_team_id", newTeamId); - } else if (isListOfFile(newTeamId)) { - for (int i = 0; i < getListSize(newTeamId); i++) { - map.put("new_team_id[" + i + "]", getFromList(newTeamId, i)); - } - } else { - map.put( - "new_team_id", - JSON.getDefault().getMapper().writeValueAsString(newTeamId)); - } - } - if (newRole != null) { - if (isFileTypeOrListOfFiles(newRole)) { - fileTypeFound = true; - } - - if (newRole.getClass().equals(java.io.File.class) - || newRole.getClass().equals(Integer.class) - || newRole.getClass().equals(String.class) - || newRole.getClass().isEnum()) { - map.put("new_role", newRole); - } else if (isListOfFile(newRole)) { - for (int i = 0; i < getListSize(newRole); i++) { - map.put("new_role[" + i + "]", getFromList(newRole, i)); - } - } else { - map.put("new_role", JSON.getDefault().getMapper().writeValueAsString(newRole)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamResponse.java index 6fcc0fd87..b86069da9 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamResponse.java @@ -10,330 +10,350 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.AccountResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** Contains information about your team and its members */ +import com.dropbox.sign.ApiException; +/** + * Contains information about your team and its members + */ @JsonPropertyOrder({ - TeamResponse.JSON_PROPERTY_NAME, - TeamResponse.JSON_PROPERTY_ACCOUNTS, - TeamResponse.JSON_PROPERTY_INVITED_ACCOUNTS, - TeamResponse.JSON_PROPERTY_INVITED_EMAILS + TeamResponse.JSON_PROPERTY_NAME, + TeamResponse.JSON_PROPERTY_ACCOUNTS, + TeamResponse.JSON_PROPERTY_INVITED_ACCOUNTS, + TeamResponse.JSON_PROPERTY_INVITED_EMAILS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TeamResponse { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; - @javax.annotation.Nullable private List accounts = null; - - public static final String JSON_PROPERTY_INVITED_ACCOUNTS = "invited_accounts"; - @javax.annotation.Nullable private List invitedAccounts = null; - - public static final String JSON_PROPERTY_INVITED_EMAILS = "invited_emails"; - @javax.annotation.Nullable private List invitedEmails = null; - - public TeamResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamResponse.class); + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; + @javax.annotation.Nullable + private List accounts = null; + + public static final String JSON_PROPERTY_INVITED_ACCOUNTS = "invited_accounts"; + @javax.annotation.Nullable + private List invitedAccounts = null; + + public static final String JSON_PROPERTY_INVITED_EMAILS = "invited_emails"; + @javax.annotation.Nullable + private List invitedEmails = null; + + public TeamResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamResponse.class); + } + + static public TeamResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamResponse.class + ); + } + + public TeamResponse name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of your Team + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public TeamResponse accounts(@javax.annotation.Nullable List accounts) { + this.accounts = accounts; + return this; + } + + public TeamResponse addAccountsItem(AccountResponse accountsItem) { + if (this.accounts == null) { + this.accounts = new ArrayList<>(); } - - public static TeamResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamResponse.class); - } - - public TeamResponse name(@javax.annotation.Nullable String name) { - this.name = name; - return this; + this.accounts.add(accountsItem); + return this; + } + + /** + * Get accounts + * @return accounts + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAccounts() { + return accounts; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccounts(@javax.annotation.Nullable List accounts) { + this.accounts = accounts; + } + + + public TeamResponse invitedAccounts(@javax.annotation.Nullable List invitedAccounts) { + this.invitedAccounts = invitedAccounts; + return this; + } + + public TeamResponse addInvitedAccountsItem(AccountResponse invitedAccountsItem) { + if (this.invitedAccounts == null) { + this.invitedAccounts = new ArrayList<>(); } - - /** - * The name of your Team - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; + this.invitedAccounts.add(invitedAccountsItem); + return this; + } + + /** + * A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. + * @return invitedAccounts + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INVITED_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getInvitedAccounts() { + return invitedAccounts; + } + + + @JsonProperty(JSON_PROPERTY_INVITED_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvitedAccounts(@javax.annotation.Nullable List invitedAccounts) { + this.invitedAccounts = invitedAccounts; + } + + + public TeamResponse invitedEmails(@javax.annotation.Nullable List invitedEmails) { + this.invitedEmails = invitedEmails; + return this; + } + + public TeamResponse addInvitedEmailsItem(String invitedEmailsItem) { + if (this.invitedEmails == null) { + this.invitedEmails = new ArrayList<>(); } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; + this.invitedEmails.add(invitedEmailsItem); + return this; + } + + /** + * A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. + * @return invitedEmails + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INVITED_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getInvitedEmails() { + return invitedEmails; + } + + + @JsonProperty(JSON_PROPERTY_INVITED_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvitedEmails(@javax.annotation.Nullable List invitedEmails) { + this.invitedEmails = invitedEmails; + } + + + /** + * Return true if this TeamResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public TeamResponse accounts(@javax.annotation.Nullable List accounts) { - this.accounts = accounts; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - public TeamResponse addAccountsItem(AccountResponse accountsItem) { - if (this.accounts == null) { - this.accounts = new ArrayList<>(); + TeamResponse teamResponse = (TeamResponse) o; + return Objects.equals(this.name, teamResponse.name) && + Objects.equals(this.accounts, teamResponse.accounts) && + Objects.equals(this.invitedAccounts, teamResponse.invitedAccounts) && + Objects.equals(this.invitedEmails, teamResponse.invitedEmails); + } + + @Override + public int hashCode() { + return Objects.hash(name, accounts, invitedAccounts, invitedEmails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); + sb.append(" invitedAccounts: ").append(toIndentedString(invitedAccounts)).append("\n"); + sb.append(" invitedEmails: ").append(toIndentedString(invitedEmails)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; } - this.accounts.add(accountsItem); - return this; - } - /** - * Get accounts - * - * @return accounts - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAccounts() { - return accounts; - } - - @JsonProperty(JSON_PROPERTY_ACCOUNTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccounts(@javax.annotation.Nullable List accounts) { - this.accounts = accounts; - } - - public TeamResponse invitedAccounts( - @javax.annotation.Nullable List invitedAccounts) { - this.invitedAccounts = invitedAccounts; - return this; - } - - public TeamResponse addInvitedAccountsItem(AccountResponse invitedAccountsItem) { - if (this.invitedAccounts == null) { - this.invitedAccounts = new ArrayList<>(); + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } } - this.invitedAccounts.add(invitedAccountsItem); - return this; - } - - /** - * A list of all Accounts that have an outstanding invitation to join your Team. Note that this - * response is a subset of the response parameters found in `GET /account`. - * - * @return invitedAccounts - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INVITED_ACCOUNTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getInvitedAccounts() { - return invitedAccounts; - } - - @JsonProperty(JSON_PROPERTY_INVITED_ACCOUNTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInvitedAccounts( - @javax.annotation.Nullable List invitedAccounts) { - this.invitedAccounts = invitedAccounts; - } - - public TeamResponse invitedEmails(@javax.annotation.Nullable List invitedEmails) { - this.invitedEmails = invitedEmails; - return this; - } - - public TeamResponse addInvitedEmailsItem(String invitedEmailsItem) { - if (this.invitedEmails == null) { - this.invitedEmails = new ArrayList<>(); + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); } - this.invitedEmails.add(invitedEmailsItem); - return this; - } - - /** - * A list of email addresses that have an outstanding invitation to join your Team and do not - * yet have a Dropbox Sign account. - * - * @return invitedEmails - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INVITED_EMAILS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getInvitedEmails() { - return invitedEmails; } + if (accounts != null) { + if (isFileTypeOrListOfFiles(accounts)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_INVITED_EMAILS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInvitedEmails(@javax.annotation.Nullable List invitedEmails) { - this.invitedEmails = invitedEmails; + if (accounts.getClass().equals(java.io.File.class) || + accounts.getClass().equals(Integer.class) || + accounts.getClass().equals(String.class) || + accounts.getClass().isEnum()) { + map.put("accounts", accounts); + } else if (isListOfFile(accounts)) { + for(int i = 0; i< getListSize(accounts); i++) { + map.put("accounts[" + i + "]", getFromList(accounts, i)); + } + } + else { + map.put("accounts", JSON.getDefault().getMapper().writeValueAsString(accounts)); + } } + if (invitedAccounts != null) { + if (isFileTypeOrListOfFiles(invitedAccounts)) { + fileTypeFound = true; + } - /** Return true if this TeamResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (invitedAccounts.getClass().equals(java.io.File.class) || + invitedAccounts.getClass().equals(Integer.class) || + invitedAccounts.getClass().equals(String.class) || + invitedAccounts.getClass().isEnum()) { + map.put("invited_accounts", invitedAccounts); + } else if (isListOfFile(invitedAccounts)) { + for(int i = 0; i< getListSize(invitedAccounts); i++) { + map.put("invited_accounts[" + i + "]", getFromList(invitedAccounts, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("invited_accounts", JSON.getDefault().getMapper().writeValueAsString(invitedAccounts)); } - TeamResponse teamResponse = (TeamResponse) o; - return Objects.equals(this.name, teamResponse.name) - && Objects.equals(this.accounts, teamResponse.accounts) - && Objects.equals(this.invitedAccounts, teamResponse.invitedAccounts) - && Objects.equals(this.invitedEmails, teamResponse.invitedEmails); } + if (invitedEmails != null) { + if (isFileTypeOrListOfFiles(invitedEmails)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(name, accounts, invitedAccounts, invitedEmails); + if (invitedEmails.getClass().equals(java.io.File.class) || + invitedEmails.getClass().equals(Integer.class) || + invitedEmails.getClass().equals(String.class) || + invitedEmails.getClass().isEnum()) { + map.put("invited_emails", invitedEmails); + } else if (isListOfFile(invitedEmails)) { + for(int i = 0; i< getListSize(invitedEmails); i++) { + map.put("invited_emails[" + i + "]", getFromList(invitedEmails, i)); + } + } + else { + map.put("invited_emails", JSON.getDefault().getMapper().writeValueAsString(invitedEmails)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamResponse {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); - sb.append(" invitedAccounts: ").append(toIndentedString(invitedAccounts)).append("\n"); - sb.append(" invitedEmails: ").append(toIndentedString(invitedEmails)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (accounts != null) { - if (isFileTypeOrListOfFiles(accounts)) { - fileTypeFound = true; - } - - if (accounts.getClass().equals(java.io.File.class) - || accounts.getClass().equals(Integer.class) - || accounts.getClass().equals(String.class) - || accounts.getClass().isEnum()) { - map.put("accounts", accounts); - } else if (isListOfFile(accounts)) { - for (int i = 0; i < getListSize(accounts); i++) { - map.put("accounts[" + i + "]", getFromList(accounts, i)); - } - } else { - map.put("accounts", JSON.getDefault().getMapper().writeValueAsString(accounts)); - } - } - if (invitedAccounts != null) { - if (isFileTypeOrListOfFiles(invitedAccounts)) { - fileTypeFound = true; - } - - if (invitedAccounts.getClass().equals(java.io.File.class) - || invitedAccounts.getClass().equals(Integer.class) - || invitedAccounts.getClass().equals(String.class) - || invitedAccounts.getClass().isEnum()) { - map.put("invited_accounts", invitedAccounts); - } else if (isListOfFile(invitedAccounts)) { - for (int i = 0; i < getListSize(invitedAccounts); i++) { - map.put("invited_accounts[" + i + "]", getFromList(invitedAccounts, i)); - } - } else { - map.put( - "invited_accounts", - JSON.getDefault().getMapper().writeValueAsString(invitedAccounts)); - } - } - if (invitedEmails != null) { - if (isFileTypeOrListOfFiles(invitedEmails)) { - fileTypeFound = true; - } - - if (invitedEmails.getClass().equals(java.io.File.class) - || invitedEmails.getClass().equals(Integer.class) - || invitedEmails.getClass().equals(String.class) - || invitedEmails.getClass().isEnum()) { - map.put("invited_emails", invitedEmails); - } else if (isListOfFile(invitedEmails)) { - for (int i = 0; i < getListSize(invitedEmails); i++) { - map.put("invited_emails[" + i + "]", getFromList(invitedEmails, i)); - } - } else { - map.put( - "invited_emails", - JSON.getDefault().getMapper().writeValueAsString(invitedEmails)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java index c0570de58..b9a21d326 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java @@ -10,275 +10,293 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.ListInfoResponse; +import com.dropbox.sign.model.SubTeamResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** TeamSubTeamsResponse */ +import com.dropbox.sign.ApiException; +/** + * TeamSubTeamsResponse + */ @JsonPropertyOrder({ - TeamSubTeamsResponse.JSON_PROPERTY_SUB_TEAMS, - TeamSubTeamsResponse.JSON_PROPERTY_LIST_INFO, - TeamSubTeamsResponse.JSON_PROPERTY_WARNINGS + TeamSubTeamsResponse.JSON_PROPERTY_SUB_TEAMS, + TeamSubTeamsResponse.JSON_PROPERTY_LIST_INFO, + TeamSubTeamsResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TeamSubTeamsResponse { - public static final String JSON_PROPERTY_SUB_TEAMS = "sub_teams"; - @javax.annotation.Nonnull private List subTeams = new ArrayList<>(); - - public static final String JSON_PROPERTY_LIST_INFO = "list_info"; - @javax.annotation.Nonnull private ListInfoResponse listInfo; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public TeamSubTeamsResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamSubTeamsResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamSubTeamsResponse.class); - } - - public static TeamSubTeamsResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamSubTeamsResponse.class); + public static final String JSON_PROPERTY_SUB_TEAMS = "sub_teams"; + @javax.annotation.Nonnull + private List subTeams = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + @javax.annotation.Nonnull + private ListInfoResponse listInfo; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public TeamSubTeamsResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamSubTeamsResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamSubTeamsResponse.class); + } + + static public TeamSubTeamsResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamSubTeamsResponse.class + ); + } + + public TeamSubTeamsResponse subTeams(@javax.annotation.Nonnull List subTeams) { + this.subTeams = subTeams; + return this; + } + + public TeamSubTeamsResponse addSubTeamsItem(SubTeamResponse subTeamsItem) { + if (this.subTeams == null) { + this.subTeams = new ArrayList<>(); } - - public TeamSubTeamsResponse subTeams(@javax.annotation.Nonnull List subTeams) { - this.subTeams = subTeams; - return this; - } - - public TeamSubTeamsResponse addSubTeamsItem(SubTeamResponse subTeamsItem) { - if (this.subTeams == null) { - this.subTeams = new ArrayList<>(); - } - this.subTeams.add(subTeamsItem); - return this; + this.subTeams.add(subTeamsItem); + return this; + } + + /** + * Contains a list with sub teams. + * @return subTeams + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SUB_TEAMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSubTeams() { + return subTeams; + } + + + @JsonProperty(JSON_PROPERTY_SUB_TEAMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSubTeams(@javax.annotation.Nonnull List subTeams) { + this.subTeams = subTeams; + } + + + public TeamSubTeamsResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; + } + + /** + * Get listInfo + * @return listInfo + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ListInfoResponse getListInfo() { + return listInfo; + } + + + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + } + + + public TeamSubTeamsResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TeamSubTeamsResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } - - /** - * Contains a list with sub teams. - * - * @return subTeams - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getSubTeams() { - return subTeams; - } - - @JsonProperty(JSON_PROPERTY_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSubTeams(@javax.annotation.Nonnull List subTeams) { - this.subTeams = subTeams; + this.warnings.add(warningsItem); + return this; + } + + /** + * Get warnings + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this TeamSubTeamsResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public TeamSubTeamsResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - /** - * Get listInfo - * - * @return listInfo - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ListInfoResponse getListInfo() { - return listInfo; - } - - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - } - - public TeamSubTeamsResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public TeamSubTeamsResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + TeamSubTeamsResponse teamSubTeamsResponse = (TeamSubTeamsResponse) o; + return Objects.equals(this.subTeams, teamSubTeamsResponse.subTeams) && + Objects.equals(this.listInfo, teamSubTeamsResponse.listInfo) && + Objects.equals(this.warnings, teamSubTeamsResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(subTeams, listInfo, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamSubTeamsResponse {\n"); + sb.append(" subTeams: ").append(toIndentedString(subTeams)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (subTeams != null) { + if (isFileTypeOrListOfFiles(subTeams)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * Get warnings - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; + if (subTeams.getClass().equals(java.io.File.class) || + subTeams.getClass().equals(Integer.class) || + subTeams.getClass().equals(String.class) || + subTeams.getClass().isEnum()) { + map.put("sub_teams", subTeams); + } else if (isListOfFile(subTeams)) { + for(int i = 0; i< getListSize(subTeams); i++) { + map.put("sub_teams[" + i + "]", getFromList(subTeams, i)); + } + } + else { + map.put("sub_teams", JSON.getDefault().getMapper().writeValueAsString(subTeams)); + } } + if (listInfo != null) { + if (isFileTypeOrListOfFiles(listInfo)) { + fileTypeFound = true; + } - /** Return true if this TeamSubTeamsResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (listInfo.getClass().equals(java.io.File.class) || + listInfo.getClass().equals(Integer.class) || + listInfo.getClass().equals(String.class) || + listInfo.getClass().isEnum()) { + map.put("list_info", listInfo); + } else if (isListOfFile(listInfo)) { + for(int i = 0; i< getListSize(listInfo); i++) { + map.put("list_info[" + i + "]", getFromList(listInfo, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("list_info", JSON.getDefault().getMapper().writeValueAsString(listInfo)); } - TeamSubTeamsResponse teamSubTeamsResponse = (TeamSubTeamsResponse) o; - return Objects.equals(this.subTeams, teamSubTeamsResponse.subTeams) - && Objects.equals(this.listInfo, teamSubTeamsResponse.listInfo) - && Objects.equals(this.warnings, teamSubTeamsResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(subTeams, listInfo, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamSubTeamsResponse {\n"); - sb.append(" subTeams: ").append(toIndentedString(subTeams)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (subTeams != null) { - if (isFileTypeOrListOfFiles(subTeams)) { - fileTypeFound = true; - } - - if (subTeams.getClass().equals(java.io.File.class) - || subTeams.getClass().equals(Integer.class) - || subTeams.getClass().equals(String.class) - || subTeams.getClass().isEnum()) { - map.put("sub_teams", subTeams); - } else if (isListOfFile(subTeams)) { - for (int i = 0; i < getListSize(subTeams); i++) { - map.put("sub_teams[" + i + "]", getFromList(subTeams, i)); - } - } else { - map.put( - "sub_teams", - JSON.getDefault().getMapper().writeValueAsString(subTeams)); - } - } - if (listInfo != null) { - if (isFileTypeOrListOfFiles(listInfo)) { - fileTypeFound = true; - } - - if (listInfo.getClass().equals(java.io.File.class) - || listInfo.getClass().equals(Integer.class) - || listInfo.getClass().equals(String.class) - || listInfo.getClass().isEnum()) { - map.put("list_info", listInfo); - } else if (isListOfFile(listInfo)) { - for (int i = 0; i < getListSize(listInfo); i++) { - map.put("list_info[" + i + "]", getFromList(listInfo, i)); - } - } else { - map.put( - "list_info", - JSON.getDefault().getMapper().writeValueAsString(listInfo)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java index 91242a042..4022b16f7 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java @@ -10,156 +10,170 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TeamUpdateRequest */ -@JsonPropertyOrder({TeamUpdateRequest.JSON_PROPERTY_NAME}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class TeamUpdateRequest { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public TeamUpdateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TeamUpdateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamUpdateRequest.class); - } - public static TeamUpdateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TeamUpdateRequest.class); - } - - public TeamUpdateRequest name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of your Team. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; +import com.dropbox.sign.ApiException; +/** + * TeamUpdateRequest + */ +@JsonPropertyOrder({ + TeamUpdateRequest.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class TeamUpdateRequest { + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public TeamUpdateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TeamUpdateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamUpdateRequest.class); + } + + static public TeamUpdateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TeamUpdateRequest.class + ); + } + + public TeamUpdateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of your Team. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + /** + * Return true if this TeamUpdateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; + if (o == null || getClass() != o.getClass()) { + return false; } + TeamUpdateRequest teamUpdateRequest = (TeamUpdateRequest) o; + return Objects.equals(this.name, teamUpdateRequest.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamUpdateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** Return true if this TeamUpdateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); } - TeamUpdateRequest teamUpdateRequest = (TeamUpdateRequest) o; - return Objects.equals(this.name, teamUpdateRequest.name); } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamUpdateRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java index ea66fbbd0..2148d6e99 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java @@ -10,261 +10,272 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TemplateAddUserRequest */ + +import com.dropbox.sign.ApiException; +/** + * TemplateAddUserRequest + */ @JsonPropertyOrder({ - TemplateAddUserRequest.JSON_PROPERTY_ACCOUNT_ID, - TemplateAddUserRequest.JSON_PROPERTY_EMAIL_ADDRESS, - TemplateAddUserRequest.JSON_PROPERTY_SKIP_NOTIFICATION + TemplateAddUserRequest.JSON_PROPERTY_ACCOUNT_ID, + TemplateAddUserRequest.JSON_PROPERTY_EMAIL_ADDRESS, + TemplateAddUserRequest.JSON_PROPERTY_SKIP_NOTIFICATION }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateAddUserRequest { - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - @javax.annotation.Nullable private String accountId; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + @javax.annotation.Nullable + private String accountId; - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; - public static final String JSON_PROPERTY_SKIP_NOTIFICATION = "skip_notification"; - @javax.annotation.Nullable private Boolean skipNotification = false; + public static final String JSON_PROPERTY_SKIP_NOTIFICATION = "skip_notification"; + @javax.annotation.Nullable + private Boolean skipNotification = false; - public TemplateAddUserRequest() {} + public TemplateAddUserRequest() { + } - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateAddUserRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateAddUserRequest.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateAddUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateAddUserRequest.class); + } - public static TemplateAddUserRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), TemplateAddUserRequest.class); - } + static public TemplateAddUserRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateAddUserRequest.class + ); + } - public TemplateAddUserRequest accountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; - } + public TemplateAddUserRequest accountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + return this; + } - /** - * The id of the Account to give access to the Template. **NOTE:** The account id prevails if - * email address is also provided. - * - * @return accountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccountId() { - return accountId; - } + /** + * The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided. + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - } + public String getAccountId() { + return accountId; + } - public TemplateAddUserRequest emailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - /** - * The email address of the Account to give access to the Template. **NOTE:** The account id - * prevails if it is also provided. - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; - } + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + } - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - } - public TemplateAddUserRequest skipNotification( - @javax.annotation.Nullable Boolean skipNotification) { - this.skipNotification = skipNotification; - return this; - } + public TemplateAddUserRequest emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } - /** - * If set to `true`, the user does not receive an email notification when a template - * has been shared with them. Defaults to `false`. - * - * @return skipNotification - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SKIP_NOTIFICATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getSkipNotification() { - return skipNotification; - } + /** + * The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided. + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + public TemplateAddUserRequest skipNotification(@javax.annotation.Nullable Boolean skipNotification) { + this.skipNotification = skipNotification; + return this; + } + + /** + * If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. + * @return skipNotification + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SKIP_NOTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_SKIP_NOTIFICATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSkipNotification(@javax.annotation.Nullable Boolean skipNotification) { - this.skipNotification = skipNotification; + public Boolean getSkipNotification() { + return skipNotification; + } + + + @JsonProperty(JSON_PROPERTY_SKIP_NOTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipNotification(@javax.annotation.Nullable Boolean skipNotification) { + this.skipNotification = skipNotification; + } + + + /** + * Return true if this TemplateAddUserRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateAddUserRequest templateAddUserRequest = (TemplateAddUserRequest) o; + return Objects.equals(this.accountId, templateAddUserRequest.accountId) && + Objects.equals(this.emailAddress, templateAddUserRequest.emailAddress) && + Objects.equals(this.skipNotification, templateAddUserRequest.skipNotification); + } - /** Return true if this TemplateAddUserRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress, skipNotification); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateAddUserRequest {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" skipNotification: ").append(toIndentedString(skipNotification)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; } - TemplateAddUserRequest templateAddUserRequest = (TemplateAddUserRequest) o; - return Objects.equals(this.accountId, templateAddUserRequest.accountId) - && Objects.equals(this.emailAddress, templateAddUserRequest.emailAddress) - && Objects.equals(this.skipNotification, templateAddUserRequest.skipNotification); - } - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress, skipNotification); + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateAddUserRequest {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" skipNotification: ").append(toIndentedString(skipNotification)).append("\n"); - sb.append("}"); - return sb.toString(); + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } + if (skipNotification != null) { + if (isFileTypeOrListOfFiles(skipNotification)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } - - if (accountId.getClass().equals(java.io.File.class) - || accountId.getClass().equals(Integer.class) - || accountId.getClass().equals(String.class) - || accountId.getClass().isEnum()) { - map.put("account_id", accountId); - } else if (isListOfFile(accountId)) { - for (int i = 0; i < getListSize(accountId); i++) { - map.put("account_id[" + i + "]", getFromList(accountId, i)); - } - } else { - map.put( - "account_id", - JSON.getDefault().getMapper().writeValueAsString(accountId)); - } - } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } + if (skipNotification.getClass().equals(java.io.File.class) || + skipNotification.getClass().equals(Integer.class) || + skipNotification.getClass().equals(String.class) || + skipNotification.getClass().isEnum()) { + map.put("skip_notification", skipNotification); + } else if (isListOfFile(skipNotification)) { + for(int i = 0; i< getListSize(skipNotification); i++) { + map.put("skip_notification[" + i + "]", getFromList(skipNotification, i)); } - if (skipNotification != null) { - if (isFileTypeOrListOfFiles(skipNotification)) { - fileTypeFound = true; - } - - if (skipNotification.getClass().equals(java.io.File.class) - || skipNotification.getClass().equals(Integer.class) - || skipNotification.getClass().equals(String.class) - || skipNotification.getClass().isEnum()) { - map.put("skip_notification", skipNotification); - } else if (isListOfFile(skipNotification)) { - for (int i = 0; i < getListSize(skipNotification); i++) { - map.put("skip_notification[" + i + "]", getFromList(skipNotification, i)); - } - } else { - map.put( - "skip_notification", - JSON.getDefault().getMapper().writeValueAsString(skipNotification)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("skip_notification", JSON.getDefault().getMapper().writeValueAsString(skipNotification)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java index a57c84d16..46ad50a38 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java @@ -10,1563 +10,1538 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubAttachment; +import com.dropbox.sign.model.SubEditorOptions; +import com.dropbox.sign.model.SubFieldOptions; +import com.dropbox.sign.model.SubFormFieldGroup; +import com.dropbox.sign.model.SubFormFieldRule; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.model.SubMergeField; +import com.dropbox.sign.model.SubTemplateRole; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** TemplateCreateEmbeddedDraftRequest */ +import com.dropbox.sign.ApiException; +/** + * TemplateCreateEmbeddedDraftRequest + */ @JsonPropertyOrder({ - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_CLIENT_ID, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FILES, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FILE_URLS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ALLOW_CCS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ALLOW_REASSIGN, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ATTACHMENTS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_CC_ROLES, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_EDITOR_OPTIONS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FIELD_OPTIONS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORCE_SIGNER_ROLES, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORM_FIELD_RULES, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_MERGE_FIELDS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_MESSAGE, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_METADATA, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SHOW_PREVIEW, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SIGNER_ROLES, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SKIP_ME_NOW, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SUBJECT, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_TEST_MODE, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_TITLE, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_CLIENT_ID, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FILES, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FILE_URLS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ALLOW_CCS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ALLOW_REASSIGN, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ATTACHMENTS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_CC_ROLES, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_EDITOR_OPTIONS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FIELD_OPTIONS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORCE_SIGNER_ROLES, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORM_FIELD_RULES, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_MERGE_FIELDS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_MESSAGE, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_METADATA, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SHOW_PREVIEW, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SIGNER_ROLES, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SKIP_ME_NOW, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SUBJECT, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_TEST_MODE, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_TITLE, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateCreateEmbeddedDraftRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nonnull private String clientId; - - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; - - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; - - public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; - @javax.annotation.Nullable private Boolean allowCcs = true; - - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - @javax.annotation.Nullable private Boolean allowReassign = false; - - public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; - @javax.annotation.Nullable private Boolean allowFormView = false; - - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - @javax.annotation.Nullable private List attachments = null; - - public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - @javax.annotation.Nullable private List ccRoles = null; - - public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; - @javax.annotation.Nullable private SubEditorOptions editorOptions; - - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - @javax.annotation.Nullable private SubFieldOptions fieldOptions; - - public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; - @javax.annotation.Nullable private Boolean forceSignerRoles = false; - - public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; - @javax.annotation.Nullable private Boolean forceSubjectMessage = false; - - public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - @javax.annotation.Nullable private List formFieldGroups = null; - - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - @javax.annotation.Nullable private List formFieldRules = null; - - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - - @javax.annotation.Nullable private List formFieldsPerDocument = null; - - public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; - @javax.annotation.Nullable private List mergeFields = null; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; - @javax.annotation.Nullable private Boolean showPreview = false; - - public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; - @javax.annotation.Nullable private Boolean showProgressStepper = true; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nonnull + private String clientId; - public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; - @javax.annotation.Nullable private List signerRoles = null; + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; - public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; - @javax.annotation.Nullable private Boolean skipMeNow = false; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; - @javax.annotation.Nullable private Boolean usePreexistingFields = false; - - public TemplateCreateEmbeddedDraftRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateCreateEmbeddedDraftRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateCreateEmbeddedDraftRequest.class); + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; + @javax.annotation.Nullable + private Boolean allowCcs = true; + + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + @javax.annotation.Nullable + private Boolean allowReassign = false; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @javax.annotation.Nullable + private Boolean allowFormView = false; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + @javax.annotation.Nullable + private List attachments = null; + + public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; + @javax.annotation.Nullable + private List ccRoles = null; + + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; + @javax.annotation.Nullable + private SubEditorOptions editorOptions; + + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + @javax.annotation.Nullable + private SubFieldOptions fieldOptions; + + public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; + @javax.annotation.Nullable + private Boolean forceSignerRoles = false; + + public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; + @javax.annotation.Nullable + private Boolean forceSubjectMessage = false; + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + @javax.annotation.Nullable + private List formFieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + @javax.annotation.Nullable + private List formFieldRules = null; + + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + @javax.annotation.Nullable + private List formFieldsPerDocument = null; + + public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; + @javax.annotation.Nullable + private List mergeFields = null; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; + @javax.annotation.Nullable + private Boolean showPreview = false; + + public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; + @javax.annotation.Nullable + private Boolean showProgressStepper = true; + + public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; + @javax.annotation.Nullable + private List signerRoles = null; + + public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; + @javax.annotation.Nullable + private Boolean skipMeNow = false; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; + @javax.annotation.Nullable + private Boolean usePreexistingFields = false; + + public TemplateCreateEmbeddedDraftRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateCreateEmbeddedDraftRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateCreateEmbeddedDraftRequest.class); + } + + static public TemplateCreateEmbeddedDraftRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateCreateEmbeddedDraftRequest.class + ); + } + + public TemplateCreateEmbeddedDraftRequest clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public TemplateCreateEmbeddedDraftRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public TemplateCreateEmbeddedDraftRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public TemplateCreateEmbeddedDraftRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public TemplateCreateEmbeddedDraftRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public TemplateCreateEmbeddedDraftRequest allowCcs(@javax.annotation.Nullable Boolean allowCcs) { + this.allowCcs = allowCcs; + return this; + } + + /** + * This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. + * @return allowCcs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowCcs() { + return allowCcs; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowCcs(@javax.annotation.Nullable Boolean allowCcs) { + this.allowCcs = allowCcs; + } + + + public TemplateCreateEmbeddedDraftRequest allowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } + + /** + * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + * @return allowReassign + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowReassign() { + return allowReassign; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + } + + + public TemplateCreateEmbeddedDraftRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. + * @return allowFormView + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + public TemplateCreateEmbeddedDraftRequest attachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + return this; + } + + public TemplateCreateEmbeddedDraftRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * A list describing the attachments + * @return attachments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + } + + + public TemplateCreateEmbeddedDraftRequest ccRoles(@javax.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + return this; + } + + public TemplateCreateEmbeddedDraftRequest addCcRolesItem(String ccRolesItem) { + if (this.ccRoles == null) { + this.ccRoles = new ArrayList<>(); } + this.ccRoles.add(ccRolesItem); + return this; + } + + /** + * The CC roles that must be assigned when using the template to send a signature request + * @return ccRoles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcRoles() { + return ccRoles; + } + + + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcRoles(@javax.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + } + - public static TemplateCreateEmbeddedDraftRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateCreateEmbeddedDraftRequest.class); - } + public TemplateCreateEmbeddedDraftRequest editorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + return this; + } + + /** + * Get editorOptions + * @return editorOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubEditorOptions getEditorOptions() { + return editorOptions; + } + + + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + } + + + public TemplateCreateEmbeddedDraftRequest fieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * @return fieldOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } + + + public TemplateCreateEmbeddedDraftRequest forceSignerRoles(@javax.annotation.Nullable Boolean forceSignerRoles) { + this.forceSignerRoles = forceSignerRoles; + return this; + } + + /** + * Provide users the ability to review/edit the template signer roles. + * @return forceSignerRoles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getForceSignerRoles() { + return forceSignerRoles; + } + + + @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSignerRoles(@javax.annotation.Nullable Boolean forceSignerRoles) { + this.forceSignerRoles = forceSignerRoles; + } + + + public TemplateCreateEmbeddedDraftRequest forceSubjectMessage(@javax.annotation.Nullable Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + return this; + } + + /** + * Provide users the ability to review/edit the template subject and message. + * @return forceSubjectMessage + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getForceSubjectMessage() { + return forceSubjectMessage; + } - public TemplateCreateEmbeddedDraftRequest clientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - return this; - } - /** - * Client id of the app you're using to create this draft. Used to apply the branding and - * callback url defined for the app. - * - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientId() { - return clientId; - } + @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSubjectMessage(@javax.annotation.Nullable Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + } + + + public TemplateCreateEmbeddedDraftRequest formFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } + + public TemplateCreateEmbeddedDraftRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); + } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - } + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * @return formFieldGroups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldGroups() { + return formFieldGroups; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + + public TemplateCreateEmbeddedDraftRequest formFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } + + public TemplateCreateEmbeddedDraftRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); + } + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * @return formFieldRules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldRules() { + return formFieldRules; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + } - public TemplateCreateEmbeddedDraftRequest files(@javax.annotation.Nullable List files) { - this.files = files; - return this; - } - public TemplateCreateEmbeddedDraftRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } + public TemplateCreateEmbeddedDraftRequest formFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public TemplateCreateEmbeddedDraftRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; + } + + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * @return formFieldsPerDocument + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } - /** - * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + + public TemplateCreateEmbeddedDraftRequest mergeFields(@javax.annotation.Nullable List mergeFields) { + this.mergeFields = mergeFields; + return this; + } + + public TemplateCreateEmbeddedDraftRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { + if (this.mergeFields == null) { + this.mergeFields = new ArrayList<>(); + } + this.mergeFields.add(mergeFieldsItem); + return this; + } + + /** + * Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. + * @return mergeFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TemplateCreateEmbeddedDraftRequest fileUrls( - @javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; + public List getMergeFields() { + return mergeFields; + } + + + @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMergeFields(@javax.annotation.Nullable List mergeFields) { + this.mergeFields = mergeFields; + } + + + public TemplateCreateEmbeddedDraftRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The default template email message. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public TemplateCreateEmbeddedDraftRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public TemplateCreateEmbeddedDraftRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public TemplateCreateEmbeddedDraftRequest showPreview(@javax.annotation.Nullable Boolean showPreview) { + this.showPreview = showPreview; + return this; + } + + /** + * This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. + * @return showPreview + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getShowPreview() { + return showPreview; + } + + + @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowPreview(@javax.annotation.Nullable Boolean showPreview) { + this.showPreview = showPreview; + } + + + public TemplateCreateEmbeddedDraftRequest showProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + return this; + } + + /** + * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. + * @return showProgressStepper + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getShowProgressStepper() { + return showProgressStepper; + } + + + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + } + + + public TemplateCreateEmbeddedDraftRequest signerRoles(@javax.annotation.Nullable List signerRoles) { + this.signerRoles = signerRoles; + return this; + } + + public TemplateCreateEmbeddedDraftRequest addSignerRolesItem(SubTemplateRole signerRolesItem) { + if (this.signerRoles == null) { + this.signerRoles = new ArrayList<>(); } + this.signerRoles.add(signerRolesItem); + return this; + } + + /** + * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. + * @return signerRoles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSignerRoles() { + return signerRoles; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerRoles(@javax.annotation.Nullable List signerRoles) { + this.signerRoles = signerRoles; + } + + + public TemplateCreateEmbeddedDraftRequest skipMeNow(@javax.annotation.Nullable Boolean skipMeNow) { + this.skipMeNow = skipMeNow; + return this; + } - public TemplateCreateEmbeddedDraftRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + /** + * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. + * @return skipMeNow + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSkipMeNow() { + return skipMeNow; + } + + + @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipMeNow(@javax.annotation.Nullable Boolean skipMeNow) { + this.skipMeNow = skipMeNow; + } + + + public TemplateCreateEmbeddedDraftRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The template title (alias). + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public TemplateCreateEmbeddedDraftRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public TemplateCreateEmbeddedDraftRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public TemplateCreateEmbeddedDraftRequest usePreexistingFields(@javax.annotation.Nullable Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + return this; + } + + /** + * Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). + * @return usePreexistingFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUsePreexistingFields() { + return usePreexistingFields; + } + + + @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsePreexistingFields(@javax.annotation.Nullable Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + } + + + /** + * Return true if this TemplateCreateEmbeddedDraftRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest = (TemplateCreateEmbeddedDraftRequest) o; + return Objects.equals(this.clientId, templateCreateEmbeddedDraftRequest.clientId) && + Objects.equals(this.files, templateCreateEmbeddedDraftRequest.files) && + Objects.equals(this.fileUrls, templateCreateEmbeddedDraftRequest.fileUrls) && + Objects.equals(this.allowCcs, templateCreateEmbeddedDraftRequest.allowCcs) && + Objects.equals(this.allowReassign, templateCreateEmbeddedDraftRequest.allowReassign) && + Objects.equals(this.allowFormView, templateCreateEmbeddedDraftRequest.allowFormView) && + Objects.equals(this.attachments, templateCreateEmbeddedDraftRequest.attachments) && + Objects.equals(this.ccRoles, templateCreateEmbeddedDraftRequest.ccRoles) && + Objects.equals(this.editorOptions, templateCreateEmbeddedDraftRequest.editorOptions) && + Objects.equals(this.fieldOptions, templateCreateEmbeddedDraftRequest.fieldOptions) && + Objects.equals(this.forceSignerRoles, templateCreateEmbeddedDraftRequest.forceSignerRoles) && + Objects.equals(this.forceSubjectMessage, templateCreateEmbeddedDraftRequest.forceSubjectMessage) && + Objects.equals(this.formFieldGroups, templateCreateEmbeddedDraftRequest.formFieldGroups) && + Objects.equals(this.formFieldRules, templateCreateEmbeddedDraftRequest.formFieldRules) && + Objects.equals(this.formFieldsPerDocument, templateCreateEmbeddedDraftRequest.formFieldsPerDocument) && + Objects.equals(this.mergeFields, templateCreateEmbeddedDraftRequest.mergeFields) && + Objects.equals(this.message, templateCreateEmbeddedDraftRequest.message) && + Objects.equals(this.metadata, templateCreateEmbeddedDraftRequest.metadata) && + Objects.equals(this.showPreview, templateCreateEmbeddedDraftRequest.showPreview) && + Objects.equals(this.showProgressStepper, templateCreateEmbeddedDraftRequest.showProgressStepper) && + Objects.equals(this.signerRoles, templateCreateEmbeddedDraftRequest.signerRoles) && + Objects.equals(this.skipMeNow, templateCreateEmbeddedDraftRequest.skipMeNow) && + Objects.equals(this.subject, templateCreateEmbeddedDraftRequest.subject) && + Objects.equals(this.testMode, templateCreateEmbeddedDraftRequest.testMode) && + Objects.equals(this.title, templateCreateEmbeddedDraftRequest.title) && + Objects.equals(this.usePreexistingFields, templateCreateEmbeddedDraftRequest.usePreexistingFields); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, files, fileUrls, allowCcs, allowReassign, allowFormView, attachments, ccRoles, editorOptions, fieldOptions, forceSignerRoles, forceSubjectMessage, formFieldGroups, formFieldRules, formFieldsPerDocument, mergeFields, message, metadata, showPreview, showProgressStepper, signerRoles, skipMeNow, subject, testMode, title, usePreexistingFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateCreateEmbeddedDraftRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" allowCcs: ").append(toIndentedString(allowCcs)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); + sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" forceSignerRoles: ").append(toIndentedString(forceSignerRoles)).append("\n"); + sb.append(" forceSubjectMessage: ").append(toIndentedString(forceSubjectMessage)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); + sb.append(" mergeFields: ").append(toIndentedString(mergeFields)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); + sb.append(" showProgressStepper: ").append(toIndentedString(showProgressStepper)).append("\n"); + sb.append(" signerRoles: ").append(toIndentedString(signerRoles)).append("\n"); + sb.append(" skipMeNow: ").append(toIndentedString(skipMeNow)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" usePreexistingFields: ").append(toIndentedString(usePreexistingFields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - * This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - public TemplateCreateEmbeddedDraftRequest allowCcs( - @javax.annotation.Nullable Boolean allowCcs) { - this.allowCcs = allowCcs; - return this; - } - - /** - * This allows the requester to specify whether the user is allowed to provide email addresses - * to CC when creating a template. - * - * @return allowCcs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowCcs() { - return allowCcs; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowCcs(@javax.annotation.Nullable Boolean allowCcs) { - this.allowCcs = allowCcs; - } - - public TemplateCreateEmbeddedDraftRequest allowReassign( - @javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - return this; - } - - /** - * Allows signers to reassign their signature requests to other signers if set to - * `true`. Defaults to `false`. **NOTE:** Only available for Premium plan - * and higher. - * - * @return allowReassign - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowReassign() { - return allowReassign; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - } - - public TemplateCreateEmbeddedDraftRequest allowFormView( - @javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - return this; - } - - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to - * `false`. - * - * @return allowFormView - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowFormView() { - return allowFormView; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - } - - public TemplateCreateEmbeddedDraftRequest attachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * - * @return attachments - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAttachments() { - return attachments; - } - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(@javax.annotation.Nullable List attachments) { - this.attachments = attachments; - } - - public TemplateCreateEmbeddedDraftRequest ccRoles( - @javax.annotation.Nullable List ccRoles) { - this.ccRoles = ccRoles; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addCcRolesItem(String ccRolesItem) { - if (this.ccRoles == null) { - this.ccRoles = new ArrayList<>(); + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); } - this.ccRoles.add(ccRolesItem); - return this; } - - /** - * The CC roles that must be assigned when using the template to send a signature request - * - * @return ccRoles - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcRoles() { - return ccRoles; - } - - @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcRoles(@javax.annotation.Nullable List ccRoles) { - this.ccRoles = ccRoles; - } - - public TemplateCreateEmbeddedDraftRequest editorOptions( - @javax.annotation.Nullable SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - return this; - } - - /** - * Get editorOptions - * - * @return editorOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubEditorOptions getEditorOptions() { - return editorOptions; - } - - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - } - - public TemplateCreateEmbeddedDraftRequest fieldOptions( - @javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * - * @return fieldOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - public TemplateCreateEmbeddedDraftRequest forceSignerRoles( - @javax.annotation.Nullable Boolean forceSignerRoles) { - this.forceSignerRoles = forceSignerRoles; - return this; - } - - /** - * Provide users the ability to review/edit the template signer roles. - * - * @return forceSignerRoles - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getForceSignerRoles() { - return forceSignerRoles; - } - - @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSignerRoles(@javax.annotation.Nullable Boolean forceSignerRoles) { - this.forceSignerRoles = forceSignerRoles; - } - - public TemplateCreateEmbeddedDraftRequest forceSubjectMessage( - @javax.annotation.Nullable Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - return this; - } - - /** - * Provide users the ability to review/edit the template subject and message. - * - * @return forceSubjectMessage - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getForceSubjectMessage() { - return forceSubjectMessage; - } - - @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSubjectMessage(@javax.annotation.Nullable Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - } - - public TemplateCreateEmbeddedDraftRequest formFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addFormFieldGroupsItem( - SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; } - this.formFieldGroups.add(formFieldGroupsItem); - return this; - } - - /** - * Group information for fields defined in `form_fields_per_document`. String-indexed - * JSON array with `group_label` and `requirement` keys. - * `form_fields_per_document` must contain fields referencing a group defined in - * `form_field_groups`. - * - * @return formFieldGroups - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldGroups() { - return formFieldGroups; - } - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - public TemplateCreateEmbeddedDraftRequest formFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addFormFieldRulesItem( - SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * - * @return formFieldRules - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldRules() { - return formFieldRules; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - public TemplateCreateEmbeddedDraftRequest formFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addFormFieldsPerDocumentItem( - SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); } - this.formFieldsPerDocument.add(formFieldsPerDocumentItem); - return this; - } - - /** - * The fields that should appear on the document, expressed as an array of objects. (For more - * details you can read about it here: [Using Form Fields per - * Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, - * **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and - * optional parameters. Check out the list of [additional - * parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text - * Field use `SubFormFieldsPerDocumentText` * Dropdown Field use - * `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use - * `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use - * `SubFormFieldsPerDocumentCheckbox` * Radio Field use - * `SubFormFieldsPerDocumentRadio` * Signature Field use - * `SubFormFieldsPerDocumentSignature` * Date Signed Field use - * `SubFormFieldsPerDocumentDateSigned` * Initials Field use - * `SubFormFieldsPerDocumentInitials` * Text Merge Field use - * `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use - * `SubFormFieldsPerDocumentCheckboxMerge` - * - * @return formFieldsPerDocument - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } - - public TemplateCreateEmbeddedDraftRequest mergeFields( - @javax.annotation.Nullable List mergeFields) { - this.mergeFields = mergeFields; - return this; } - - public TemplateCreateEmbeddedDraftRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { - if (this.mergeFields == null) { - this.mergeFields = new ArrayList<>(); + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; } - this.mergeFields.add(mergeFieldsItem); - return this; - } - - /** - * Add merge fields to the template. Merge fields are placed by the user creating the template - * and used to pre-fill data by passing values into signature requests with the - * `custom_fields` parameter. If the signature request using that template *does not* - * pass a value into a merge field, then an empty field remains in the document. - * - * @return mergeFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getMergeFields() { - return mergeFields; - } - - @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMergeFields(@javax.annotation.Nullable List mergeFields) { - this.mergeFields = mergeFields; - } - - public TemplateCreateEmbeddedDraftRequest message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - /** - * The default template email message. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public TemplateCreateEmbeddedDraftRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public TemplateCreateEmbeddedDraftRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public TemplateCreateEmbeddedDraftRequest showPreview( - @javax.annotation.Nullable Boolean showPreview) { - this.showPreview = showPreview; - return this; - } - - /** - * This allows the requester to enable the editor/preview experience. - - * `show_preview=true`: Allows requesters to enable the editor/preview - * experience. - `show_preview=false`: Allows requesters to disable the - * editor/preview experience. - * - * @return showPreview - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getShowPreview() { - return showPreview; - } - - @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowPreview(@javax.annotation.Nullable Boolean showPreview) { - this.showPreview = showPreview; - } - - public TemplateCreateEmbeddedDraftRequest showProgressStepper( - @javax.annotation.Nullable Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - return this; } + if (allowCcs != null) { + if (isFileTypeOrListOfFiles(allowCcs)) { + fileTypeFound = true; + } - /** - * When only one step remains in the signature request process and this parameter is set to - * `false` then the progress stepper will be hidden. - * - * @return showProgressStepper - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getShowProgressStepper() { - return showProgressStepper; + if (allowCcs.getClass().equals(java.io.File.class) || + allowCcs.getClass().equals(Integer.class) || + allowCcs.getClass().equals(String.class) || + allowCcs.getClass().isEnum()) { + map.put("allow_ccs", allowCcs); + } else if (isListOfFile(allowCcs)) { + for(int i = 0; i< getListSize(allowCcs); i++) { + map.put("allow_ccs[" + i + "]", getFromList(allowCcs, i)); + } + } + else { + map.put("allow_ccs", JSON.getDefault().getMapper().writeValueAsString(allowCcs)); + } } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; + if (allowReassign.getClass().equals(java.io.File.class) || + allowReassign.getClass().equals(Integer.class) || + allowReassign.getClass().equals(String.class) || + allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for(int i = 0; i< getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } + else { + map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } - public TemplateCreateEmbeddedDraftRequest signerRoles( - @javax.annotation.Nullable List signerRoles) { - this.signerRoles = signerRoles; - return this; + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } - public TemplateCreateEmbeddedDraftRequest addSignerRolesItem(SubTemplateRole signerRolesItem) { - if (this.signerRoles == null) { - this.signerRoles = new ArrayList<>(); + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); } - this.signerRoles.add(signerRolesItem); - return this; } + if (ccRoles != null) { + if (isFileTypeOrListOfFiles(ccRoles)) { + fileTypeFound = true; + } - /** - * An array of the designated signer roles that must be specified when sending a - * SignatureRequest using this Template. - * - * @return signerRoles - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSignerRoles() { - return signerRoles; + if (ccRoles.getClass().equals(java.io.File.class) || + ccRoles.getClass().equals(Integer.class) || + ccRoles.getClass().equals(String.class) || + ccRoles.getClass().isEnum()) { + map.put("cc_roles", ccRoles); + } else if (isListOfFile(ccRoles)) { + for(int i = 0; i< getListSize(ccRoles); i++) { + map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); + } + } + else { + map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + } } + if (editorOptions != null) { + if (isFileTypeOrListOfFiles(editorOptions)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerRoles(@javax.annotation.Nullable List signerRoles) { - this.signerRoles = signerRoles; + if (editorOptions.getClass().equals(java.io.File.class) || + editorOptions.getClass().equals(Integer.class) || + editorOptions.getClass().equals(String.class) || + editorOptions.getClass().isEnum()) { + map.put("editor_options", editorOptions); + } else if (isListOfFile(editorOptions)) { + for(int i = 0; i< getListSize(editorOptions); i++) { + map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); + } + } + else { + map.put("editor_options", JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + } } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } - public TemplateCreateEmbeddedDraftRequest skipMeNow( - @javax.annotation.Nullable Boolean skipMeNow) { - this.skipMeNow = skipMeNow; - return this; + if (fieldOptions.getClass().equals(java.io.File.class) || + fieldOptions.getClass().equals(Integer.class) || + fieldOptions.getClass().equals(String.class) || + fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for(int i = 0; i< getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } + else { + map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } } + if (forceSignerRoles != null) { + if (isFileTypeOrListOfFiles(forceSignerRoles)) { + fileTypeFound = true; + } - /** - * Disables the \"Me (Now)\" option for the person preparing the document. Does not - * work with type `send_document`. Defaults to `false`. - * - * @return skipMeNow - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getSkipMeNow() { - return skipMeNow; + if (forceSignerRoles.getClass().equals(java.io.File.class) || + forceSignerRoles.getClass().equals(Integer.class) || + forceSignerRoles.getClass().equals(String.class) || + forceSignerRoles.getClass().isEnum()) { + map.put("force_signer_roles", forceSignerRoles); + } else if (isListOfFile(forceSignerRoles)) { + for(int i = 0; i< getListSize(forceSignerRoles); i++) { + map.put("force_signer_roles[" + i + "]", getFromList(forceSignerRoles, i)); + } + } + else { + map.put("force_signer_roles", JSON.getDefault().getMapper().writeValueAsString(forceSignerRoles)); + } } + if (forceSubjectMessage != null) { + if (isFileTypeOrListOfFiles(forceSubjectMessage)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSkipMeNow(@javax.annotation.Nullable Boolean skipMeNow) { - this.skipMeNow = skipMeNow; + if (forceSubjectMessage.getClass().equals(java.io.File.class) || + forceSubjectMessage.getClass().equals(Integer.class) || + forceSubjectMessage.getClass().equals(String.class) || + forceSubjectMessage.getClass().isEnum()) { + map.put("force_subject_message", forceSubjectMessage); + } else if (isListOfFile(forceSubjectMessage)) { + for(int i = 0; i< getListSize(forceSubjectMessage); i++) { + map.put("force_subject_message[" + i + "]", getFromList(forceSubjectMessage, i)); + } + } + else { + map.put("force_subject_message", JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); + } } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } - public TemplateCreateEmbeddedDraftRequest subject(@javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (formFieldGroups.getClass().equals(java.io.File.class) || + formFieldGroups.getClass().equals(Integer.class) || + formFieldGroups.getClass().equals(String.class) || + formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for(int i = 0; i< getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } + else { + map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } - /** - * The template title (alias). - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (formFieldRules.getClass().equals(java.io.File.class) || + formFieldRules.getClass().equals(Integer.class) || + formFieldRules.getClass().equals(String.class) || + formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for(int i = 0; i< getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } + else { + map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (formFieldsPerDocument.getClass().equals(java.io.File.class) || + formFieldsPerDocument.getClass().equals(Integer.class) || + formFieldsPerDocument.getClass().equals(String.class) || + formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { + map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); + } + } + else { + map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); + } } + if (mergeFields != null) { + if (isFileTypeOrListOfFiles(mergeFields)) { + fileTypeFound = true; + } - public TemplateCreateEmbeddedDraftRequest testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (mergeFields.getClass().equals(java.io.File.class) || + mergeFields.getClass().equals(Integer.class) || + mergeFields.getClass().equals(String.class) || + mergeFields.getClass().isEnum()) { + map.put("merge_fields", mergeFields); + } else if (isListOfFile(mergeFields)) { + for(int i = 0; i< getListSize(mergeFields); i++) { + map.put("merge_fields[" + i + "]", getFromList(mergeFields, i)); + } + } + else { + map.put("merge_fields", JSON.getDefault().getMapper().writeValueAsString(mergeFields)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request created from this draft will not be legally - * binding if set to `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (showPreview != null) { + if (isFileTypeOrListOfFiles(showPreview)) { + fileTypeFound = true; + } - public TemplateCreateEmbeddedDraftRequest title(@javax.annotation.Nullable String title) { - this.title = title; - return this; + if (showPreview.getClass().equals(java.io.File.class) || + showPreview.getClass().equals(Integer.class) || + showPreview.getClass().equals(String.class) || + showPreview.getClass().isEnum()) { + map.put("show_preview", showPreview); + } else if (isListOfFile(showPreview)) { + for(int i = 0; i< getListSize(showPreview); i++) { + map.put("show_preview[" + i + "]", getFromList(showPreview, i)); + } + } + else { + map.put("show_preview", JSON.getDefault().getMapper().writeValueAsString(showPreview)); + } } + if (showProgressStepper != null) { + if (isFileTypeOrListOfFiles(showProgressStepper)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (showProgressStepper.getClass().equals(java.io.File.class) || + showProgressStepper.getClass().equals(Integer.class) || + showProgressStepper.getClass().equals(String.class) || + showProgressStepper.getClass().isEnum()) { + map.put("show_progress_stepper", showProgressStepper); + } else if (isListOfFile(showProgressStepper)) { + for(int i = 0; i< getListSize(showProgressStepper); i++) { + map.put("show_progress_stepper[" + i + "]", getFromList(showProgressStepper, i)); + } + } + else { + map.put("show_progress_stepper", JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + } } + if (signerRoles != null) { + if (isFileTypeOrListOfFiles(signerRoles)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (signerRoles.getClass().equals(java.io.File.class) || + signerRoles.getClass().equals(Integer.class) || + signerRoles.getClass().equals(String.class) || + signerRoles.getClass().isEnum()) { + map.put("signer_roles", signerRoles); + } else if (isListOfFile(signerRoles)) { + for(int i = 0; i< getListSize(signerRoles); i++) { + map.put("signer_roles[" + i + "]", getFromList(signerRoles, i)); + } + } + else { + map.put("signer_roles", JSON.getDefault().getMapper().writeValueAsString(signerRoles)); + } } + if (skipMeNow != null) { + if (isFileTypeOrListOfFiles(skipMeNow)) { + fileTypeFound = true; + } - public TemplateCreateEmbeddedDraftRequest usePreexistingFields( - @javax.annotation.Nullable Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; - return this; + if (skipMeNow.getClass().equals(java.io.File.class) || + skipMeNow.getClass().equals(Integer.class) || + skipMeNow.getClass().equals(String.class) || + skipMeNow.getClass().isEnum()) { + map.put("skip_me_now", skipMeNow); + } else if (isListOfFile(skipMeNow)) { + for(int i = 0; i< getListSize(skipMeNow); i++) { + map.put("skip_me_now[" + i + "]", getFromList(skipMeNow, i)); + } + } + else { + map.put("skip_me_now", JSON.getDefault().getMapper().writeValueAsString(skipMeNow)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - /** - * Enable the detection of predefined PDF fields by setting the - * `use_preexisting_fields` to `true` (defaults to disabled, or - * `false`). - * - * @return usePreexistingFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getUsePreexistingFields() { - return usePreexistingFields; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsePreexistingFields(@javax.annotation.Nullable Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - /** Return true if this TemplateCreateEmbeddedDraftRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest = - (TemplateCreateEmbeddedDraftRequest) o; - return Objects.equals(this.clientId, templateCreateEmbeddedDraftRequest.clientId) - && Objects.equals(this.files, templateCreateEmbeddedDraftRequest.files) - && Objects.equals(this.fileUrls, templateCreateEmbeddedDraftRequest.fileUrls) - && Objects.equals(this.allowCcs, templateCreateEmbeddedDraftRequest.allowCcs) - && Objects.equals( - this.allowReassign, templateCreateEmbeddedDraftRequest.allowReassign) - && Objects.equals( - this.allowFormView, templateCreateEmbeddedDraftRequest.allowFormView) - && Objects.equals(this.attachments, templateCreateEmbeddedDraftRequest.attachments) - && Objects.equals(this.ccRoles, templateCreateEmbeddedDraftRequest.ccRoles) - && Objects.equals( - this.editorOptions, templateCreateEmbeddedDraftRequest.editorOptions) - && Objects.equals( - this.fieldOptions, templateCreateEmbeddedDraftRequest.fieldOptions) - && Objects.equals( - this.forceSignerRoles, templateCreateEmbeddedDraftRequest.forceSignerRoles) - && Objects.equals( - this.forceSubjectMessage, - templateCreateEmbeddedDraftRequest.forceSubjectMessage) - && Objects.equals( - this.formFieldGroups, templateCreateEmbeddedDraftRequest.formFieldGroups) - && Objects.equals( - this.formFieldRules, templateCreateEmbeddedDraftRequest.formFieldRules) - && Objects.equals( - this.formFieldsPerDocument, - templateCreateEmbeddedDraftRequest.formFieldsPerDocument) - && Objects.equals(this.mergeFields, templateCreateEmbeddedDraftRequest.mergeFields) - && Objects.equals(this.message, templateCreateEmbeddedDraftRequest.message) - && Objects.equals(this.metadata, templateCreateEmbeddedDraftRequest.metadata) - && Objects.equals(this.showPreview, templateCreateEmbeddedDraftRequest.showPreview) - && Objects.equals( - this.showProgressStepper, - templateCreateEmbeddedDraftRequest.showProgressStepper) - && Objects.equals(this.signerRoles, templateCreateEmbeddedDraftRequest.signerRoles) - && Objects.equals(this.skipMeNow, templateCreateEmbeddedDraftRequest.skipMeNow) - && Objects.equals(this.subject, templateCreateEmbeddedDraftRequest.subject) - && Objects.equals(this.testMode, templateCreateEmbeddedDraftRequest.testMode) - && Objects.equals(this.title, templateCreateEmbeddedDraftRequest.title) - && Objects.equals( - this.usePreexistingFields, - templateCreateEmbeddedDraftRequest.usePreexistingFields); + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } + if (usePreexistingFields != null) { + if (isFileTypeOrListOfFiles(usePreexistingFields)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - clientId, - files, - fileUrls, - allowCcs, - allowReassign, - allowFormView, - attachments, - ccRoles, - editorOptions, - fieldOptions, - forceSignerRoles, - forceSubjectMessage, - formFieldGroups, - formFieldRules, - formFieldsPerDocument, - mergeFields, - message, - metadata, - showPreview, - showProgressStepper, - signerRoles, - skipMeNow, - subject, - testMode, - title, - usePreexistingFields); + if (usePreexistingFields.getClass().equals(java.io.File.class) || + usePreexistingFields.getClass().equals(Integer.class) || + usePreexistingFields.getClass().equals(String.class) || + usePreexistingFields.getClass().isEnum()) { + map.put("use_preexisting_fields", usePreexistingFields); + } else if (isListOfFile(usePreexistingFields)) { + for(int i = 0; i< getListSize(usePreexistingFields); i++) { + map.put("use_preexisting_fields[" + i + "]", getFromList(usePreexistingFields, i)); + } + } + else { + map.put("use_preexisting_fields", JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateCreateEmbeddedDraftRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" allowCcs: ").append(toIndentedString(allowCcs)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); - sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" forceSignerRoles: ").append(toIndentedString(forceSignerRoles)).append("\n"); - sb.append(" forceSubjectMessage: ") - .append(toIndentedString(forceSubjectMessage)) - .append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" formFieldsPerDocument: ") - .append(toIndentedString(formFieldsPerDocument)) - .append("\n"); - sb.append(" mergeFields: ").append(toIndentedString(mergeFields)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); - sb.append(" showProgressStepper: ") - .append(toIndentedString(showProgressStepper)) - .append("\n"); - sb.append(" signerRoles: ").append(toIndentedString(signerRoles)).append("\n"); - sb.append(" skipMeNow: ").append(toIndentedString(skipMeNow)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" usePreexistingFields: ") - .append(toIndentedString(usePreexistingFields)) - .append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (allowCcs != null) { - if (isFileTypeOrListOfFiles(allowCcs)) { - fileTypeFound = true; - } - - if (allowCcs.getClass().equals(java.io.File.class) - || allowCcs.getClass().equals(Integer.class) - || allowCcs.getClass().equals(String.class) - || allowCcs.getClass().isEnum()) { - map.put("allow_ccs", allowCcs); - } else if (isListOfFile(allowCcs)) { - for (int i = 0; i < getListSize(allowCcs); i++) { - map.put("allow_ccs[" + i + "]", getFromList(allowCcs, i)); - } - } else { - map.put( - "allow_ccs", - JSON.getDefault().getMapper().writeValueAsString(allowCcs)); - } - } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - - if (allowReassign.getClass().equals(java.io.File.class) - || allowReassign.getClass().equals(Integer.class) - || allowReassign.getClass().equals(String.class) - || allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for (int i = 0; i < getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } else { - map.put( - "allow_reassign", - JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } - } - if (allowFormView != null) { - if (isFileTypeOrListOfFiles(allowFormView)) { - fileTypeFound = true; - } - - if (allowFormView.getClass().equals(java.io.File.class) - || allowFormView.getClass().equals(Integer.class) - || allowFormView.getClass().equals(String.class) - || allowFormView.getClass().isEnum()) { - map.put("allow_form_view", allowFormView); - } else if (isListOfFile(allowFormView)) { - for (int i = 0; i < getListSize(allowFormView); i++) { - map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); - } - } else { - map.put( - "allow_form_view", - JSON.getDefault().getMapper().writeValueAsString(allowFormView)); - } - } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - - if (attachments.getClass().equals(java.io.File.class) - || attachments.getClass().equals(Integer.class) - || attachments.getClass().equals(String.class) - || attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for (int i = 0; i < getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } else { - map.put( - "attachments", - JSON.getDefault().getMapper().writeValueAsString(attachments)); - } - } - if (ccRoles != null) { - if (isFileTypeOrListOfFiles(ccRoles)) { - fileTypeFound = true; - } - - if (ccRoles.getClass().equals(java.io.File.class) - || ccRoles.getClass().equals(Integer.class) - || ccRoles.getClass().equals(String.class) - || ccRoles.getClass().isEnum()) { - map.put("cc_roles", ccRoles); - } else if (isListOfFile(ccRoles)) { - for (int i = 0; i < getListSize(ccRoles); i++) { - map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); - } - } else { - map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); - } - } - if (editorOptions != null) { - if (isFileTypeOrListOfFiles(editorOptions)) { - fileTypeFound = true; - } - - if (editorOptions.getClass().equals(java.io.File.class) - || editorOptions.getClass().equals(Integer.class) - || editorOptions.getClass().equals(String.class) - || editorOptions.getClass().isEnum()) { - map.put("editor_options", editorOptions); - } else if (isListOfFile(editorOptions)) { - for (int i = 0; i < getListSize(editorOptions); i++) { - map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); - } - } else { - map.put( - "editor_options", - JSON.getDefault().getMapper().writeValueAsString(editorOptions)); - } - } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - - if (fieldOptions.getClass().equals(java.io.File.class) - || fieldOptions.getClass().equals(Integer.class) - || fieldOptions.getClass().equals(String.class) - || fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for (int i = 0; i < getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } else { - map.put( - "field_options", - JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } - } - if (forceSignerRoles != null) { - if (isFileTypeOrListOfFiles(forceSignerRoles)) { - fileTypeFound = true; - } - - if (forceSignerRoles.getClass().equals(java.io.File.class) - || forceSignerRoles.getClass().equals(Integer.class) - || forceSignerRoles.getClass().equals(String.class) - || forceSignerRoles.getClass().isEnum()) { - map.put("force_signer_roles", forceSignerRoles); - } else if (isListOfFile(forceSignerRoles)) { - for (int i = 0; i < getListSize(forceSignerRoles); i++) { - map.put("force_signer_roles[" + i + "]", getFromList(forceSignerRoles, i)); - } - } else { - map.put( - "force_signer_roles", - JSON.getDefault().getMapper().writeValueAsString(forceSignerRoles)); - } - } - if (forceSubjectMessage != null) { - if (isFileTypeOrListOfFiles(forceSubjectMessage)) { - fileTypeFound = true; - } - - if (forceSubjectMessage.getClass().equals(java.io.File.class) - || forceSubjectMessage.getClass().equals(Integer.class) - || forceSubjectMessage.getClass().equals(String.class) - || forceSubjectMessage.getClass().isEnum()) { - map.put("force_subject_message", forceSubjectMessage); - } else if (isListOfFile(forceSubjectMessage)) { - for (int i = 0; i < getListSize(forceSubjectMessage); i++) { - map.put( - "force_subject_message[" + i + "]", - getFromList(forceSubjectMessage, i)); - } - } else { - map.put( - "force_subject_message", - JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); - } - } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - - if (formFieldGroups.getClass().equals(java.io.File.class) - || formFieldGroups.getClass().equals(Integer.class) - || formFieldGroups.getClass().equals(String.class) - || formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for (int i = 0; i < getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } else { - map.put( - "form_field_groups", - JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } - } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - - if (formFieldRules.getClass().equals(java.io.File.class) - || formFieldRules.getClass().equals(Integer.class) - || formFieldRules.getClass().equals(String.class) - || formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for (int i = 0; i < getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } else { - map.put( - "form_field_rules", - JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } - } - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - - if (formFieldsPerDocument.getClass().equals(java.io.File.class) - || formFieldsPerDocument.getClass().equals(Integer.class) - || formFieldsPerDocument.getClass().equals(String.class) - || formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { - map.put( - "form_fields_per_document[" + i + "]", - getFromList(formFieldsPerDocument, i)); - } - } else { - map.put( - "form_fields_per_document", - JSON.getDefault() - .getMapper() - .writeValueAsString(formFieldsPerDocument)); - } - } - if (mergeFields != null) { - if (isFileTypeOrListOfFiles(mergeFields)) { - fileTypeFound = true; - } - - if (mergeFields.getClass().equals(java.io.File.class) - || mergeFields.getClass().equals(Integer.class) - || mergeFields.getClass().equals(String.class) - || mergeFields.getClass().isEnum()) { - map.put("merge_fields", mergeFields); - } else if (isListOfFile(mergeFields)) { - for (int i = 0; i < getListSize(mergeFields); i++) { - map.put("merge_fields[" + i + "]", getFromList(mergeFields, i)); - } - } else { - map.put( - "merge_fields", - JSON.getDefault().getMapper().writeValueAsString(mergeFields)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (showPreview != null) { - if (isFileTypeOrListOfFiles(showPreview)) { - fileTypeFound = true; - } - - if (showPreview.getClass().equals(java.io.File.class) - || showPreview.getClass().equals(Integer.class) - || showPreview.getClass().equals(String.class) - || showPreview.getClass().isEnum()) { - map.put("show_preview", showPreview); - } else if (isListOfFile(showPreview)) { - for (int i = 0; i < getListSize(showPreview); i++) { - map.put("show_preview[" + i + "]", getFromList(showPreview, i)); - } - } else { - map.put( - "show_preview", - JSON.getDefault().getMapper().writeValueAsString(showPreview)); - } - } - if (showProgressStepper != null) { - if (isFileTypeOrListOfFiles(showProgressStepper)) { - fileTypeFound = true; - } - - if (showProgressStepper.getClass().equals(java.io.File.class) - || showProgressStepper.getClass().equals(Integer.class) - || showProgressStepper.getClass().equals(String.class) - || showProgressStepper.getClass().isEnum()) { - map.put("show_progress_stepper", showProgressStepper); - } else if (isListOfFile(showProgressStepper)) { - for (int i = 0; i < getListSize(showProgressStepper); i++) { - map.put( - "show_progress_stepper[" + i + "]", - getFromList(showProgressStepper, i)); - } - } else { - map.put( - "show_progress_stepper", - JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); - } - } - if (signerRoles != null) { - if (isFileTypeOrListOfFiles(signerRoles)) { - fileTypeFound = true; - } - - if (signerRoles.getClass().equals(java.io.File.class) - || signerRoles.getClass().equals(Integer.class) - || signerRoles.getClass().equals(String.class) - || signerRoles.getClass().isEnum()) { - map.put("signer_roles", signerRoles); - } else if (isListOfFile(signerRoles)) { - for (int i = 0; i < getListSize(signerRoles); i++) { - map.put("signer_roles[" + i + "]", getFromList(signerRoles, i)); - } - } else { - map.put( - "signer_roles", - JSON.getDefault().getMapper().writeValueAsString(signerRoles)); - } - } - if (skipMeNow != null) { - if (isFileTypeOrListOfFiles(skipMeNow)) { - fileTypeFound = true; - } - - if (skipMeNow.getClass().equals(java.io.File.class) - || skipMeNow.getClass().equals(Integer.class) - || skipMeNow.getClass().equals(String.class) - || skipMeNow.getClass().isEnum()) { - map.put("skip_me_now", skipMeNow); - } else if (isListOfFile(skipMeNow)) { - for (int i = 0; i < getListSize(skipMeNow); i++) { - map.put("skip_me_now[" + i + "]", getFromList(skipMeNow, i)); - } - } else { - map.put( - "skip_me_now", - JSON.getDefault().getMapper().writeValueAsString(skipMeNow)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (usePreexistingFields != null) { - if (isFileTypeOrListOfFiles(usePreexistingFields)) { - fileTypeFound = true; - } - - if (usePreexistingFields.getClass().equals(java.io.File.class) - || usePreexistingFields.getClass().equals(Integer.class) - || usePreexistingFields.getClass().equals(String.class) - || usePreexistingFields.getClass().isEnum()) { - map.put("use_preexisting_fields", usePreexistingFields); - } else if (isListOfFile(usePreexistingFields)) { - for (int i = 0; i < getListSize(usePreexistingFields); i++) { - map.put( - "use_preexisting_fields[" + i + "]", - getFromList(usePreexistingFields, i)); - } - } else { - map.put( - "use_preexisting_fields", - JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java index d9ab41602..f71c304c5 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java @@ -10,221 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateCreateEmbeddedDraftResponseTemplate; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** TemplateCreateEmbeddedDraftResponse */ + +import com.dropbox.sign.ApiException; +/** + * TemplateCreateEmbeddedDraftResponse + */ @JsonPropertyOrder({ - TemplateCreateEmbeddedDraftResponse.JSON_PROPERTY_TEMPLATE, - TemplateCreateEmbeddedDraftResponse.JSON_PROPERTY_WARNINGS + TemplateCreateEmbeddedDraftResponse.JSON_PROPERTY_TEMPLATE, + TemplateCreateEmbeddedDraftResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateCreateEmbeddedDraftResponse { - public static final String JSON_PROPERTY_TEMPLATE = "template"; - @javax.annotation.Nonnull private TemplateCreateEmbeddedDraftResponseTemplate template; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public TemplateCreateEmbeddedDraftResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateCreateEmbeddedDraftResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateCreateEmbeddedDraftResponse.class); - } - - public static TemplateCreateEmbeddedDraftResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateCreateEmbeddedDraftResponse.class); - } - - public TemplateCreateEmbeddedDraftResponse template( - @javax.annotation.Nonnull TemplateCreateEmbeddedDraftResponseTemplate template) { - this.template = template; - return this; - } - - /** - * Get template - * - * @return template - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TemplateCreateEmbeddedDraftResponseTemplate getTemplate() { - return template; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplate( - @javax.annotation.Nonnull TemplateCreateEmbeddedDraftResponseTemplate template) { - this.template = template; - } - - public TemplateCreateEmbeddedDraftResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public TemplateCreateEmbeddedDraftResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_TEMPLATE = "template"; + @javax.annotation.Nonnull + private TemplateCreateEmbeddedDraftResponseTemplate template; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public TemplateCreateEmbeddedDraftResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateCreateEmbeddedDraftResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateCreateEmbeddedDraftResponse.class); + } + + static public TemplateCreateEmbeddedDraftResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateCreateEmbeddedDraftResponse.class + ); + } + + public TemplateCreateEmbeddedDraftResponse template(@javax.annotation.Nonnull TemplateCreateEmbeddedDraftResponseTemplate template) { + this.template = template; + return this; + } + + /** + * Get template + * @return template + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TemplateCreateEmbeddedDraftResponseTemplate getTemplate() { + return template; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplate(@javax.annotation.Nonnull TemplateCreateEmbeddedDraftResponseTemplate template) { + this.template = template; + } + + + public TemplateCreateEmbeddedDraftResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TemplateCreateEmbeddedDraftResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this TemplateCreateEmbeddedDraftResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateCreateEmbeddedDraftResponse templateCreateEmbeddedDraftResponse = (TemplateCreateEmbeddedDraftResponse) o; + return Objects.equals(this.template, templateCreateEmbeddedDraftResponse.template) && + Objects.equals(this.warnings, templateCreateEmbeddedDraftResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(template, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateCreateEmbeddedDraftResponse {\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (template != null) { + if (isFileTypeOrListOfFiles(template)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this TemplateCreateEmbeddedDraftResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (template.getClass().equals(java.io.File.class) || + template.getClass().equals(Integer.class) || + template.getClass().equals(String.class) || + template.getClass().isEnum()) { + map.put("template", template); + } else if (isListOfFile(template)) { + for(int i = 0; i< getListSize(template); i++) { + map.put("template[" + i + "]", getFromList(template, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); } - TemplateCreateEmbeddedDraftResponse templateCreateEmbeddedDraftResponse = - (TemplateCreateEmbeddedDraftResponse) o; - return Objects.equals(this.template, templateCreateEmbeddedDraftResponse.template) - && Objects.equals(this.warnings, templateCreateEmbeddedDraftResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(template, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateCreateEmbeddedDraftResponse {\n"); - sb.append(" template: ").append(toIndentedString(template)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (template != null) { - if (isFileTypeOrListOfFiles(template)) { - fileTypeFound = true; - } - - if (template.getClass().equals(java.io.File.class) - || template.getClass().equals(Integer.class) - || template.getClass().equals(String.class) - || template.getClass().isEnum()) { - map.put("template", template); - } else if (isListOfFile(template)) { - for (int i = 0; i < getListSize(template); i++) { - map.put("template[" + i + "]", getFromList(template, i)); - } - } else { - map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java index 1f11a454b..ac6ed4c24 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java @@ -10,330 +10,339 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + +import com.dropbox.sign.ApiException; /** - * Template object with parameters: `template_id`, `edit_url`, - * `expires_at`. + * Template object with parameters: `template_id`, `edit_url`, `expires_at`. */ @JsonPropertyOrder({ - TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_TEMPLATE_ID, - TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_EDIT_URL, - TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_EXPIRES_AT, - TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_WARNINGS + TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_TEMPLATE_ID, + TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_EDIT_URL, + TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_EXPIRES_AT, + TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateCreateEmbeddedDraftResponseTemplate { - public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; - @javax.annotation.Nullable private String templateId; - - public static final String JSON_PROPERTY_EDIT_URL = "edit_url"; - @javax.annotation.Nullable private String editUrl; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @Deprecated @javax.annotation.Nullable private List warnings = null; - - public TemplateCreateEmbeddedDraftResponseTemplate() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateCreateEmbeddedDraftResponseTemplate init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateCreateEmbeddedDraftResponseTemplate.class); - } - - public static TemplateCreateEmbeddedDraftResponseTemplate init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateCreateEmbeddedDraftResponseTemplate.class); - } - - public TemplateCreateEmbeddedDraftResponseTemplate templateId( - @javax.annotation.Nullable String templateId) { - this.templateId = templateId; - return this; - } - - /** - * The id of the Template. - * - * @return templateId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTemplateId() { - return templateId; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplateId(@javax.annotation.Nullable String templateId) { - this.templateId = templateId; - } - - public TemplateCreateEmbeddedDraftResponseTemplate editUrl( - @javax.annotation.Nullable String editUrl) { - this.editUrl = editUrl; - return this; - } - - /** - * Link to edit the template. - * - * @return editUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDIT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEditUrl() { - return editUrl; - } - - @JsonProperty(JSON_PROPERTY_EDIT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditUrl(@javax.annotation.Nullable String editUrl) { - this.editUrl = editUrl; + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + @javax.annotation.Nullable + private String templateId; + + public static final String JSON_PROPERTY_EDIT_URL = "edit_url"; + @javax.annotation.Nullable + private String editUrl; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @Deprecated + @javax.annotation.Nullable + private List warnings = null; + + public TemplateCreateEmbeddedDraftResponseTemplate() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateCreateEmbeddedDraftResponseTemplate init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateCreateEmbeddedDraftResponseTemplate.class); + } + + static public TemplateCreateEmbeddedDraftResponseTemplate init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateCreateEmbeddedDraftResponseTemplate.class + ); + } + + public TemplateCreateEmbeddedDraftResponseTemplate templateId(@javax.annotation.Nullable String templateId) { + this.templateId = templateId; + return this; + } + + /** + * The id of the Template. + * @return templateId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(@javax.annotation.Nullable String templateId) { + this.templateId = templateId; + } + + + public TemplateCreateEmbeddedDraftResponseTemplate editUrl(@javax.annotation.Nullable String editUrl) { + this.editUrl = editUrl; + return this; + } + + /** + * Link to edit the template. + * @return editUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EDIT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEditUrl() { + return editUrl; + } + + + @JsonProperty(JSON_PROPERTY_EDIT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditUrl(@javax.annotation.Nullable String editUrl) { + this.editUrl = editUrl; + } + + + public TemplateCreateEmbeddedDraftResponseTemplate expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the link expires. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + @Deprecated + public TemplateCreateEmbeddedDraftResponseTemplate warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TemplateCreateEmbeddedDraftResponseTemplate addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } - - public TemplateCreateEmbeddedDraftResponseTemplate expiresAt( - @javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @Deprecated + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this TemplateCreateEmbeddedDraftResponseTemplate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * When the link expires. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; - } - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; + if (o == null || getClass() != o.getClass()) { + return false; } - - @Deprecated - public TemplateCreateEmbeddedDraftResponseTemplate warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public TemplateCreateEmbeddedDraftResponseTemplate addWarningsItem( - WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + TemplateCreateEmbeddedDraftResponseTemplate templateCreateEmbeddedDraftResponseTemplate = (TemplateCreateEmbeddedDraftResponseTemplate) o; + return Objects.equals(this.templateId, templateCreateEmbeddedDraftResponseTemplate.templateId) && + Objects.equals(this.editUrl, templateCreateEmbeddedDraftResponseTemplate.editUrl) && + Objects.equals(this.expiresAt, templateCreateEmbeddedDraftResponseTemplate.expiresAt) && + Objects.equals(this.warnings, templateCreateEmbeddedDraftResponseTemplate.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(templateId, editUrl, expiresAt, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateCreateEmbeddedDraftResponseTemplate {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" editUrl: ").append(toIndentedString(editUrl)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateId != null) { + if (isFileTypeOrListOfFiles(templateId)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; + if (templateId.getClass().equals(java.io.File.class) || + templateId.getClass().equals(Integer.class) || + templateId.getClass().equals(String.class) || + templateId.getClass().isEnum()) { + map.put("template_id", templateId); + } else if (isListOfFile(templateId)) { + for(int i = 0; i< getListSize(templateId); i++) { + map.put("template_id[" + i + "]", getFromList(templateId, i)); + } + } + else { + map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); + } } + if (editUrl != null) { + if (isFileTypeOrListOfFiles(editUrl)) { + fileTypeFound = true; + } - @Deprecated - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; + if (editUrl.getClass().equals(java.io.File.class) || + editUrl.getClass().equals(Integer.class) || + editUrl.getClass().equals(String.class) || + editUrl.getClass().isEnum()) { + map.put("edit_url", editUrl); + } else if (isListOfFile(editUrl)) { + for(int i = 0; i< getListSize(editUrl); i++) { + map.put("edit_url[" + i + "]", getFromList(editUrl, i)); + } + } + else { + map.put("edit_url", JSON.getDefault().getMapper().writeValueAsString(editUrl)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - /** Return true if this TemplateCreateEmbeddedDraftResponseTemplate object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); } - TemplateCreateEmbeddedDraftResponseTemplate templateCreateEmbeddedDraftResponseTemplate = - (TemplateCreateEmbeddedDraftResponseTemplate) o; - return Objects.equals( - this.templateId, templateCreateEmbeddedDraftResponseTemplate.templateId) - && Objects.equals(this.editUrl, templateCreateEmbeddedDraftResponseTemplate.editUrl) - && Objects.equals( - this.expiresAt, templateCreateEmbeddedDraftResponseTemplate.expiresAt) - && Objects.equals( - this.warnings, templateCreateEmbeddedDraftResponseTemplate.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(templateId, editUrl, expiresAt, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateCreateEmbeddedDraftResponseTemplate {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); - sb.append(" editUrl: ").append(toIndentedString(editUrl)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { - fileTypeFound = true; - } - - if (templateId.getClass().equals(java.io.File.class) - || templateId.getClass().equals(Integer.class) - || templateId.getClass().equals(String.class) - || templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for (int i = 0; i < getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); - } - } else { - map.put( - "template_id", - JSON.getDefault().getMapper().writeValueAsString(templateId)); - } - } - if (editUrl != null) { - if (isFileTypeOrListOfFiles(editUrl)) { - fileTypeFound = true; - } - - if (editUrl.getClass().equals(java.io.File.class) - || editUrl.getClass().equals(Integer.class) - || editUrl.getClass().equals(String.class) - || editUrl.getClass().isEnum()) { - map.put("edit_url", editUrl); - } else if (isListOfFile(editUrl)) { - for (int i = 0; i < getListSize(editUrl); i++) { - map.put("edit_url[" + i + "]", getFromList(editUrl, i)); - } - } else { - map.put("edit_url", JSON.getDefault().getMapper().writeValueAsString(editUrl)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java index fee8ea562..4e446007c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java @@ -10,1178 +10,1180 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubAttachment; +import com.dropbox.sign.model.SubFieldOptions; +import com.dropbox.sign.model.SubFormFieldGroup; +import com.dropbox.sign.model.SubFormFieldRule; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.model.SubMergeField; +import com.dropbox.sign.model.SubTemplateRole; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** TemplateCreateRequest */ +import com.dropbox.sign.ApiException; +/** + * TemplateCreateRequest + */ @JsonPropertyOrder({ - TemplateCreateRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - TemplateCreateRequest.JSON_PROPERTY_SIGNER_ROLES, - TemplateCreateRequest.JSON_PROPERTY_FILES, - TemplateCreateRequest.JSON_PROPERTY_FILE_URLS, - TemplateCreateRequest.JSON_PROPERTY_ALLOW_REASSIGN, - TemplateCreateRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, - TemplateCreateRequest.JSON_PROPERTY_ATTACHMENTS, - TemplateCreateRequest.JSON_PROPERTY_CC_ROLES, - TemplateCreateRequest.JSON_PROPERTY_CLIENT_ID, - TemplateCreateRequest.JSON_PROPERTY_FIELD_OPTIONS, - TemplateCreateRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - TemplateCreateRequest.JSON_PROPERTY_FORM_FIELD_RULES, - TemplateCreateRequest.JSON_PROPERTY_MERGE_FIELDS, - TemplateCreateRequest.JSON_PROPERTY_MESSAGE, - TemplateCreateRequest.JSON_PROPERTY_METADATA, - TemplateCreateRequest.JSON_PROPERTY_SUBJECT, - TemplateCreateRequest.JSON_PROPERTY_TEST_MODE, - TemplateCreateRequest.JSON_PROPERTY_TITLE, - TemplateCreateRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS + TemplateCreateRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + TemplateCreateRequest.JSON_PROPERTY_SIGNER_ROLES, + TemplateCreateRequest.JSON_PROPERTY_FILES, + TemplateCreateRequest.JSON_PROPERTY_FILE_URLS, + TemplateCreateRequest.JSON_PROPERTY_ALLOW_REASSIGN, + TemplateCreateRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, + TemplateCreateRequest.JSON_PROPERTY_ATTACHMENTS, + TemplateCreateRequest.JSON_PROPERTY_CC_ROLES, + TemplateCreateRequest.JSON_PROPERTY_CLIENT_ID, + TemplateCreateRequest.JSON_PROPERTY_FIELD_OPTIONS, + TemplateCreateRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + TemplateCreateRequest.JSON_PROPERTY_FORM_FIELD_RULES, + TemplateCreateRequest.JSON_PROPERTY_MERGE_FIELDS, + TemplateCreateRequest.JSON_PROPERTY_MESSAGE, + TemplateCreateRequest.JSON_PROPERTY_METADATA, + TemplateCreateRequest.JSON_PROPERTY_SUBJECT, + TemplateCreateRequest.JSON_PROPERTY_TEST_MODE, + TemplateCreateRequest.JSON_PROPERTY_TITLE, + TemplateCreateRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateCreateRequest { - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - - @javax.annotation.Nonnull - private List formFieldsPerDocument = new ArrayList<>(); - - public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; - @javax.annotation.Nonnull private List signerRoles = new ArrayList<>(); - - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; - - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; - - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - @javax.annotation.Nullable private Boolean allowReassign = false; - - public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; - @javax.annotation.Nullable private Boolean allowFormView = false; - - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - @javax.annotation.Nullable private List attachments = null; - - public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - @javax.annotation.Nullable private List ccRoles = null; - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nullable private String clientId; - - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - @javax.annotation.Nullable private SubFieldOptions fieldOptions; - - public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - @javax.annotation.Nullable private List formFieldGroups = null; - - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - @javax.annotation.Nullable private List formFieldRules = null; + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + @javax.annotation.Nonnull + private List formFieldsPerDocument = new ArrayList<>(); + + public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; + @javax.annotation.Nonnull + private List signerRoles = new ArrayList<>(); + + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + @javax.annotation.Nullable + private Boolean allowReassign = false; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @javax.annotation.Nullable + private Boolean allowFormView = false; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + @javax.annotation.Nullable + private List attachments = null; + + public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; + @javax.annotation.Nullable + private List ccRoles = null; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + @javax.annotation.Nullable + private SubFieldOptions fieldOptions; + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + @javax.annotation.Nullable + private List formFieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + @javax.annotation.Nullable + private List formFieldRules = null; + + public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; + @javax.annotation.Nullable + private List mergeFields = null; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; + @javax.annotation.Nullable + private Boolean usePreexistingFields = false; + + public TemplateCreateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateCreateRequest.class); + } + + static public TemplateCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateCreateRequest.class + ); + } + + public TemplateCreateRequest formFieldsPerDocument(@javax.annotation.Nonnull List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public TemplateCreateRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; + } + + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * @return formFieldsPerDocument + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFormFieldsPerDocument(@javax.annotation.Nonnull List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + + public TemplateCreateRequest signerRoles(@javax.annotation.Nonnull List signerRoles) { + this.signerRoles = signerRoles; + return this; + } + + public TemplateCreateRequest addSignerRolesItem(SubTemplateRole signerRolesItem) { + if (this.signerRoles == null) { + this.signerRoles = new ArrayList<>(); + } + this.signerRoles.add(signerRolesItem); + return this; + } + + /** + * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. + * @return signerRoles + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getSignerRoles() { + return signerRoles; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignerRoles(@javax.annotation.Nonnull List signerRoles) { + this.signerRoles = signerRoles; + } + + + public TemplateCreateRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public TemplateCreateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public TemplateCreateRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public TemplateCreateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; - @javax.annotation.Nullable private List mergeFields = null; + public List getFileUrls() { + return fileUrls; + } - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; - @javax.annotation.Nullable private Boolean usePreexistingFields = false; - - public TemplateCreateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateCreateRequest.class); - } - - public static TemplateCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), TemplateCreateRequest.class); + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public TemplateCreateRequest allowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } + + /** + * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + * @return allowReassign + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowReassign() { + return allowReassign; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + } + + + public TemplateCreateRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. + * @return allowFormView + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + public TemplateCreateRequest attachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + return this; + } + + public TemplateCreateRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); } - - public TemplateCreateRequest formFieldsPerDocument( - @javax.annotation.Nonnull List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; + this.attachments.add(attachmentsItem); + return this; + } + + /** + * A list describing the attachments + * @return attachments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + } + + + public TemplateCreateRequest ccRoles(@javax.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + return this; + } + + public TemplateCreateRequest addCcRolesItem(String ccRolesItem) { + if (this.ccRoles == null) { + this.ccRoles = new ArrayList<>(); } + this.ccRoles.add(ccRolesItem); + return this; + } + + /** + * The CC roles that must be assigned when using the template to send a signature request + * @return ccRoles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcRoles() { + return ccRoles; + } + + + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcRoles(@javax.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + } + + + public TemplateCreateRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + - public TemplateCreateRequest addFormFieldsPerDocumentItem( - SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); - } - this.formFieldsPerDocument.add(formFieldsPerDocumentItem); - return this; - } + public TemplateCreateRequest fieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * @return fieldOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } + + + public TemplateCreateRequest formFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } - /** - * The fields that should appear on the document, expressed as an array of objects. (For more - * details you can read about it here: [Using Form Fields per - * Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, - * **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and - * optional parameters. Check out the list of [additional - * parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text - * Field use `SubFormFieldsPerDocumentText` * Dropdown Field use - * `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use - * `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use - * `SubFormFieldsPerDocumentCheckbox` * Radio Field use - * `SubFormFieldsPerDocumentRadio` * Signature Field use - * `SubFormFieldsPerDocumentSignature` * Date Signed Field use - * `SubFormFieldsPerDocumentDateSigned` * Initials Field use - * `SubFormFieldsPerDocumentInitials` * Text Merge Field use - * `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use - * `SubFormFieldsPerDocumentCheckboxMerge` - * - * @return formFieldsPerDocument - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } + public TemplateCreateRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); + } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } + + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * @return formFieldGroups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldGroups() { + return formFieldGroups; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + + public TemplateCreateRequest formFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFormFieldsPerDocument( - @javax.annotation.Nonnull List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } + public TemplateCreateRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); + } + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * @return formFieldRules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldRules() { + return formFieldRules; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + + public TemplateCreateRequest mergeFields(@javax.annotation.Nullable List mergeFields) { + this.mergeFields = mergeFields; + return this; + } + + public TemplateCreateRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { + if (this.mergeFields == null) { + this.mergeFields = new ArrayList<>(); + } + this.mergeFields.add(mergeFieldsItem); + return this; + } + + /** + * Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. + * @return mergeFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMergeFields() { + return mergeFields; + } + + + @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMergeFields(@javax.annotation.Nullable List mergeFields) { + this.mergeFields = mergeFields; + } + + + public TemplateCreateRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The default template email message. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public TemplateCreateRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public TemplateCreateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } - public TemplateCreateRequest signerRoles( - @javax.annotation.Nonnull List signerRoles) { - this.signerRoles = signerRoles; - return this; - } - public TemplateCreateRequest addSignerRolesItem(SubTemplateRole signerRolesItem) { - if (this.signerRoles == null) { - this.signerRoles = new ArrayList<>(); + public TemplateCreateRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The template title (alias). + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public TemplateCreateRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public TemplateCreateRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public TemplateCreateRequest usePreexistingFields(@javax.annotation.Nullable Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + return this; + } + + /** + * Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). + * @return usePreexistingFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUsePreexistingFields() { + return usePreexistingFields; + } + + + @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsePreexistingFields(@javax.annotation.Nullable Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + } + + + /** + * Return true if this TemplateCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateCreateRequest templateCreateRequest = (TemplateCreateRequest) o; + return Objects.equals(this.formFieldsPerDocument, templateCreateRequest.formFieldsPerDocument) && + Objects.equals(this.signerRoles, templateCreateRequest.signerRoles) && + Objects.equals(this.files, templateCreateRequest.files) && + Objects.equals(this.fileUrls, templateCreateRequest.fileUrls) && + Objects.equals(this.allowReassign, templateCreateRequest.allowReassign) && + Objects.equals(this.allowFormView, templateCreateRequest.allowFormView) && + Objects.equals(this.attachments, templateCreateRequest.attachments) && + Objects.equals(this.ccRoles, templateCreateRequest.ccRoles) && + Objects.equals(this.clientId, templateCreateRequest.clientId) && + Objects.equals(this.fieldOptions, templateCreateRequest.fieldOptions) && + Objects.equals(this.formFieldGroups, templateCreateRequest.formFieldGroups) && + Objects.equals(this.formFieldRules, templateCreateRequest.formFieldRules) && + Objects.equals(this.mergeFields, templateCreateRequest.mergeFields) && + Objects.equals(this.message, templateCreateRequest.message) && + Objects.equals(this.metadata, templateCreateRequest.metadata) && + Objects.equals(this.subject, templateCreateRequest.subject) && + Objects.equals(this.testMode, templateCreateRequest.testMode) && + Objects.equals(this.title, templateCreateRequest.title) && + Objects.equals(this.usePreexistingFields, templateCreateRequest.usePreexistingFields); + } + + @Override + public int hashCode() { + return Objects.hash(formFieldsPerDocument, signerRoles, files, fileUrls, allowReassign, allowFormView, attachments, ccRoles, clientId, fieldOptions, formFieldGroups, formFieldRules, mergeFields, message, metadata, subject, testMode, title, usePreexistingFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateCreateRequest {\n"); + sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); + sb.append(" signerRoles: ").append(toIndentedString(signerRoles)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" mergeFields: ").append(toIndentedString(mergeFields)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" usePreexistingFields: ").append(toIndentedString(usePreexistingFields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; } - this.signerRoles.add(signerRolesItem); - return this; - } - - /** - * An array of the designated signer roles that must be specified when sending a - * SignatureRequest using this Template. - * - * @return signerRoles - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getSignerRoles() { - return signerRoles; - } - - @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSignerRoles(@javax.annotation.Nonnull List signerRoles) { - this.signerRoles = signerRoles; - } - - public TemplateCreateRequest files(@javax.annotation.Nullable List files) { - this.files = files; - return this; - } - public TemplateCreateRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + if (formFieldsPerDocument.getClass().equals(java.io.File.class) || + formFieldsPerDocument.getClass().equals(Integer.class) || + formFieldsPerDocument.getClass().equals(String.class) || + formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { + map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); + } } - this.files.add(filesItem); - return this; - } - - /** - * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } - - public TemplateCreateRequest fileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public TemplateCreateRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + else { + map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - * This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - public TemplateCreateRequest allowReassign(@javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - return this; - } - - /** - * Allows signers to reassign their signature requests to other signers if set to - * `true`. Defaults to `false`. **NOTE:** Only available for Premium plan - * and higher. - * - * @return allowReassign - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowReassign() { - return allowReassign; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - } - - public TemplateCreateRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - return this; } - - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to - * `false`. - * - * @return allowFormView - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowFormView() { - return allowFormView; - } - - @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - } - - public TemplateCreateRequest attachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; - return this; - } - - public TemplateCreateRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); + if (signerRoles != null) { + if (isFileTypeOrListOfFiles(signerRoles)) { + fileTypeFound = true; } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * - * @return attachments - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAttachments() { - return attachments; - } - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(@javax.annotation.Nullable List attachments) { - this.attachments = attachments; - } - - public TemplateCreateRequest ccRoles(@javax.annotation.Nullable List ccRoles) { - this.ccRoles = ccRoles; - return this; - } - public TemplateCreateRequest addCcRolesItem(String ccRolesItem) { - if (this.ccRoles == null) { - this.ccRoles = new ArrayList<>(); + if (signerRoles.getClass().equals(java.io.File.class) || + signerRoles.getClass().equals(Integer.class) || + signerRoles.getClass().equals(String.class) || + signerRoles.getClass().isEnum()) { + map.put("signer_roles", signerRoles); + } else if (isListOfFile(signerRoles)) { + for(int i = 0; i< getListSize(signerRoles); i++) { + map.put("signer_roles[" + i + "]", getFromList(signerRoles, i)); + } } - this.ccRoles.add(ccRolesItem); - return this; - } - - /** - * The CC roles that must be assigned when using the template to send a signature request - * - * @return ccRoles - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcRoles() { - return ccRoles; - } - - @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcRoles(@javax.annotation.Nullable List ccRoles) { - this.ccRoles = ccRoles; - } - - public TemplateCreateRequest clientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Client id of the app you're using to create this draft. Used to apply the branding and - * callback url defined for the app. - * - * @return clientId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - } - - public TemplateCreateRequest fieldOptions( - @javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * - * @return fieldOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - public TemplateCreateRequest formFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } - - public TemplateCreateRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); + else { + map.put("signer_roles", JSON.getDefault().getMapper().writeValueAsString(signerRoles)); } - this.formFieldGroups.add(formFieldGroupsItem); - return this; } - - /** - * Group information for fields defined in `form_fields_per_document`. String-indexed - * JSON array with `group_label` and `requirement` keys. - * `form_fields_per_document` must contain fields referencing a group defined in - * `form_field_groups`. - * - * @return formFieldGroups - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldGroups() { - return formFieldGroups; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - public TemplateCreateRequest formFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - - public TemplateCreateRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * - * @return formFieldRules - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldRules() { - return formFieldRules; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - public TemplateCreateRequest mergeFields( - @javax.annotation.Nullable List mergeFields) { - this.mergeFields = mergeFields; - return this; - } - public TemplateCreateRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { - if (this.mergeFields == null) { - this.mergeFields = new ArrayList<>(); + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } } - this.mergeFields.add(mergeFieldsItem); - return this; - } - - /** - * Add merge fields to the template. Merge fields are placed by the user creating the template - * and used to pre-fill data by passing values into signature requests with the - * `custom_fields` parameter. If the signature request using that template *does not* - * pass a value into a merge field, then an empty field remains in the document. - * - * @return mergeFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getMergeFields() { - return mergeFields; - } - - @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMergeFields(@javax.annotation.Nullable List mergeFields) { - this.mergeFields = mergeFields; - } - - public TemplateCreateRequest message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The default template email message. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public TemplateCreateRequest metadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public TemplateCreateRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); } - this.metadata.put(key, metadataItem); - return this; } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; + if (allowReassign.getClass().equals(java.io.File.class) || + allowReassign.getClass().equals(Integer.class) || + allowReassign.getClass().equals(String.class) || + allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for(int i = 0; i< getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } + else { + map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } - public TemplateCreateRequest subject(@javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } - /** - * The template title (alias). - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + } } + if (ccRoles != null) { + if (isFileTypeOrListOfFiles(ccRoles)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (ccRoles.getClass().equals(java.io.File.class) || + ccRoles.getClass().equals(Integer.class) || + ccRoles.getClass().equals(String.class) || + ccRoles.getClass().isEnum()) { + map.put("cc_roles", ccRoles); + } else if (isListOfFile(ccRoles)) { + for(int i = 0; i< getListSize(ccRoles); i++) { + map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); + } + } + else { + map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + } } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } - public TemplateCreateRequest testMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request created from this draft will not be legally - * binding if set to `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (fieldOptions.getClass().equals(java.io.File.class) || + fieldOptions.getClass().equals(Integer.class) || + fieldOptions.getClass().equals(String.class) || + fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for(int i = 0; i< getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } + else { + map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (formFieldGroups.getClass().equals(java.io.File.class) || + formFieldGroups.getClass().equals(Integer.class) || + formFieldGroups.getClass().equals(String.class) || + formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for(int i = 0; i< getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } + else { + map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } - public TemplateCreateRequest title(@javax.annotation.Nullable String title) { - this.title = title; - return this; + if (formFieldRules.getClass().equals(java.io.File.class) || + formFieldRules.getClass().equals(Integer.class) || + formFieldRules.getClass().equals(String.class) || + formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for(int i = 0; i< getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } + else { + map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } } + if (mergeFields != null) { + if (isFileTypeOrListOfFiles(mergeFields)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (mergeFields.getClass().equals(java.io.File.class) || + mergeFields.getClass().equals(Integer.class) || + mergeFields.getClass().equals(String.class) || + mergeFields.getClass().isEnum()) { + map.put("merge_fields", mergeFields); + } else if (isListOfFile(mergeFields)) { + for(int i = 0; i< getListSize(mergeFields); i++) { + map.put("merge_fields[" + i + "]", getFromList(mergeFields, i)); + } + } + else { + map.put("merge_fields", JSON.getDefault().getMapper().writeValueAsString(mergeFields)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - public TemplateCreateRequest usePreexistingFields( - @javax.annotation.Nullable Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; - return this; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - /** - * Enable the detection of predefined PDF fields by setting the - * `use_preexisting_fields` to `true` (defaults to disabled, or - * `false`). - * - * @return usePreexistingFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getUsePreexistingFields() { - return usePreexistingFields; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsePreexistingFields(@javax.annotation.Nullable Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - /** Return true if this TemplateCreateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); } - TemplateCreateRequest templateCreateRequest = (TemplateCreateRequest) o; - return Objects.equals( - this.formFieldsPerDocument, templateCreateRequest.formFieldsPerDocument) - && Objects.equals(this.signerRoles, templateCreateRequest.signerRoles) - && Objects.equals(this.files, templateCreateRequest.files) - && Objects.equals(this.fileUrls, templateCreateRequest.fileUrls) - && Objects.equals(this.allowReassign, templateCreateRequest.allowReassign) - && Objects.equals(this.allowFormView, templateCreateRequest.allowFormView) - && Objects.equals(this.attachments, templateCreateRequest.attachments) - && Objects.equals(this.ccRoles, templateCreateRequest.ccRoles) - && Objects.equals(this.clientId, templateCreateRequest.clientId) - && Objects.equals(this.fieldOptions, templateCreateRequest.fieldOptions) - && Objects.equals(this.formFieldGroups, templateCreateRequest.formFieldGroups) - && Objects.equals(this.formFieldRules, templateCreateRequest.formFieldRules) - && Objects.equals(this.mergeFields, templateCreateRequest.mergeFields) - && Objects.equals(this.message, templateCreateRequest.message) - && Objects.equals(this.metadata, templateCreateRequest.metadata) - && Objects.equals(this.subject, templateCreateRequest.subject) - && Objects.equals(this.testMode, templateCreateRequest.testMode) - && Objects.equals(this.title, templateCreateRequest.title) - && Objects.equals( - this.usePreexistingFields, templateCreateRequest.usePreexistingFields); } + if (usePreexistingFields != null) { + if (isFileTypeOrListOfFiles(usePreexistingFields)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - formFieldsPerDocument, - signerRoles, - files, - fileUrls, - allowReassign, - allowFormView, - attachments, - ccRoles, - clientId, - fieldOptions, - formFieldGroups, - formFieldRules, - mergeFields, - message, - metadata, - subject, - testMode, - title, - usePreexistingFields); + if (usePreexistingFields.getClass().equals(java.io.File.class) || + usePreexistingFields.getClass().equals(Integer.class) || + usePreexistingFields.getClass().equals(String.class) || + usePreexistingFields.getClass().isEnum()) { + map.put("use_preexisting_fields", usePreexistingFields); + } else if (isListOfFile(usePreexistingFields)) { + for(int i = 0; i< getListSize(usePreexistingFields); i++) { + map.put("use_preexisting_fields[" + i + "]", getFromList(usePreexistingFields, i)); + } + } + else { + map.put("use_preexisting_fields", JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateCreateRequest {\n"); - sb.append(" formFieldsPerDocument: ") - .append(toIndentedString(formFieldsPerDocument)) - .append("\n"); - sb.append(" signerRoles: ").append(toIndentedString(signerRoles)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" mergeFields: ").append(toIndentedString(mergeFields)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" usePreexistingFields: ") - .append(toIndentedString(usePreexistingFields)) - .append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - - if (formFieldsPerDocument.getClass().equals(java.io.File.class) - || formFieldsPerDocument.getClass().equals(Integer.class) - || formFieldsPerDocument.getClass().equals(String.class) - || formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { - map.put( - "form_fields_per_document[" + i + "]", - getFromList(formFieldsPerDocument, i)); - } - } else { - map.put( - "form_fields_per_document", - JSON.getDefault() - .getMapper() - .writeValueAsString(formFieldsPerDocument)); - } - } - if (signerRoles != null) { - if (isFileTypeOrListOfFiles(signerRoles)) { - fileTypeFound = true; - } - - if (signerRoles.getClass().equals(java.io.File.class) - || signerRoles.getClass().equals(Integer.class) - || signerRoles.getClass().equals(String.class) - || signerRoles.getClass().isEnum()) { - map.put("signer_roles", signerRoles); - } else if (isListOfFile(signerRoles)) { - for (int i = 0; i < getListSize(signerRoles); i++) { - map.put("signer_roles[" + i + "]", getFromList(signerRoles, i)); - } - } else { - map.put( - "signer_roles", - JSON.getDefault().getMapper().writeValueAsString(signerRoles)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - - if (allowReassign.getClass().equals(java.io.File.class) - || allowReassign.getClass().equals(Integer.class) - || allowReassign.getClass().equals(String.class) - || allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for (int i = 0; i < getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } else { - map.put( - "allow_reassign", - JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } - } - if (allowFormView != null) { - if (isFileTypeOrListOfFiles(allowFormView)) { - fileTypeFound = true; - } - - if (allowFormView.getClass().equals(java.io.File.class) - || allowFormView.getClass().equals(Integer.class) - || allowFormView.getClass().equals(String.class) - || allowFormView.getClass().isEnum()) { - map.put("allow_form_view", allowFormView); - } else if (isListOfFile(allowFormView)) { - for (int i = 0; i < getListSize(allowFormView); i++) { - map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); - } - } else { - map.put( - "allow_form_view", - JSON.getDefault().getMapper().writeValueAsString(allowFormView)); - } - } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - - if (attachments.getClass().equals(java.io.File.class) - || attachments.getClass().equals(Integer.class) - || attachments.getClass().equals(String.class) - || attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for (int i = 0; i < getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } else { - map.put( - "attachments", - JSON.getDefault().getMapper().writeValueAsString(attachments)); - } - } - if (ccRoles != null) { - if (isFileTypeOrListOfFiles(ccRoles)) { - fileTypeFound = true; - } - - if (ccRoles.getClass().equals(java.io.File.class) - || ccRoles.getClass().equals(Integer.class) - || ccRoles.getClass().equals(String.class) - || ccRoles.getClass().isEnum()) { - map.put("cc_roles", ccRoles); - } else if (isListOfFile(ccRoles)) { - for (int i = 0; i < getListSize(ccRoles); i++) { - map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); - } - } else { - map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - - if (fieldOptions.getClass().equals(java.io.File.class) - || fieldOptions.getClass().equals(Integer.class) - || fieldOptions.getClass().equals(String.class) - || fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for (int i = 0; i < getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } else { - map.put( - "field_options", - JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } - } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - - if (formFieldGroups.getClass().equals(java.io.File.class) - || formFieldGroups.getClass().equals(Integer.class) - || formFieldGroups.getClass().equals(String.class) - || formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for (int i = 0; i < getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } else { - map.put( - "form_field_groups", - JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } - } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - - if (formFieldRules.getClass().equals(java.io.File.class) - || formFieldRules.getClass().equals(Integer.class) - || formFieldRules.getClass().equals(String.class) - || formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for (int i = 0; i < getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } else { - map.put( - "form_field_rules", - JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } - } - if (mergeFields != null) { - if (isFileTypeOrListOfFiles(mergeFields)) { - fileTypeFound = true; - } - - if (mergeFields.getClass().equals(java.io.File.class) - || mergeFields.getClass().equals(Integer.class) - || mergeFields.getClass().equals(String.class) - || mergeFields.getClass().isEnum()) { - map.put("merge_fields", mergeFields); - } else if (isListOfFile(mergeFields)) { - for (int i = 0; i < getListSize(mergeFields); i++) { - map.put("merge_fields[" + i + "]", getFromList(mergeFields, i)); - } - } else { - map.put( - "merge_fields", - JSON.getDefault().getMapper().writeValueAsString(mergeFields)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (usePreexistingFields != null) { - if (isFileTypeOrListOfFiles(usePreexistingFields)) { - fileTypeFound = true; - } - - if (usePreexistingFields.getClass().equals(java.io.File.class) - || usePreexistingFields.getClass().equals(Integer.class) - || usePreexistingFields.getClass().equals(String.class) - || usePreexistingFields.getClass().isEnum()) { - map.put("use_preexisting_fields", usePreexistingFields); - } else if (isListOfFile(usePreexistingFields)) { - for (int i = 0; i < getListSize(usePreexistingFields); i++) { - map.put( - "use_preexisting_fields[" + i + "]", - getFromList(usePreexistingFields, i)); - } - } else { - map.put( - "use_preexisting_fields", - JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java index 511bb2391..41653397d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java @@ -10,218 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateCreateResponseTemplate; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** TemplateCreateResponse */ + +import com.dropbox.sign.ApiException; +/** + * TemplateCreateResponse + */ @JsonPropertyOrder({ - TemplateCreateResponse.JSON_PROPERTY_TEMPLATE, - TemplateCreateResponse.JSON_PROPERTY_WARNINGS + TemplateCreateResponse.JSON_PROPERTY_TEMPLATE, + TemplateCreateResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateCreateResponse { - public static final String JSON_PROPERTY_TEMPLATE = "template"; - @javax.annotation.Nonnull private TemplateCreateResponseTemplate template; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public TemplateCreateResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateCreateResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateCreateResponse.class); - } - - public static TemplateCreateResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), TemplateCreateResponse.class); - } - - public TemplateCreateResponse template( - @javax.annotation.Nonnull TemplateCreateResponseTemplate template) { - this.template = template; - return this; - } - - /** - * Get template - * - * @return template - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TemplateCreateResponseTemplate getTemplate() { - return template; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplate(@javax.annotation.Nonnull TemplateCreateResponseTemplate template) { - this.template = template; - } - - public TemplateCreateResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public TemplateCreateResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_TEMPLATE = "template"; + @javax.annotation.Nonnull + private TemplateCreateResponseTemplate template; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public TemplateCreateResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateCreateResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateCreateResponse.class); + } + + static public TemplateCreateResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateCreateResponse.class + ); + } + + public TemplateCreateResponse template(@javax.annotation.Nonnull TemplateCreateResponseTemplate template) { + this.template = template; + return this; + } + + /** + * Get template + * @return template + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TemplateCreateResponseTemplate getTemplate() { + return template; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplate(@javax.annotation.Nonnull TemplateCreateResponseTemplate template) { + this.template = template; + } + + + public TemplateCreateResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TemplateCreateResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this TemplateCreateResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateCreateResponse templateCreateResponse = (TemplateCreateResponse) o; + return Objects.equals(this.template, templateCreateResponse.template) && + Objects.equals(this.warnings, templateCreateResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(template, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateCreateResponse {\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (template != null) { + if (isFileTypeOrListOfFiles(template)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this TemplateCreateResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (template.getClass().equals(java.io.File.class) || + template.getClass().equals(Integer.class) || + template.getClass().equals(String.class) || + template.getClass().isEnum()) { + map.put("template", template); + } else if (isListOfFile(template)) { + for(int i = 0; i< getListSize(template); i++) { + map.put("template[" + i + "]", getFromList(template, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); } - TemplateCreateResponse templateCreateResponse = (TemplateCreateResponse) o; - return Objects.equals(this.template, templateCreateResponse.template) - && Objects.equals(this.warnings, templateCreateResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(template, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateCreateResponse {\n"); - sb.append(" template: ").append(toIndentedString(template)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (template != null) { - if (isFileTypeOrListOfFiles(template)) { - fileTypeFound = true; - } - - if (template.getClass().equals(java.io.File.class) - || template.getClass().equals(Integer.class) - || template.getClass().equals(String.class) - || template.getClass().isEnum()) { - map.put("template", template); - } else if (isListOfFile(template)) { - for (int i = 0; i < getListSize(template); i++) { - map.put("template[" + i + "]", getFromList(template, i)); - } - } else { - map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java index 5368e41b3..3af552c0e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java @@ -10,161 +10,170 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** Template object with parameters: `template_id`. */ -@JsonPropertyOrder({TemplateCreateResponseTemplate.JSON_PROPERTY_TEMPLATE_ID}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class TemplateCreateResponseTemplate { - public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; - @javax.annotation.Nullable private String templateId; - - public TemplateCreateResponseTemplate() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateCreateResponseTemplate init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateCreateResponseTemplate.class); - } - public static TemplateCreateResponseTemplate init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateCreateResponseTemplate.class); - } - - public TemplateCreateResponseTemplate templateId(@javax.annotation.Nullable String templateId) { - this.templateId = templateId; - return this; - } - - /** - * The id of the Template. - * - * @return templateId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTemplateId() { - return templateId; +import com.dropbox.sign.ApiException; +/** + * Template object with parameters: `template_id`. + */ +@JsonPropertyOrder({ + TemplateCreateResponseTemplate.JSON_PROPERTY_TEMPLATE_ID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateCreateResponseTemplate { + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + @javax.annotation.Nullable + private String templateId; + + public TemplateCreateResponseTemplate() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateCreateResponseTemplate init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateCreateResponseTemplate.class); + } + + static public TemplateCreateResponseTemplate init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateCreateResponseTemplate.class + ); + } + + public TemplateCreateResponseTemplate templateId(@javax.annotation.Nullable String templateId) { + this.templateId = templateId; + return this; + } + + /** + * The id of the Template. + * @return templateId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(@javax.annotation.Nullable String templateId) { + this.templateId = templateId; + } + + + /** + * Return true if this TemplateCreateResponseTemplate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplateId(@javax.annotation.Nullable String templateId) { - this.templateId = templateId; + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateCreateResponseTemplate templateCreateResponseTemplate = (TemplateCreateResponseTemplate) o; + return Objects.equals(this.templateId, templateCreateResponseTemplate.templateId); + } + + @Override + public int hashCode() { + return Objects.hash(templateId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateCreateResponseTemplate {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateId != null) { + if (isFileTypeOrListOfFiles(templateId)) { + fileTypeFound = true; + } - /** Return true if this TemplateCreateResponseTemplate object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (templateId.getClass().equals(java.io.File.class) || + templateId.getClass().equals(Integer.class) || + templateId.getClass().equals(String.class) || + templateId.getClass().isEnum()) { + map.put("template_id", templateId); + } else if (isListOfFile(templateId)) { + for(int i = 0; i< getListSize(templateId); i++) { + map.put("template_id[" + i + "]", getFromList(templateId, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); } - TemplateCreateResponseTemplate templateCreateResponseTemplate = - (TemplateCreateResponseTemplate) o; - return Objects.equals(this.templateId, templateCreateResponseTemplate.templateId); } - - @Override - public int hashCode() { - return Objects.hash(templateId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateCreateResponseTemplate {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { - fileTypeFound = true; - } - - if (templateId.getClass().equals(java.io.File.class) - || templateId.getClass().equals(Integer.class) - || templateId.getClass().equals(String.class) - || templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for (int i = 0; i < getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); - } - } else { - map.put( - "template_id", - JSON.getDefault().getMapper().writeValueAsString(templateId)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditRequest.java new file mode 100644 index 000000000..9c3788116 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditRequest.java @@ -0,0 +1,393 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * TemplateEditRequest + */ +@JsonPropertyOrder({ + TemplateEditRequest.JSON_PROPERTY_CC_ROLES, + TemplateEditRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, + TemplateEditRequest.JSON_PROPERTY_TITLE, + TemplateEditRequest.JSON_PROPERTY_SUBJECT, + TemplateEditRequest.JSON_PROPERTY_MESSAGE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateEditRequest { + public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; + @javax.annotation.Nullable + private List ccRoles = null; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @javax.annotation.Nullable + private Boolean allowFormView; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public TemplateEditRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateEditRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateEditRequest.class); + } + + static public TemplateEditRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateEditRequest.class + ); + } + + public TemplateEditRequest ccRoles(@javax.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + return this; + } + + public TemplateEditRequest addCcRolesItem(String ccRolesItem) { + if (this.ccRoles == null) { + this.ccRoles = new ArrayList<>(); + } + this.ccRoles.add(ccRolesItem); + return this; + } + + /** + * _t__TemplateEdit::CC_ROLES + * @return ccRoles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcRoles() { + return ccRoles; + } + + + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcRoles(@javax.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + } + + + public TemplateEditRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * _t__TemplateEdit::ALLOW_FORM_VIEW + * @return allowFormView + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + public TemplateEditRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * _t__TemplateEdit::TITLE + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public TemplateEditRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * _t__TemplateEdit::SUBJECT + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public TemplateEditRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * _t__TemplateEdit::MESSAGE + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + /** + * Return true if this TemplateEditRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateEditRequest templateEditRequest = (TemplateEditRequest) o; + return Objects.equals(this.ccRoles, templateEditRequest.ccRoles) && + Objects.equals(this.allowFormView, templateEditRequest.allowFormView) && + Objects.equals(this.title, templateEditRequest.title) && + Objects.equals(this.subject, templateEditRequest.subject) && + Objects.equals(this.message, templateEditRequest.message); + } + + @Override + public int hashCode() { + return Objects.hash(ccRoles, allowFormView, title, subject, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateEditRequest {\n"); + sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (ccRoles != null) { + if (isFileTypeOrListOfFiles(ccRoles)) { + fileTypeFound = true; + } + + if (ccRoles.getClass().equals(java.io.File.class) || + ccRoles.getClass().equals(Integer.class) || + ccRoles.getClass().equals(String.class) || + ccRoles.getClass().isEnum()) { + map.put("cc_roles", ccRoles); + } else if (isListOfFile(ccRoles)) { + for(int i = 0; i< getListSize(ccRoles); i++) { + map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); + } + } + else { + map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + } + } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } + + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java index 095b796a1..507aee187 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java @@ -10,159 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateEditResponseTemplate; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TemplateEditResponse */ -@JsonPropertyOrder({TemplateEditResponse.JSON_PROPERTY_TEMPLATE_ID}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class TemplateEditResponse { - public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; - @javax.annotation.Nonnull private String templateId; - - public TemplateEditResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateEditResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateEditResponse.class); - } - public static TemplateEditResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TemplateEditResponse.class); - } - - public TemplateEditResponse templateId(@javax.annotation.Nonnull String templateId) { - this.templateId = templateId; - return this; +import com.dropbox.sign.ApiException; +/** + * TemplateEditResponse + */ +@JsonPropertyOrder({ + TemplateEditResponse.JSON_PROPERTY_TEMPLATE, + TemplateEditResponse.JSON_PROPERTY_WARNINGS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateEditResponse { + public static final String JSON_PROPERTY_TEMPLATE = "template"; + @javax.annotation.Nullable + private TemplateEditResponseTemplate template; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public TemplateEditResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateEditResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateEditResponse.class); + } + + static public TemplateEditResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateEditResponse.class + ); + } + + public TemplateEditResponse template(@javax.annotation.Nullable TemplateEditResponseTemplate template) { + this.template = template; + return this; + } + + /** + * Get template + * @return template + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TemplateEditResponseTemplate getTemplate() { + return template; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplate(@javax.annotation.Nullable TemplateEditResponseTemplate template) { + this.template = template; + } + + + public TemplateEditResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TemplateEditResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } - - /** - * The id of the Template. - * - * @return templateId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTemplateId() { - return templateId; + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this TemplateEditResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateId(@javax.annotation.Nonnull String templateId) { - this.templateId = templateId; + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateEditResponse templateEditResponse = (TemplateEditResponse) o; + return Objects.equals(this.template, templateEditResponse.template) && + Objects.equals(this.warnings, templateEditResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(template, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateEditResponse {\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (template != null) { + if (isFileTypeOrListOfFiles(template)) { + fileTypeFound = true; + } - /** Return true if this TemplateEditResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (template.getClass().equals(java.io.File.class) || + template.getClass().equals(Integer.class) || + template.getClass().equals(String.class) || + template.getClass().isEnum()) { + map.put("template", template); + } else if (isListOfFile(template)) { + for(int i = 0; i< getListSize(template); i++) { + map.put("template[" + i + "]", getFromList(template, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); } - TemplateEditResponse templateEditResponse = (TemplateEditResponse) o; - return Objects.equals(this.templateId, templateEditResponse.templateId); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(templateId); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateEditResponse {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { - fileTypeFound = true; - } - - if (templateId.getClass().equals(java.io.File.class) - || templateId.getClass().equals(Integer.class) - || templateId.getClass().equals(String.class) - || templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for (int i = 0; i < getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); - } - } else { - map.put( - "template_id", - JSON.getDefault().getMapper().writeValueAsString(templateId)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponseTemplate.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponseTemplate.java new file mode 100644 index 000000000..9eb56cb21 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponseTemplate.java @@ -0,0 +1,179 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * _t__TemplateEditResponseTemplate::DESCRIPTION + */ +@JsonPropertyOrder({ + TemplateEditResponseTemplate.JSON_PROPERTY_TEMPLATE_ID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateEditResponseTemplate { + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + @javax.annotation.Nullable + private String templateId; + + public TemplateEditResponseTemplate() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateEditResponseTemplate init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateEditResponseTemplate.class); + } + + static public TemplateEditResponseTemplate init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateEditResponseTemplate.class + ); + } + + public TemplateEditResponseTemplate templateId(@javax.annotation.Nullable String templateId) { + this.templateId = templateId; + return this; + } + + /** + * The id of the Template. + * @return templateId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(@javax.annotation.Nullable String templateId) { + this.templateId = templateId; + } + + + /** + * Return true if this TemplateEditResponseTemplate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateEditResponseTemplate templateEditResponseTemplate = (TemplateEditResponseTemplate) o; + return Objects.equals(this.templateId, templateEditResponseTemplate.templateId); + } + + @Override + public int hashCode() { + return Objects.hash(templateId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateEditResponseTemplate {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateId != null) { + if (isFileTypeOrListOfFiles(templateId)) { + fileTypeFound = true; + } + + if (templateId.getClass().equals(java.io.File.class) || + templateId.getClass().equals(Integer.class) || + templateId.getClass().equals(String.class) || + templateId.getClass().isEnum()) { + map.put("template_id", templateId); + } else if (isListOfFile(templateId)) { + for(int i = 0; i< getListSize(templateId); i++) { + map.put("template_id[" + i + "]", getFromList(templateId, i)); + } + } + else { + map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java index f1e79244d..5a32b2640 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java @@ -10,215 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** TemplateGetResponse */ + +import com.dropbox.sign.ApiException; +/** + * TemplateGetResponse + */ @JsonPropertyOrder({ - TemplateGetResponse.JSON_PROPERTY_TEMPLATE, - TemplateGetResponse.JSON_PROPERTY_WARNINGS + TemplateGetResponse.JSON_PROPERTY_TEMPLATE, + TemplateGetResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateGetResponse { - public static final String JSON_PROPERTY_TEMPLATE = "template"; - @javax.annotation.Nonnull private TemplateResponse template; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public TemplateGetResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateGetResponse.class); - } - - public static TemplateGetResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TemplateGetResponse.class); - } - - public TemplateGetResponse template(@javax.annotation.Nonnull TemplateResponse template) { - this.template = template; - return this; - } - - /** - * Get template - * - * @return template - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TemplateResponse getTemplate() { - return template; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplate(@javax.annotation.Nonnull TemplateResponse template) { - this.template = template; - } - - public TemplateGetResponse warnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public TemplateGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_TEMPLATE = "template"; + @javax.annotation.Nonnull + private TemplateResponse template; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public TemplateGetResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateGetResponse.class); + } + + static public TemplateGetResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateGetResponse.class + ); + } + + public TemplateGetResponse template(@javax.annotation.Nonnull TemplateResponse template) { + this.template = template; + return this; + } + + /** + * Get template + * @return template + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TemplateResponse getTemplate() { + return template; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplate(@javax.annotation.Nonnull TemplateResponse template) { + this.template = template; + } + + + public TemplateGetResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TemplateGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this TemplateGetResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateGetResponse templateGetResponse = (TemplateGetResponse) o; + return Objects.equals(this.template, templateGetResponse.template) && + Objects.equals(this.warnings, templateGetResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(template, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateGetResponse {\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (template != null) { + if (isFileTypeOrListOfFiles(template)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this TemplateGetResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (template.getClass().equals(java.io.File.class) || + template.getClass().equals(Integer.class) || + template.getClass().equals(String.class) || + template.getClass().isEnum()) { + map.put("template", template); + } else if (isListOfFile(template)) { + for(int i = 0; i< getListSize(template); i++) { + map.put("template[" + i + "]", getFromList(template, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); } - TemplateGetResponse templateGetResponse = (TemplateGetResponse) o; - return Objects.equals(this.template, templateGetResponse.template) - && Objects.equals(this.warnings, templateGetResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(template, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateGetResponse {\n"); - sb.append(" template: ").append(toIndentedString(template)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (template != null) { - if (isFileTypeOrListOfFiles(template)) { - fileTypeFound = true; - } - - if (template.getClass().equals(java.io.File.class) - || template.getClass().equals(Integer.class) - || template.getClass().equals(String.class) - || template.getClass().isEnum()) { - map.put("template", template); - } else if (isListOfFile(template)) { - for (int i = 0; i < getListSize(template); i++) { - map.put("template[" + i + "]", getFromList(template, i)); - } - } else { - map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateListResponse.java index 624836a79..0c08eaafe 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateListResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateListResponse.java @@ -10,276 +10,293 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.ListInfoResponse; +import com.dropbox.sign.model.TemplateResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** TemplateListResponse */ +import com.dropbox.sign.ApiException; +/** + * TemplateListResponse + */ @JsonPropertyOrder({ - TemplateListResponse.JSON_PROPERTY_TEMPLATES, - TemplateListResponse.JSON_PROPERTY_LIST_INFO, - TemplateListResponse.JSON_PROPERTY_WARNINGS + TemplateListResponse.JSON_PROPERTY_TEMPLATES, + TemplateListResponse.JSON_PROPERTY_LIST_INFO, + TemplateListResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateListResponse { - public static final String JSON_PROPERTY_TEMPLATES = "templates"; - @javax.annotation.Nonnull private List templates = new ArrayList<>(); - - public static final String JSON_PROPERTY_LIST_INFO = "list_info"; - @javax.annotation.Nonnull private ListInfoResponse listInfo; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public TemplateListResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateListResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateListResponse.class); - } - - public static TemplateListResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TemplateListResponse.class); + public static final String JSON_PROPERTY_TEMPLATES = "templates"; + @javax.annotation.Nonnull + private List templates = new ArrayList<>(); + + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + @javax.annotation.Nonnull + private ListInfoResponse listInfo; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public TemplateListResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateListResponse.class); + } + + static public TemplateListResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateListResponse.class + ); + } + + public TemplateListResponse templates(@javax.annotation.Nonnull List templates) { + this.templates = templates; + return this; + } + + public TemplateListResponse addTemplatesItem(TemplateResponse templatesItem) { + if (this.templates == null) { + this.templates = new ArrayList<>(); } - - public TemplateListResponse templates( - @javax.annotation.Nonnull List templates) { - this.templates = templates; - return this; - } - - public TemplateListResponse addTemplatesItem(TemplateResponse templatesItem) { - if (this.templates == null) { - this.templates = new ArrayList<>(); - } - this.templates.add(templatesItem); - return this; + this.templates.add(templatesItem); + return this; + } + + /** + * List of templates that the API caller has access to. + * @return templates + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTemplates() { + return templates; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplates(@javax.annotation.Nonnull List templates) { + this.templates = templates; + } + + + public TemplateListResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; + } + + /** + * Get listInfo + * @return listInfo + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ListInfoResponse getListInfo() { + return listInfo; + } + + + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { + this.listInfo = listInfo; + } + + + public TemplateListResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TemplateListResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } - - /** - * List of templates that the API caller has access to. - * - * @return templates - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getTemplates() { - return templates; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplates(@javax.annotation.Nonnull List templates) { - this.templates = templates; + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this TemplateListResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public TemplateListResponse listInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } - - /** - * Get listInfo - * - * @return listInfo - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ListInfoResponse getListInfo() { - return listInfo; - } - - @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setListInfo(@javax.annotation.Nonnull ListInfoResponse listInfo) { - this.listInfo = listInfo; - } - - public TemplateListResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public TemplateListResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + TemplateListResponse templateListResponse = (TemplateListResponse) o; + return Objects.equals(this.templates, templateListResponse.templates) && + Objects.equals(this.listInfo, templateListResponse.listInfo) && + Objects.equals(this.warnings, templateListResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(templates, listInfo, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateListResponse {\n"); + sb.append(" templates: ").append(toIndentedString(templates)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templates != null) { + if (isFileTypeOrListOfFiles(templates)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; + if (templates.getClass().equals(java.io.File.class) || + templates.getClass().equals(Integer.class) || + templates.getClass().equals(String.class) || + templates.getClass().isEnum()) { + map.put("templates", templates); + } else if (isListOfFile(templates)) { + for(int i = 0; i< getListSize(templates); i++) { + map.put("templates[" + i + "]", getFromList(templates, i)); + } + } + else { + map.put("templates", JSON.getDefault().getMapper().writeValueAsString(templates)); + } } + if (listInfo != null) { + if (isFileTypeOrListOfFiles(listInfo)) { + fileTypeFound = true; + } - /** Return true if this TemplateListResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (listInfo.getClass().equals(java.io.File.class) || + listInfo.getClass().equals(Integer.class) || + listInfo.getClass().equals(String.class) || + listInfo.getClass().isEnum()) { + map.put("list_info", listInfo); + } else if (isListOfFile(listInfo)) { + for(int i = 0; i< getListSize(listInfo); i++) { + map.put("list_info[" + i + "]", getFromList(listInfo, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("list_info", JSON.getDefault().getMapper().writeValueAsString(listInfo)); } - TemplateListResponse templateListResponse = (TemplateListResponse) o; - return Objects.equals(this.templates, templateListResponse.templates) - && Objects.equals(this.listInfo, templateListResponse.listInfo) - && Objects.equals(this.warnings, templateListResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(templates, listInfo, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateListResponse {\n"); - sb.append(" templates: ").append(toIndentedString(templates)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templates != null) { - if (isFileTypeOrListOfFiles(templates)) { - fileTypeFound = true; - } - - if (templates.getClass().equals(java.io.File.class) - || templates.getClass().equals(Integer.class) - || templates.getClass().equals(String.class) - || templates.getClass().isEnum()) { - map.put("templates", templates); - } else if (isListOfFile(templates)) { - for (int i = 0; i < getListSize(templates); i++) { - map.put("templates[" + i + "]", getFromList(templates, i)); - } - } else { - map.put( - "templates", - JSON.getDefault().getMapper().writeValueAsString(templates)); - } - } - if (listInfo != null) { - if (isFileTypeOrListOfFiles(listInfo)) { - fileTypeFound = true; - } - - if (listInfo.getClass().equals(java.io.File.class) - || listInfo.getClass().equals(Integer.class) - || listInfo.getClass().equals(String.class) - || listInfo.getClass().isEnum()) { - map.put("list_info", listInfo); - } else if (isListOfFile(listInfo)) { - for (int i = 0; i < getListSize(listInfo); i++) { - map.put("list_info[" + i + "]", getFromList(listInfo, i)); - } - } else { - map.put( - "list_info", - JSON.getDefault().getMapper().writeValueAsString(listInfo)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java index 401a1a8d8..26ca81fdf 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java @@ -10,212 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TemplateRemoveUserRequest */ + +import com.dropbox.sign.ApiException; +/** + * TemplateRemoveUserRequest + */ @JsonPropertyOrder({ - TemplateRemoveUserRequest.JSON_PROPERTY_ACCOUNT_ID, - TemplateRemoveUserRequest.JSON_PROPERTY_EMAIL_ADDRESS + TemplateRemoveUserRequest.JSON_PROPERTY_ACCOUNT_ID, + TemplateRemoveUserRequest.JSON_PROPERTY_EMAIL_ADDRESS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateRemoveUserRequest { - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - @javax.annotation.Nullable private String accountId; - - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; - - public TemplateRemoveUserRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateRemoveUserRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateRemoveUserRequest.class); - } - - public static TemplateRemoveUserRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateRemoveUserRequest.class); - } - - public TemplateRemoveUserRequest accountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; - } - - /** - * The id or email address of the Account to remove access to the Template. The account id - * prevails if both are provided. - * - * @return accountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccountId() { - return accountId; - } - - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - } - - public TemplateRemoveUserRequest emailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The id or email address of the Account to remove access to the Template. The account id - * prevails if both are provided. - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; - } + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + @javax.annotation.Nullable + private String accountId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; + + public TemplateRemoveUserRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateRemoveUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateRemoveUserRequest.class); + } + + static public TemplateRemoveUserRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateRemoveUserRequest.class + ); + } + + public TemplateRemoveUserRequest accountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + } + + + public TemplateRemoveUserRequest emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this TemplateRemoveUserRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateRemoveUserRequest templateRemoveUserRequest = (TemplateRemoveUserRequest) o; + return Objects.equals(this.accountId, templateRemoveUserRequest.accountId) && + Objects.equals(this.emailAddress, templateRemoveUserRequest.emailAddress); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateRemoveUserRequest {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - /** Return true if this TemplateRemoveUserRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); } - TemplateRemoveUserRequest templateRemoveUserRequest = (TemplateRemoveUserRequest) o; - return Objects.equals(this.accountId, templateRemoveUserRequest.accountId) - && Objects.equals(this.emailAddress, templateRemoveUserRequest.emailAddress); } - - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateRemoveUserRequest {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } - - if (accountId.getClass().equals(java.io.File.class) - || accountId.getClass().equals(Integer.class) - || accountId.getClass().equals(String.class) - || accountId.getClass().isEnum()) { - map.put("account_id", accountId); - } else if (isListOfFile(accountId)) { - for (int i = 0; i < getListSize(accountId); i++) { - map.put("account_id[" + i + "]", getFromList(accountId, i)); - } - } else { - map.put( - "account_id", - JSON.getDefault().getMapper().writeValueAsString(accountId)); - } - } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponse.java index 3a940108d..373b1e252 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponse.java @@ -10,1039 +10,1071 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SignatureRequestResponseAttachment; +import com.dropbox.sign.model.TemplateResponseAccount; +import com.dropbox.sign.model.TemplateResponseCCRole; +import com.dropbox.sign.model.TemplateResponseDocument; +import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldBase; +import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; +import com.dropbox.sign.model.TemplateResponseSignerRole; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** Contains information about the templates you and your team have created. */ +import com.dropbox.sign.ApiException; +/** + * Contains information about the templates you and your team have created. + */ @JsonPropertyOrder({ - TemplateResponse.JSON_PROPERTY_TEMPLATE_ID, - TemplateResponse.JSON_PROPERTY_TITLE, - TemplateResponse.JSON_PROPERTY_MESSAGE, - TemplateResponse.JSON_PROPERTY_UPDATED_AT, - TemplateResponse.JSON_PROPERTY_IS_EMBEDDED, - TemplateResponse.JSON_PROPERTY_IS_CREATOR, - TemplateResponse.JSON_PROPERTY_CAN_EDIT, - TemplateResponse.JSON_PROPERTY_IS_LOCKED, - TemplateResponse.JSON_PROPERTY_METADATA, - TemplateResponse.JSON_PROPERTY_SIGNER_ROLES, - TemplateResponse.JSON_PROPERTY_CC_ROLES, - TemplateResponse.JSON_PROPERTY_DOCUMENTS, - TemplateResponse.JSON_PROPERTY_CUSTOM_FIELDS, - TemplateResponse.JSON_PROPERTY_NAMED_FORM_FIELDS, - TemplateResponse.JSON_PROPERTY_ACCOUNTS, - TemplateResponse.JSON_PROPERTY_ATTACHMENTS, - TemplateResponse.JSON_PROPERTY_ALLOW_FORM_VIEW + TemplateResponse.JSON_PROPERTY_TEMPLATE_ID, + TemplateResponse.JSON_PROPERTY_TITLE, + TemplateResponse.JSON_PROPERTY_MESSAGE, + TemplateResponse.JSON_PROPERTY_UPDATED_AT, + TemplateResponse.JSON_PROPERTY_IS_EMBEDDED, + TemplateResponse.JSON_PROPERTY_IS_CREATOR, + TemplateResponse.JSON_PROPERTY_CAN_EDIT, + TemplateResponse.JSON_PROPERTY_IS_LOCKED, + TemplateResponse.JSON_PROPERTY_METADATA, + TemplateResponse.JSON_PROPERTY_SIGNER_ROLES, + TemplateResponse.JSON_PROPERTY_CC_ROLES, + TemplateResponse.JSON_PROPERTY_DOCUMENTS, + TemplateResponse.JSON_PROPERTY_CUSTOM_FIELDS, + TemplateResponse.JSON_PROPERTY_NAMED_FORM_FIELDS, + TemplateResponse.JSON_PROPERTY_ACCOUNTS, + TemplateResponse.JSON_PROPERTY_ATTACHMENTS, + TemplateResponse.JSON_PROPERTY_ALLOW_FORM_VIEW }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateResponse { - public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; - @javax.annotation.Nullable private String templateId; - - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; - @javax.annotation.Nullable private Integer updatedAt; - - public static final String JSON_PROPERTY_IS_EMBEDDED = "is_embedded"; - @javax.annotation.Nullable private Boolean isEmbedded; - - public static final String JSON_PROPERTY_IS_CREATOR = "is_creator"; - @javax.annotation.Nullable private Boolean isCreator; - - public static final String JSON_PROPERTY_CAN_EDIT = "can_edit"; - @javax.annotation.Nullable private Boolean canEdit; - - public static final String JSON_PROPERTY_IS_LOCKED = "is_locked"; - @javax.annotation.Nullable private Boolean isLocked; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; - @javax.annotation.Nullable private List signerRoles = null; - - public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - @javax.annotation.Nullable private List ccRoles = null; - - public static final String JSON_PROPERTY_DOCUMENTS = "documents"; - @javax.annotation.Nullable private List documents = null; - - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - - @Deprecated @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_NAMED_FORM_FIELDS = "named_form_fields"; - - @Deprecated @javax.annotation.Nullable private List namedFormFields = null; - - public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; - @javax.annotation.Nullable private List accounts = null; - - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - @javax.annotation.Nullable private List attachments = null; - - public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; - @javax.annotation.Nullable private Boolean allowFormView; - - public TemplateResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponse.class); - } - - public static TemplateResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), TemplateResponse.class); - } - - public TemplateResponse templateId(@javax.annotation.Nullable String templateId) { - this.templateId = templateId; - return this; - } - - /** - * The id of the Template. - * - * @return templateId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTemplateId() { - return templateId; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplateId(@javax.annotation.Nullable String templateId) { - this.templateId = templateId; - } - - public TemplateResponse title(@javax.annotation.Nullable String title) { - this.title = title; - return this; - } - - /** - * The title of the Template. This will also be the default subject of the message sent to - * signers when using this Template to send a SignatureRequest. This can be overridden when - * sending the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; - } - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; - } - - public TemplateResponse message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The default message that will be sent to signers when using this Template to send a - * SignatureRequest. This can be overridden when sending the SignatureRequest. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public TemplateResponse updatedAt(@javax.annotation.Nullable Integer updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Time the template was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UPDATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getUpdatedAt() { - return updatedAt; - } - - @JsonProperty(JSON_PROPERTY_UPDATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUpdatedAt(@javax.annotation.Nullable Integer updatedAt) { - this.updatedAt = updatedAt; - } + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + @javax.annotation.Nullable + private String templateId; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + @javax.annotation.Nullable + private Integer updatedAt; + + public static final String JSON_PROPERTY_IS_EMBEDDED = "is_embedded"; + @javax.annotation.Nullable + private Boolean isEmbedded; + + public static final String JSON_PROPERTY_IS_CREATOR = "is_creator"; + @javax.annotation.Nullable + private Boolean isCreator; + + public static final String JSON_PROPERTY_CAN_EDIT = "can_edit"; + @javax.annotation.Nullable + private Boolean canEdit; + + public static final String JSON_PROPERTY_IS_LOCKED = "is_locked"; + @javax.annotation.Nullable + private Boolean isLocked; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; + @javax.annotation.Nullable + private List signerRoles = null; + + public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; + @javax.annotation.Nullable + private List ccRoles = null; + + public static final String JSON_PROPERTY_DOCUMENTS = "documents"; + @javax.annotation.Nullable + private List documents = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @Deprecated + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_NAMED_FORM_FIELDS = "named_form_fields"; + @Deprecated + @javax.annotation.Nullable + private List namedFormFields = null; + + public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; + @javax.annotation.Nullable + private List accounts = null; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + @javax.annotation.Nullable + private List attachments = null; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @javax.annotation.Nullable + private Boolean allowFormView; + + public TemplateResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponse.class); + } + + static public TemplateResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponse.class + ); + } + + public TemplateResponse templateId(@javax.annotation.Nullable String templateId) { + this.templateId = templateId; + return this; + } + + /** + * The id of the Template. + * @return templateId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(@javax.annotation.Nullable String templateId) { + this.templateId = templateId; + } + + + public TemplateResponse title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public TemplateResponse message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public TemplateResponse updatedAt(@javax.annotation.Nullable Integer updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Time the template was last updated. + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(@javax.annotation.Nullable Integer updatedAt) { + this.updatedAt = updatedAt; + } + + + public TemplateResponse isEmbedded(@javax.annotation.Nullable Boolean isEmbedded) { + this.isEmbedded = isEmbedded; + return this; + } + + /** + * `true` if this template was created using an embedded flow, `false` if it was created on our website. Will be `null` when you are not the creator of the Template. + * @return isEmbedded + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_EMBEDDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TemplateResponse isEmbedded(@javax.annotation.Nullable Boolean isEmbedded) { - this.isEmbedded = isEmbedded; - return this; - } + public Boolean getIsEmbedded() { + return isEmbedded; + } + + + @JsonProperty(JSON_PROPERTY_IS_EMBEDDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEmbedded(@javax.annotation.Nullable Boolean isEmbedded) { + this.isEmbedded = isEmbedded; + } + + + public TemplateResponse isCreator(@javax.annotation.Nullable Boolean isCreator) { + this.isCreator = isCreator; + return this; + } + + /** + * `true` if you are the owner of this template, `false` if it's been shared with you by a team member. + * @return isCreator + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_CREATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - /** - * `true` if this template was created using an embedded flow, `false` if it - * was created on our website. Will be `null` when you are not the creator of the - * Template. - * - * @return isEmbedded - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsEmbedded() { - return isEmbedded; - } + public Boolean getIsCreator() { + return isCreator; + } - @JsonProperty(JSON_PROPERTY_IS_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsEmbedded(@javax.annotation.Nullable Boolean isEmbedded) { - this.isEmbedded = isEmbedded; - } - public TemplateResponse isCreator(@javax.annotation.Nullable Boolean isCreator) { - this.isCreator = isCreator; - return this; - } + @JsonProperty(JSON_PROPERTY_IS_CREATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsCreator(@javax.annotation.Nullable Boolean isCreator) { + this.isCreator = isCreator; + } + + + public TemplateResponse canEdit(@javax.annotation.Nullable Boolean canEdit) { + this.canEdit = canEdit; + return this; + } + + /** + * Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). + * @return canEdit + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAN_EDIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getCanEdit() { + return canEdit; + } + + + @JsonProperty(JSON_PROPERTY_CAN_EDIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanEdit(@javax.annotation.Nullable Boolean canEdit) { + this.canEdit = canEdit; + } + + + public TemplateResponse isLocked(@javax.annotation.Nullable Boolean isLocked) { + this.isLocked = isLocked; + return this; + } + + /** + * Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests. + * @return isLocked + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_LOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsLocked() { + return isLocked; + } - /** - * `true` if you are the owner of this template, `false` if it's been - * shared with you by a team member. - * - * @return isCreator - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_CREATOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsCreator() { - return isCreator; - } - @JsonProperty(JSON_PROPERTY_IS_CREATOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsCreator(@javax.annotation.Nullable Boolean isCreator) { - this.isCreator = isCreator; - } + @JsonProperty(JSON_PROPERTY_IS_LOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsLocked(@javax.annotation.Nullable Boolean isLocked) { + this.isLocked = isLocked; + } + + + public TemplateResponse metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public TemplateResponse putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } - public TemplateResponse canEdit(@javax.annotation.Nullable Boolean canEdit) { - this.canEdit = canEdit; - return this; - } - - /** - * Indicates whether edit rights have been granted to you by the owner (always `true` - * if that's you). - * - * @return canEdit - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAN_EDIT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getCanEdit() { - return canEdit; - } - - @JsonProperty(JSON_PROPERTY_CAN_EDIT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCanEdit(@javax.annotation.Nullable Boolean canEdit) { - this.canEdit = canEdit; - } - - public TemplateResponse isLocked(@javax.annotation.Nullable Boolean isLocked) { - this.isLocked = isLocked; - return this; - } + /** + * The metadata attached to the template. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public TemplateResponse signerRoles(@javax.annotation.Nullable List signerRoles) { + this.signerRoles = signerRoles; + return this; + } - /** - * Indicates whether the template is locked. If `true`, then the template was created - * outside your quota and can only be used in `test_mode`. If `false`, then - * the template is within your quota and can be used to create signature requests. - * - * @return isLocked - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_LOCKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsLocked() { - return isLocked; + public TemplateResponse addSignerRolesItem(TemplateResponseSignerRole signerRolesItem) { + if (this.signerRoles == null) { + this.signerRoles = new ArrayList<>(); } - - @JsonProperty(JSON_PROPERTY_IS_LOCKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsLocked(@javax.annotation.Nullable Boolean isLocked) { - this.isLocked = isLocked; - } - - public TemplateResponse metadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public TemplateResponse putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + this.signerRoles.add(signerRolesItem); + return this; + } + + /** + * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. + * @return signerRoles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSignerRoles() { + return signerRoles; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerRoles(@javax.annotation.Nullable List signerRoles) { + this.signerRoles = signerRoles; + } + + + public TemplateResponse ccRoles(@javax.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + return this; + } + + public TemplateResponse addCcRolesItem(TemplateResponseCCRole ccRolesItem) { + if (this.ccRoles == null) { + this.ccRoles = new ArrayList<>(); + } + this.ccRoles.add(ccRolesItem); + return this; + } + + /** + * An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. + * @return ccRoles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcRoles() { + return ccRoles; + } + + + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcRoles(@javax.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + } + + + public TemplateResponse documents(@javax.annotation.Nullable List documents) { + this.documents = documents; + return this; + } + + public TemplateResponse addDocumentsItem(TemplateResponseDocument documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * An array describing each document associated with this Template. Includes form field data for each document. + * @return documents + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOCUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDocuments() { + return documents; + } + + + @JsonProperty(JSON_PROPERTY_DOCUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDocuments(@javax.annotation.Nullable List documents) { + this.documents = documents; + } + + + @Deprecated + public TemplateResponse customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public TemplateResponse addCustomFieldsItem(TemplateResponseDocumentCustomFieldBase customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. + * @return customFields + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @Deprecated + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + + + @Deprecated + public TemplateResponse namedFormFields(@javax.annotation.Nullable List namedFormFields) { + this.namedFormFields = namedFormFields; + return this; + } + + public TemplateResponse addNamedFormFieldsItem(TemplateResponseDocumentFormFieldBase namedFormFieldsItem) { + if (this.namedFormFields == null) { + this.namedFormFields = new ArrayList<>(); + } + this.namedFormFields.add(namedFormFieldsItem); + return this; + } + + /** + * Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. + * @return namedFormFields + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getNamedFormFields() { + return namedFormFields; + } + + + @Deprecated + @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamedFormFields(@javax.annotation.Nullable List namedFormFields) { + this.namedFormFields = namedFormFields; + } + + + public TemplateResponse accounts(@javax.annotation.Nullable List accounts) { + this.accounts = accounts; + return this; + } + + public TemplateResponse addAccountsItem(TemplateResponseAccount accountsItem) { + if (this.accounts == null) { + this.accounts = new ArrayList<>(); + } + this.accounts.add(accountsItem); + return this; + } + + /** + * An array of the Accounts that can use this Template. + * @return accounts + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAccounts() { + return accounts; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccounts(@javax.annotation.Nullable List accounts) { + this.accounts = accounts; + } + + + public TemplateResponse attachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + return this; + } + + public TemplateResponse addAttachmentsItem(SignatureRequestResponseAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * Signer attachments. + * @return attachments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + } + + + public TemplateResponse allowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. + * @return allowFormView + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + /** + * Return true if this TemplateResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponse templateResponse = (TemplateResponse) o; + return Objects.equals(this.templateId, templateResponse.templateId) && + Objects.equals(this.title, templateResponse.title) && + Objects.equals(this.message, templateResponse.message) && + Objects.equals(this.updatedAt, templateResponse.updatedAt) && + Objects.equals(this.isEmbedded, templateResponse.isEmbedded) && + Objects.equals(this.isCreator, templateResponse.isCreator) && + Objects.equals(this.canEdit, templateResponse.canEdit) && + Objects.equals(this.isLocked, templateResponse.isLocked) && + Objects.equals(this.metadata, templateResponse.metadata) && + Objects.equals(this.signerRoles, templateResponse.signerRoles) && + Objects.equals(this.ccRoles, templateResponse.ccRoles) && + Objects.equals(this.documents, templateResponse.documents) && + Objects.equals(this.customFields, templateResponse.customFields) && + Objects.equals(this.namedFormFields, templateResponse.namedFormFields) && + Objects.equals(this.accounts, templateResponse.accounts) && + Objects.equals(this.attachments, templateResponse.attachments) && + Objects.equals(this.allowFormView, templateResponse.allowFormView); + } + + @Override + public int hashCode() { + return Objects.hash(templateId, title, message, updatedAt, isEmbedded, isCreator, canEdit, isLocked, metadata, signerRoles, ccRoles, documents, customFields, namedFormFields, accounts, attachments, allowFormView); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponse {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" isEmbedded: ").append(toIndentedString(isEmbedded)).append("\n"); + sb.append(" isCreator: ").append(toIndentedString(isCreator)).append("\n"); + sb.append(" canEdit: ").append(toIndentedString(canEdit)).append("\n"); + sb.append(" isLocked: ").append(toIndentedString(isLocked)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signerRoles: ").append(toIndentedString(signerRoles)).append("\n"); + sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" namedFormFields: ").append(toIndentedString(namedFormFields)).append("\n"); + sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateId != null) { + if (isFileTypeOrListOfFiles(templateId)) { + fileTypeFound = true; } - this.metadata.put(key, metadataItem); - return this; - } - /** - * The metadata attached to the template. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public TemplateResponse signerRoles( - @javax.annotation.Nullable List signerRoles) { - this.signerRoles = signerRoles; - return this; - } - - public TemplateResponse addSignerRolesItem(TemplateResponseSignerRole signerRolesItem) { - if (this.signerRoles == null) { - this.signerRoles = new ArrayList<>(); + if (templateId.getClass().equals(java.io.File.class) || + templateId.getClass().equals(Integer.class) || + templateId.getClass().equals(String.class) || + templateId.getClass().isEnum()) { + map.put("template_id", templateId); + } else if (isListOfFile(templateId)) { + for(int i = 0; i< getListSize(templateId); i++) { + map.put("template_id[" + i + "]", getFromList(templateId, i)); + } } - this.signerRoles.add(signerRolesItem); - return this; - } - - /** - * An array of the designated signer roles that must be specified when sending a - * SignatureRequest using this Template. - * - * @return signerRoles - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSignerRoles() { - return signerRoles; - } - - @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerRoles( - @javax.annotation.Nullable List signerRoles) { - this.signerRoles = signerRoles; - } - - public TemplateResponse ccRoles( - @javax.annotation.Nullable List ccRoles) { - this.ccRoles = ccRoles; - return this; - } - - public TemplateResponse addCcRolesItem(TemplateResponseCCRole ccRolesItem) { - if (this.ccRoles == null) { - this.ccRoles = new ArrayList<>(); + else { + map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); } - this.ccRoles.add(ccRolesItem); - return this; - } - - /** - * An array of the designated CC roles that must be specified when sending a SignatureRequest - * using this Template. - * - * @return ccRoles - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcRoles() { - return ccRoles; - } - - @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcRoles(@javax.annotation.Nullable List ccRoles) { - this.ccRoles = ccRoles; } - - public TemplateResponse documents( - @javax.annotation.Nullable List documents) { - this.documents = documents; - return this; - } - - public TemplateResponse addDocumentsItem(TemplateResponseDocument documentsItem) { - if (this.documents == null) { - this.documents = new ArrayList<>(); + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; } - this.documents.add(documentsItem); - return this; - } - /** - * An array describing each document associated with this Template. Includes form field data for - * each document. - * - * @return documents - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOCUMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getDocuments() { - return documents; - } - - @JsonProperty(JSON_PROPERTY_DOCUMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDocuments(@javax.annotation.Nullable List documents) { - this.documents = documents; - } - - @Deprecated - public TemplateResponse customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public TemplateResponse addCustomFieldsItem( - TemplateResponseDocumentCustomFieldBase customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } } - this.customFields.add(customFieldsItem); - return this; - } - - /** - * Deprecated. Use `custom_fields` inside the - * [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) - * array instead. - * - * @return customFields - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @Deprecated - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - @Deprecated - public TemplateResponse namedFormFields( - @javax.annotation.Nullable List namedFormFields) { - this.namedFormFields = namedFormFields; - return this; - } - - public TemplateResponse addNamedFormFieldsItem( - TemplateResponseDocumentFormFieldBase namedFormFieldsItem) { - if (this.namedFormFields == null) { - this.namedFormFields = new ArrayList<>(); + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); } - this.namedFormFields.add(namedFormFieldsItem); - return this; } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - /** - * Deprecated. Use `form_fields` inside the - * [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) - * array instead. - * - * @return namedFormFields - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getNamedFormFields() { - return namedFormFields; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (updatedAt != null) { + if (isFileTypeOrListOfFiles(updatedAt)) { + fileTypeFound = true; + } - @Deprecated - @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamedFormFields( - @javax.annotation.Nullable List namedFormFields) { - this.namedFormFields = namedFormFields; + if (updatedAt.getClass().equals(java.io.File.class) || + updatedAt.getClass().equals(Integer.class) || + updatedAt.getClass().equals(String.class) || + updatedAt.getClass().isEnum()) { + map.put("updated_at", updatedAt); + } else if (isListOfFile(updatedAt)) { + for(int i = 0; i< getListSize(updatedAt); i++) { + map.put("updated_at[" + i + "]", getFromList(updatedAt, i)); + } + } + else { + map.put("updated_at", JSON.getDefault().getMapper().writeValueAsString(updatedAt)); + } } + if (isEmbedded != null) { + if (isFileTypeOrListOfFiles(isEmbedded)) { + fileTypeFound = true; + } - public TemplateResponse accounts( - @javax.annotation.Nullable List accounts) { - this.accounts = accounts; - return this; + if (isEmbedded.getClass().equals(java.io.File.class) || + isEmbedded.getClass().equals(Integer.class) || + isEmbedded.getClass().equals(String.class) || + isEmbedded.getClass().isEnum()) { + map.put("is_embedded", isEmbedded); + } else if (isListOfFile(isEmbedded)) { + for(int i = 0; i< getListSize(isEmbedded); i++) { + map.put("is_embedded[" + i + "]", getFromList(isEmbedded, i)); + } + } + else { + map.put("is_embedded", JSON.getDefault().getMapper().writeValueAsString(isEmbedded)); + } } + if (isCreator != null) { + if (isFileTypeOrListOfFiles(isCreator)) { + fileTypeFound = true; + } - public TemplateResponse addAccountsItem(TemplateResponseAccount accountsItem) { - if (this.accounts == null) { - this.accounts = new ArrayList<>(); + if (isCreator.getClass().equals(java.io.File.class) || + isCreator.getClass().equals(Integer.class) || + isCreator.getClass().equals(String.class) || + isCreator.getClass().isEnum()) { + map.put("is_creator", isCreator); + } else if (isListOfFile(isCreator)) { + for(int i = 0; i< getListSize(isCreator); i++) { + map.put("is_creator[" + i + "]", getFromList(isCreator, i)); + } + } + else { + map.put("is_creator", JSON.getDefault().getMapper().writeValueAsString(isCreator)); } - this.accounts.add(accountsItem); - return this; } + if (canEdit != null) { + if (isFileTypeOrListOfFiles(canEdit)) { + fileTypeFound = true; + } - /** - * An array of the Accounts that can use this Template. - * - * @return accounts - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAccounts() { - return accounts; + if (canEdit.getClass().equals(java.io.File.class) || + canEdit.getClass().equals(Integer.class) || + canEdit.getClass().equals(String.class) || + canEdit.getClass().isEnum()) { + map.put("can_edit", canEdit); + } else if (isListOfFile(canEdit)) { + for(int i = 0; i< getListSize(canEdit); i++) { + map.put("can_edit[" + i + "]", getFromList(canEdit, i)); + } + } + else { + map.put("can_edit", JSON.getDefault().getMapper().writeValueAsString(canEdit)); + } } + if (isLocked != null) { + if (isFileTypeOrListOfFiles(isLocked)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ACCOUNTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccounts(@javax.annotation.Nullable List accounts) { - this.accounts = accounts; + if (isLocked.getClass().equals(java.io.File.class) || + isLocked.getClass().equals(Integer.class) || + isLocked.getClass().equals(String.class) || + isLocked.getClass().isEnum()) { + map.put("is_locked", isLocked); + } else if (isListOfFile(isLocked)) { + for(int i = 0; i< getListSize(isLocked); i++) { + map.put("is_locked[" + i + "]", getFromList(isLocked, i)); + } + } + else { + map.put("is_locked", JSON.getDefault().getMapper().writeValueAsString(isLocked)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - public TemplateResponse attachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; - return this; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (signerRoles != null) { + if (isFileTypeOrListOfFiles(signerRoles)) { + fileTypeFound = true; + } - public TemplateResponse addAttachmentsItem(SignatureRequestResponseAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); + if (signerRoles.getClass().equals(java.io.File.class) || + signerRoles.getClass().equals(Integer.class) || + signerRoles.getClass().equals(String.class) || + signerRoles.getClass().isEnum()) { + map.put("signer_roles", signerRoles); + } else if (isListOfFile(signerRoles)) { + for(int i = 0; i< getListSize(signerRoles); i++) { + map.put("signer_roles[" + i + "]", getFromList(signerRoles, i)); + } + } + else { + map.put("signer_roles", JSON.getDefault().getMapper().writeValueAsString(signerRoles)); } - this.attachments.add(attachmentsItem); - return this; } + if (ccRoles != null) { + if (isFileTypeOrListOfFiles(ccRoles)) { + fileTypeFound = true; + } - /** - * Signer attachments. - * - * @return attachments - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAttachments() { - return attachments; + if (ccRoles.getClass().equals(java.io.File.class) || + ccRoles.getClass().equals(Integer.class) || + ccRoles.getClass().equals(String.class) || + ccRoles.getClass().isEnum()) { + map.put("cc_roles", ccRoles); + } else if (isListOfFile(ccRoles)) { + for(int i = 0; i< getListSize(ccRoles); i++) { + map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); + } + } + else { + map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + } } + if (documents != null) { + if (isFileTypeOrListOfFiles(documents)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; + if (documents.getClass().equals(java.io.File.class) || + documents.getClass().equals(Integer.class) || + documents.getClass().equals(String.class) || + documents.getClass().isEnum()) { + map.put("documents", documents); + } else if (isListOfFile(documents)) { + for(int i = 0; i< getListSize(documents); i++) { + map.put("documents[" + i + "]", getFromList(documents, i)); + } + } + else { + map.put("documents", JSON.getDefault().getMapper().writeValueAsString(documents)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - public TemplateResponse allowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - return this; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (namedFormFields != null) { + if (isFileTypeOrListOfFiles(namedFormFields)) { + fileTypeFound = true; + } - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to - * `false`. - * - * @return allowFormView - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowFormView() { - return allowFormView; + if (namedFormFields.getClass().equals(java.io.File.class) || + namedFormFields.getClass().equals(Integer.class) || + namedFormFields.getClass().equals(String.class) || + namedFormFields.getClass().isEnum()) { + map.put("named_form_fields", namedFormFields); + } else if (isListOfFile(namedFormFields)) { + for(int i = 0; i< getListSize(namedFormFields); i++) { + map.put("named_form_fields[" + i + "]", getFromList(namedFormFields, i)); + } + } + else { + map.put("named_form_fields", JSON.getDefault().getMapper().writeValueAsString(namedFormFields)); + } } + if (accounts != null) { + if (isFileTypeOrListOfFiles(accounts)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; + if (accounts.getClass().equals(java.io.File.class) || + accounts.getClass().equals(Integer.class) || + accounts.getClass().equals(String.class) || + accounts.getClass().isEnum()) { + map.put("accounts", accounts); + } else if (isListOfFile(accounts)) { + for(int i = 0; i< getListSize(accounts); i++) { + map.put("accounts[" + i + "]", getFromList(accounts, i)); + } + } + else { + map.put("accounts", JSON.getDefault().getMapper().writeValueAsString(accounts)); + } } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); } - TemplateResponse templateResponse = (TemplateResponse) o; - return Objects.equals(this.templateId, templateResponse.templateId) - && Objects.equals(this.title, templateResponse.title) - && Objects.equals(this.message, templateResponse.message) - && Objects.equals(this.updatedAt, templateResponse.updatedAt) - && Objects.equals(this.isEmbedded, templateResponse.isEmbedded) - && Objects.equals(this.isCreator, templateResponse.isCreator) - && Objects.equals(this.canEdit, templateResponse.canEdit) - && Objects.equals(this.isLocked, templateResponse.isLocked) - && Objects.equals(this.metadata, templateResponse.metadata) - && Objects.equals(this.signerRoles, templateResponse.signerRoles) - && Objects.equals(this.ccRoles, templateResponse.ccRoles) - && Objects.equals(this.documents, templateResponse.documents) - && Objects.equals(this.customFields, templateResponse.customFields) - && Objects.equals(this.namedFormFields, templateResponse.namedFormFields) - && Objects.equals(this.accounts, templateResponse.accounts) - && Objects.equals(this.attachments, templateResponse.attachments) - && Objects.equals(this.allowFormView, templateResponse.allowFormView); } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - templateId, - title, - message, - updatedAt, - isEmbedded, - isCreator, - canEdit, - isLocked, - metadata, - signerRoles, - ccRoles, - documents, - customFields, - namedFormFields, - accounts, - attachments, - allowFormView); + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponse {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" isEmbedded: ").append(toIndentedString(isEmbedded)).append("\n"); - sb.append(" isCreator: ").append(toIndentedString(isCreator)).append("\n"); - sb.append(" canEdit: ").append(toIndentedString(canEdit)).append("\n"); - sb.append(" isLocked: ").append(toIndentedString(isLocked)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signerRoles: ").append(toIndentedString(signerRoles)).append("\n"); - sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); - sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" namedFormFields: ").append(toIndentedString(namedFormFields)).append("\n"); - sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { - fileTypeFound = true; - } - - if (templateId.getClass().equals(java.io.File.class) - || templateId.getClass().equals(Integer.class) - || templateId.getClass().equals(String.class) - || templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for (int i = 0; i < getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); - } - } else { - map.put( - "template_id", - JSON.getDefault().getMapper().writeValueAsString(templateId)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (updatedAt != null) { - if (isFileTypeOrListOfFiles(updatedAt)) { - fileTypeFound = true; - } - - if (updatedAt.getClass().equals(java.io.File.class) - || updatedAt.getClass().equals(Integer.class) - || updatedAt.getClass().equals(String.class) - || updatedAt.getClass().isEnum()) { - map.put("updated_at", updatedAt); - } else if (isListOfFile(updatedAt)) { - for (int i = 0; i < getListSize(updatedAt); i++) { - map.put("updated_at[" + i + "]", getFromList(updatedAt, i)); - } - } else { - map.put( - "updated_at", - JSON.getDefault().getMapper().writeValueAsString(updatedAt)); - } - } - if (isEmbedded != null) { - if (isFileTypeOrListOfFiles(isEmbedded)) { - fileTypeFound = true; - } - - if (isEmbedded.getClass().equals(java.io.File.class) - || isEmbedded.getClass().equals(Integer.class) - || isEmbedded.getClass().equals(String.class) - || isEmbedded.getClass().isEnum()) { - map.put("is_embedded", isEmbedded); - } else if (isListOfFile(isEmbedded)) { - for (int i = 0; i < getListSize(isEmbedded); i++) { - map.put("is_embedded[" + i + "]", getFromList(isEmbedded, i)); - } - } else { - map.put( - "is_embedded", - JSON.getDefault().getMapper().writeValueAsString(isEmbedded)); - } - } - if (isCreator != null) { - if (isFileTypeOrListOfFiles(isCreator)) { - fileTypeFound = true; - } - - if (isCreator.getClass().equals(java.io.File.class) - || isCreator.getClass().equals(Integer.class) - || isCreator.getClass().equals(String.class) - || isCreator.getClass().isEnum()) { - map.put("is_creator", isCreator); - } else if (isListOfFile(isCreator)) { - for (int i = 0; i < getListSize(isCreator); i++) { - map.put("is_creator[" + i + "]", getFromList(isCreator, i)); - } - } else { - map.put( - "is_creator", - JSON.getDefault().getMapper().writeValueAsString(isCreator)); - } - } - if (canEdit != null) { - if (isFileTypeOrListOfFiles(canEdit)) { - fileTypeFound = true; - } - - if (canEdit.getClass().equals(java.io.File.class) - || canEdit.getClass().equals(Integer.class) - || canEdit.getClass().equals(String.class) - || canEdit.getClass().isEnum()) { - map.put("can_edit", canEdit); - } else if (isListOfFile(canEdit)) { - for (int i = 0; i < getListSize(canEdit); i++) { - map.put("can_edit[" + i + "]", getFromList(canEdit, i)); - } - } else { - map.put("can_edit", JSON.getDefault().getMapper().writeValueAsString(canEdit)); - } - } - if (isLocked != null) { - if (isFileTypeOrListOfFiles(isLocked)) { - fileTypeFound = true; - } - - if (isLocked.getClass().equals(java.io.File.class) - || isLocked.getClass().equals(Integer.class) - || isLocked.getClass().equals(String.class) - || isLocked.getClass().isEnum()) { - map.put("is_locked", isLocked); - } else if (isListOfFile(isLocked)) { - for (int i = 0; i < getListSize(isLocked); i++) { - map.put("is_locked[" + i + "]", getFromList(isLocked, i)); - } - } else { - map.put( - "is_locked", - JSON.getDefault().getMapper().writeValueAsString(isLocked)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (signerRoles != null) { - if (isFileTypeOrListOfFiles(signerRoles)) { - fileTypeFound = true; - } - - if (signerRoles.getClass().equals(java.io.File.class) - || signerRoles.getClass().equals(Integer.class) - || signerRoles.getClass().equals(String.class) - || signerRoles.getClass().isEnum()) { - map.put("signer_roles", signerRoles); - } else if (isListOfFile(signerRoles)) { - for (int i = 0; i < getListSize(signerRoles); i++) { - map.put("signer_roles[" + i + "]", getFromList(signerRoles, i)); - } - } else { - map.put( - "signer_roles", - JSON.getDefault().getMapper().writeValueAsString(signerRoles)); - } - } - if (ccRoles != null) { - if (isFileTypeOrListOfFiles(ccRoles)) { - fileTypeFound = true; - } - - if (ccRoles.getClass().equals(java.io.File.class) - || ccRoles.getClass().equals(Integer.class) - || ccRoles.getClass().equals(String.class) - || ccRoles.getClass().isEnum()) { - map.put("cc_roles", ccRoles); - } else if (isListOfFile(ccRoles)) { - for (int i = 0; i < getListSize(ccRoles); i++) { - map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); - } - } else { - map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); - } - } - if (documents != null) { - if (isFileTypeOrListOfFiles(documents)) { - fileTypeFound = true; - } - - if (documents.getClass().equals(java.io.File.class) - || documents.getClass().equals(Integer.class) - || documents.getClass().equals(String.class) - || documents.getClass().isEnum()) { - map.put("documents", documents); - } else if (isListOfFile(documents)) { - for (int i = 0; i < getListSize(documents); i++) { - map.put("documents[" + i + "]", getFromList(documents, i)); - } - } else { - map.put( - "documents", - JSON.getDefault().getMapper().writeValueAsString(documents)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (namedFormFields != null) { - if (isFileTypeOrListOfFiles(namedFormFields)) { - fileTypeFound = true; - } - - if (namedFormFields.getClass().equals(java.io.File.class) - || namedFormFields.getClass().equals(Integer.class) - || namedFormFields.getClass().equals(String.class) - || namedFormFields.getClass().isEnum()) { - map.put("named_form_fields", namedFormFields); - } else if (isListOfFile(namedFormFields)) { - for (int i = 0; i < getListSize(namedFormFields); i++) { - map.put("named_form_fields[" + i + "]", getFromList(namedFormFields, i)); - } - } else { - map.put( - "named_form_fields", - JSON.getDefault().getMapper().writeValueAsString(namedFormFields)); - } - } - if (accounts != null) { - if (isFileTypeOrListOfFiles(accounts)) { - fileTypeFound = true; - } - - if (accounts.getClass().equals(java.io.File.class) - || accounts.getClass().equals(Integer.class) - || accounts.getClass().equals(String.class) - || accounts.getClass().isEnum()) { - map.put("accounts", accounts); - } else if (isListOfFile(accounts)) { - for (int i = 0; i < getListSize(accounts); i++) { - map.put("accounts[" + i + "]", getFromList(accounts, i)); - } - } else { - map.put("accounts", JSON.getDefault().getMapper().writeValueAsString(accounts)); - } - } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - - if (attachments.getClass().equals(java.io.File.class) - || attachments.getClass().equals(Integer.class) - || attachments.getClass().equals(String.class) - || attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for (int i = 0; i < getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } else { - map.put( - "attachments", - JSON.getDefault().getMapper().writeValueAsString(attachments)); - } - } - if (allowFormView != null) { - if (isFileTypeOrListOfFiles(allowFormView)) { - fileTypeFound = true; - } - - if (allowFormView.getClass().equals(java.io.File.class) - || allowFormView.getClass().equals(Integer.class) - || allowFormView.getClass().equals(String.class) - || allowFormView.getClass().isEnum()) { - map.put("allow_form_view", allowFormView); - } else if (isListOfFile(allowFormView)) { - for (int i = 0; i < getListSize(allowFormView); i++) { - map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); - } - } else { - map.put( - "allow_form_view", - JSON.getDefault().getMapper().writeValueAsString(allowFormView)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java index 1f8cdbab4..ff6f81114 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java @@ -10,400 +10,426 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseAccountQuota; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TemplateResponseAccount */ + +import com.dropbox.sign.ApiException; +/** + * TemplateResponseAccount + */ @JsonPropertyOrder({ - TemplateResponseAccount.JSON_PROPERTY_ACCOUNT_ID, - TemplateResponseAccount.JSON_PROPERTY_EMAIL_ADDRESS, - TemplateResponseAccount.JSON_PROPERTY_IS_LOCKED, - TemplateResponseAccount.JSON_PROPERTY_IS_PAID_HS, - TemplateResponseAccount.JSON_PROPERTY_IS_PAID_HF, - TemplateResponseAccount.JSON_PROPERTY_QUOTAS + TemplateResponseAccount.JSON_PROPERTY_ACCOUNT_ID, + TemplateResponseAccount.JSON_PROPERTY_EMAIL_ADDRESS, + TemplateResponseAccount.JSON_PROPERTY_IS_LOCKED, + TemplateResponseAccount.JSON_PROPERTY_IS_PAID_HS, + TemplateResponseAccount.JSON_PROPERTY_IS_PAID_HF, + TemplateResponseAccount.JSON_PROPERTY_QUOTAS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateResponseAccount { - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - @javax.annotation.Nullable private String accountId; - - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - @javax.annotation.Nullable private String emailAddress; - - public static final String JSON_PROPERTY_IS_LOCKED = "is_locked"; - @javax.annotation.Nullable private Boolean isLocked; - - public static final String JSON_PROPERTY_IS_PAID_HS = "is_paid_hs"; - @javax.annotation.Nullable private Boolean isPaidHs; - - public static final String JSON_PROPERTY_IS_PAID_HF = "is_paid_hf"; - @javax.annotation.Nullable private Boolean isPaidHf; - - public static final String JSON_PROPERTY_QUOTAS = "quotas"; - @javax.annotation.Nullable private TemplateResponseAccountQuota quotas; - - public TemplateResponseAccount() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseAccount init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseAccount.class); + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + @javax.annotation.Nullable + private String accountId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + @javax.annotation.Nullable + private String emailAddress; + + public static final String JSON_PROPERTY_IS_LOCKED = "is_locked"; + @javax.annotation.Nullable + private Boolean isLocked; + + public static final String JSON_PROPERTY_IS_PAID_HS = "is_paid_hs"; + @javax.annotation.Nullable + private Boolean isPaidHs; + + public static final String JSON_PROPERTY_IS_PAID_HF = "is_paid_hf"; + @javax.annotation.Nullable + private Boolean isPaidHf; + + public static final String JSON_PROPERTY_QUOTAS = "quotas"; + @javax.annotation.Nullable + private TemplateResponseAccountQuota quotas; + + public TemplateResponseAccount() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseAccount init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseAccount.class); + } + + static public TemplateResponseAccount init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseAccount.class + ); + } + + public TemplateResponseAccount accountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The id of the Account. + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(@javax.annotation.Nullable String accountId) { + this.accountId = accountId; + } + + + public TemplateResponseAccount emailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The email address associated with the Account. + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { + this.emailAddress = emailAddress; + } + + + public TemplateResponseAccount isLocked(@javax.annotation.Nullable Boolean isLocked) { + this.isLocked = isLocked; + return this; + } + + /** + * Returns `true` if the user has been locked out of their account by a team admin. + * @return isLocked + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_LOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsLocked() { + return isLocked; + } + + + @JsonProperty(JSON_PROPERTY_IS_LOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsLocked(@javax.annotation.Nullable Boolean isLocked) { + this.isLocked = isLocked; + } + + + public TemplateResponseAccount isPaidHs(@javax.annotation.Nullable Boolean isPaidHs) { + this.isPaidHs = isPaidHs; + return this; + } + + /** + * Returns `true` if the user has a paid Dropbox Sign account. + * @return isPaidHs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_PAID_HS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsPaidHs() { + return isPaidHs; + } + + + @JsonProperty(JSON_PROPERTY_IS_PAID_HS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaidHs(@javax.annotation.Nullable Boolean isPaidHs) { + this.isPaidHs = isPaidHs; + } + + + public TemplateResponseAccount isPaidHf(@javax.annotation.Nullable Boolean isPaidHf) { + this.isPaidHf = isPaidHf; + return this; + } + + /** + * Returns `true` if the user has a paid HelloFax account. + * @return isPaidHf + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_PAID_HF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsPaidHf() { + return isPaidHf; + } + + + @JsonProperty(JSON_PROPERTY_IS_PAID_HF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaidHf(@javax.annotation.Nullable Boolean isPaidHf) { + this.isPaidHf = isPaidHf; + } + + + public TemplateResponseAccount quotas(@javax.annotation.Nullable TemplateResponseAccountQuota quotas) { + this.quotas = quotas; + return this; + } + + /** + * Get quotas + * @return quotas + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUOTAS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TemplateResponseAccountQuota getQuotas() { + return quotas; + } + + + @JsonProperty(JSON_PROPERTY_QUOTAS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuotas(@javax.annotation.Nullable TemplateResponseAccountQuota quotas) { + this.quotas = quotas; + } + + + /** + * Return true if this TemplateResponseAccount object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public static TemplateResponseAccount init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), TemplateResponseAccount.class); - } - - public TemplateResponseAccount accountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - return this; - } - - /** - * The id of the Account. - * - * @return accountId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAccountId() { - return accountId; - } - - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(@javax.annotation.Nullable String accountId) { - this.accountId = accountId; - } - - public TemplateResponseAccount emailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address associated with the Account. - * - * @return emailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmailAddress() { - return emailAddress; - } - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(@javax.annotation.Nullable String emailAddress) { - this.emailAddress = emailAddress; - } - - public TemplateResponseAccount isLocked(@javax.annotation.Nullable Boolean isLocked) { - this.isLocked = isLocked; - return this; - } - - /** - * Returns `true` if the user has been locked out of their account by a team admin. - * - * @return isLocked - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_LOCKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsLocked() { - return isLocked; - } - - @JsonProperty(JSON_PROPERTY_IS_LOCKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsLocked(@javax.annotation.Nullable Boolean isLocked) { - this.isLocked = isLocked; - } - - public TemplateResponseAccount isPaidHs(@javax.annotation.Nullable Boolean isPaidHs) { - this.isPaidHs = isPaidHs; - return this; - } - - /** - * Returns `true` if the user has a paid Dropbox Sign account. - * - * @return isPaidHs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_PAID_HS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsPaidHs() { - return isPaidHs; - } - - @JsonProperty(JSON_PROPERTY_IS_PAID_HS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsPaidHs(@javax.annotation.Nullable Boolean isPaidHs) { - this.isPaidHs = isPaidHs; - } - - public TemplateResponseAccount isPaidHf(@javax.annotation.Nullable Boolean isPaidHf) { - this.isPaidHf = isPaidHf; - return this; - } - - /** - * Returns `true` if the user has a paid HelloFax account. - * - * @return isPaidHf - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_PAID_HF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsPaidHf() { - return isPaidHf; + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseAccount templateResponseAccount = (TemplateResponseAccount) o; + return Objects.equals(this.accountId, templateResponseAccount.accountId) && + Objects.equals(this.emailAddress, templateResponseAccount.emailAddress) && + Objects.equals(this.isLocked, templateResponseAccount.isLocked) && + Objects.equals(this.isPaidHs, templateResponseAccount.isPaidHs) && + Objects.equals(this.isPaidHf, templateResponseAccount.isPaidHf) && + Objects.equals(this.quotas, templateResponseAccount.quotas); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress, isLocked, isPaidHs, isPaidHf, quotas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseAccount {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" isLocked: ").append(toIndentedString(isLocked)).append("\n"); + sb.append(" isPaidHs: ").append(toIndentedString(isPaidHs)).append("\n"); + sb.append(" isPaidHf: ").append(toIndentedString(isPaidHf)).append("\n"); + sb.append(" quotas: ").append(toIndentedString(quotas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_IS_PAID_HF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsPaidHf(@javax.annotation.Nullable Boolean isPaidHf) { - this.isPaidHf = isPaidHf; + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } - public TemplateResponseAccount quotas( - @javax.annotation.Nullable TemplateResponseAccountQuota quotas) { - this.quotas = quotas; - return this; + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } } + if (isLocked != null) { + if (isFileTypeOrListOfFiles(isLocked)) { + fileTypeFound = true; + } - /** - * Get quotas - * - * @return quotas - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUOTAS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TemplateResponseAccountQuota getQuotas() { - return quotas; + if (isLocked.getClass().equals(java.io.File.class) || + isLocked.getClass().equals(Integer.class) || + isLocked.getClass().equals(String.class) || + isLocked.getClass().isEnum()) { + map.put("is_locked", isLocked); + } else if (isListOfFile(isLocked)) { + for(int i = 0; i< getListSize(isLocked); i++) { + map.put("is_locked[" + i + "]", getFromList(isLocked, i)); + } + } + else { + map.put("is_locked", JSON.getDefault().getMapper().writeValueAsString(isLocked)); + } } + if (isPaidHs != null) { + if (isFileTypeOrListOfFiles(isPaidHs)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_QUOTAS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setQuotas(@javax.annotation.Nullable TemplateResponseAccountQuota quotas) { - this.quotas = quotas; + if (isPaidHs.getClass().equals(java.io.File.class) || + isPaidHs.getClass().equals(Integer.class) || + isPaidHs.getClass().equals(String.class) || + isPaidHs.getClass().isEnum()) { + map.put("is_paid_hs", isPaidHs); + } else if (isListOfFile(isPaidHs)) { + for(int i = 0; i< getListSize(isPaidHs); i++) { + map.put("is_paid_hs[" + i + "]", getFromList(isPaidHs, i)); + } + } + else { + map.put("is_paid_hs", JSON.getDefault().getMapper().writeValueAsString(isPaidHs)); + } } + if (isPaidHf != null) { + if (isFileTypeOrListOfFiles(isPaidHf)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseAccount object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (isPaidHf.getClass().equals(java.io.File.class) || + isPaidHf.getClass().equals(Integer.class) || + isPaidHf.getClass().equals(String.class) || + isPaidHf.getClass().isEnum()) { + map.put("is_paid_hf", isPaidHf); + } else if (isListOfFile(isPaidHf)) { + for(int i = 0; i< getListSize(isPaidHf); i++) { + map.put("is_paid_hf[" + i + "]", getFromList(isPaidHf, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("is_paid_hf", JSON.getDefault().getMapper().writeValueAsString(isPaidHf)); } - TemplateResponseAccount templateResponseAccount = (TemplateResponseAccount) o; - return Objects.equals(this.accountId, templateResponseAccount.accountId) - && Objects.equals(this.emailAddress, templateResponseAccount.emailAddress) - && Objects.equals(this.isLocked, templateResponseAccount.isLocked) - && Objects.equals(this.isPaidHs, templateResponseAccount.isPaidHs) - && Objects.equals(this.isPaidHf, templateResponseAccount.isPaidHf) - && Objects.equals(this.quotas, templateResponseAccount.quotas); } + if (quotas != null) { + if (isFileTypeOrListOfFiles(quotas)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress, isLocked, isPaidHs, isPaidHf, quotas); + if (quotas.getClass().equals(java.io.File.class) || + quotas.getClass().equals(Integer.class) || + quotas.getClass().equals(String.class) || + quotas.getClass().isEnum()) { + map.put("quotas", quotas); + } else if (isListOfFile(quotas)) { + for(int i = 0; i< getListSize(quotas); i++) { + map.put("quotas[" + i + "]", getFromList(quotas, i)); + } + } + else { + map.put("quotas", JSON.getDefault().getMapper().writeValueAsString(quotas)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseAccount {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" isLocked: ").append(toIndentedString(isLocked)).append("\n"); - sb.append(" isPaidHs: ").append(toIndentedString(isPaidHs)).append("\n"); - sb.append(" isPaidHf: ").append(toIndentedString(isPaidHf)).append("\n"); - sb.append(" quotas: ").append(toIndentedString(quotas)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } - - if (accountId.getClass().equals(java.io.File.class) - || accountId.getClass().equals(Integer.class) - || accountId.getClass().equals(String.class) - || accountId.getClass().isEnum()) { - map.put("account_id", accountId); - } else if (isListOfFile(accountId)) { - for (int i = 0; i < getListSize(accountId); i++) { - map.put("account_id[" + i + "]", getFromList(accountId, i)); - } - } else { - map.put( - "account_id", - JSON.getDefault().getMapper().writeValueAsString(accountId)); - } - } - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } - - if (emailAddress.getClass().equals(java.io.File.class) - || emailAddress.getClass().equals(Integer.class) - || emailAddress.getClass().equals(String.class) - || emailAddress.getClass().isEnum()) { - map.put("email_address", emailAddress); - } else if (isListOfFile(emailAddress)) { - for (int i = 0; i < getListSize(emailAddress); i++) { - map.put("email_address[" + i + "]", getFromList(emailAddress, i)); - } - } else { - map.put( - "email_address", - JSON.getDefault().getMapper().writeValueAsString(emailAddress)); - } - } - if (isLocked != null) { - if (isFileTypeOrListOfFiles(isLocked)) { - fileTypeFound = true; - } - - if (isLocked.getClass().equals(java.io.File.class) - || isLocked.getClass().equals(Integer.class) - || isLocked.getClass().equals(String.class) - || isLocked.getClass().isEnum()) { - map.put("is_locked", isLocked); - } else if (isListOfFile(isLocked)) { - for (int i = 0; i < getListSize(isLocked); i++) { - map.put("is_locked[" + i + "]", getFromList(isLocked, i)); - } - } else { - map.put( - "is_locked", - JSON.getDefault().getMapper().writeValueAsString(isLocked)); - } - } - if (isPaidHs != null) { - if (isFileTypeOrListOfFiles(isPaidHs)) { - fileTypeFound = true; - } - - if (isPaidHs.getClass().equals(java.io.File.class) - || isPaidHs.getClass().equals(Integer.class) - || isPaidHs.getClass().equals(String.class) - || isPaidHs.getClass().isEnum()) { - map.put("is_paid_hs", isPaidHs); - } else if (isListOfFile(isPaidHs)) { - for (int i = 0; i < getListSize(isPaidHs); i++) { - map.put("is_paid_hs[" + i + "]", getFromList(isPaidHs, i)); - } - } else { - map.put( - "is_paid_hs", - JSON.getDefault().getMapper().writeValueAsString(isPaidHs)); - } - } - if (isPaidHf != null) { - if (isFileTypeOrListOfFiles(isPaidHf)) { - fileTypeFound = true; - } - - if (isPaidHf.getClass().equals(java.io.File.class) - || isPaidHf.getClass().equals(Integer.class) - || isPaidHf.getClass().equals(String.class) - || isPaidHf.getClass().isEnum()) { - map.put("is_paid_hf", isPaidHf); - } else if (isListOfFile(isPaidHf)) { - for (int i = 0; i < getListSize(isPaidHf); i++) { - map.put("is_paid_hf[" + i + "]", getFromList(isPaidHf, i)); - } - } else { - map.put( - "is_paid_hf", - JSON.getDefault().getMapper().writeValueAsString(isPaidHf)); - } - } - if (quotas != null) { - if (isFileTypeOrListOfFiles(quotas)) { - fileTypeFound = true; - } - - if (quotas.getClass().equals(java.io.File.class) - || quotas.getClass().equals(Integer.class) - || quotas.getClass().equals(String.class) - || quotas.getClass().isEnum()) { - map.put("quotas", quotas); - } else if (isListOfFile(quotas)) { - for (int i = 0; i < getListSize(quotas); i++) { - map.put("quotas[" + i + "]", getFromList(quotas, i)); - } - } else { - map.put("quotas", JSON.getDefault().getMapper().writeValueAsString(quotas)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java index edad6110e..be3845f38 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java @@ -10,331 +10,323 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; + +import com.dropbox.sign.ApiException; /** - * An array of the designated CC roles that must be specified when sending a SignatureRequest using - * this Template. + * An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. */ @JsonPropertyOrder({ - TemplateResponseAccountQuota.JSON_PROPERTY_TEMPLATES_LEFT, - TemplateResponseAccountQuota.JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT, - TemplateResponseAccountQuota.JSON_PROPERTY_DOCUMENTS_LEFT, - TemplateResponseAccountQuota.JSON_PROPERTY_SMS_VERIFICATIONS_LEFT + TemplateResponseAccountQuota.JSON_PROPERTY_TEMPLATES_LEFT, + TemplateResponseAccountQuota.JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT, + TemplateResponseAccountQuota.JSON_PROPERTY_DOCUMENTS_LEFT, + TemplateResponseAccountQuota.JSON_PROPERTY_SMS_VERIFICATIONS_LEFT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateResponseAccountQuota { - public static final String JSON_PROPERTY_TEMPLATES_LEFT = "templates_left"; - @javax.annotation.Nullable private Integer templatesLeft; - - public static final String JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT = - "api_signature_requests_left"; - @javax.annotation.Nullable private Integer apiSignatureRequestsLeft; - - public static final String JSON_PROPERTY_DOCUMENTS_LEFT = "documents_left"; - @javax.annotation.Nullable private Integer documentsLeft; - - public static final String JSON_PROPERTY_SMS_VERIFICATIONS_LEFT = "sms_verifications_left"; - @javax.annotation.Nullable private Integer smsVerificationsLeft; - - public TemplateResponseAccountQuota() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseAccountQuota init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseAccountQuota.class); - } - - public static TemplateResponseAccountQuota init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseAccountQuota.class); - } - - public TemplateResponseAccountQuota templatesLeft( - @javax.annotation.Nullable Integer templatesLeft) { - this.templatesLeft = templatesLeft; - return this; - } - - /** - * API templates remaining. - * - * @return templatesLeft - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getTemplatesLeft() { - return templatesLeft; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplatesLeft(@javax.annotation.Nullable Integer templatesLeft) { - this.templatesLeft = templatesLeft; - } - - public TemplateResponseAccountQuota apiSignatureRequestsLeft( - @javax.annotation.Nullable Integer apiSignatureRequestsLeft) { - this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; - return this; - } - - /** - * API signature requests remaining. - * - * @return apiSignatureRequestsLeft - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getApiSignatureRequestsLeft() { - return apiSignatureRequestsLeft; - } - - @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiSignatureRequestsLeft( - @javax.annotation.Nullable Integer apiSignatureRequestsLeft) { - this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; - } - - public TemplateResponseAccountQuota documentsLeft( - @javax.annotation.Nullable Integer documentsLeft) { - this.documentsLeft = documentsLeft; - return this; + public static final String JSON_PROPERTY_TEMPLATES_LEFT = "templates_left"; + @javax.annotation.Nullable + private Integer templatesLeft; + + public static final String JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT = "api_signature_requests_left"; + @javax.annotation.Nullable + private Integer apiSignatureRequestsLeft; + + public static final String JSON_PROPERTY_DOCUMENTS_LEFT = "documents_left"; + @javax.annotation.Nullable + private Integer documentsLeft; + + public static final String JSON_PROPERTY_SMS_VERIFICATIONS_LEFT = "sms_verifications_left"; + @javax.annotation.Nullable + private Integer smsVerificationsLeft; + + public TemplateResponseAccountQuota() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseAccountQuota init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseAccountQuota.class); + } + + static public TemplateResponseAccountQuota init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseAccountQuota.class + ); + } + + public TemplateResponseAccountQuota templatesLeft(@javax.annotation.Nullable Integer templatesLeft) { + this.templatesLeft = templatesLeft; + return this; + } + + /** + * API templates remaining. + * @return templatesLeft + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getTemplatesLeft() { + return templatesLeft; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplatesLeft(@javax.annotation.Nullable Integer templatesLeft) { + this.templatesLeft = templatesLeft; + } + + + public TemplateResponseAccountQuota apiSignatureRequestsLeft(@javax.annotation.Nullable Integer apiSignatureRequestsLeft) { + this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; + return this; + } + + /** + * API signature requests remaining. + * @return apiSignatureRequestsLeft + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getApiSignatureRequestsLeft() { + return apiSignatureRequestsLeft; + } + + + @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiSignatureRequestsLeft(@javax.annotation.Nullable Integer apiSignatureRequestsLeft) { + this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; + } + + + public TemplateResponseAccountQuota documentsLeft(@javax.annotation.Nullable Integer documentsLeft) { + this.documentsLeft = documentsLeft; + return this; + } + + /** + * Signature requests remaining. + * @return documentsLeft + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDocumentsLeft() { + return documentsLeft; + } + + + @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDocumentsLeft(@javax.annotation.Nullable Integer documentsLeft) { + this.documentsLeft = documentsLeft; + } + + + public TemplateResponseAccountQuota smsVerificationsLeft(@javax.annotation.Nullable Integer smsVerificationsLeft) { + this.smsVerificationsLeft = smsVerificationsLeft; + return this; + } + + /** + * SMS verifications remaining. + * @return smsVerificationsLeft + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSmsVerificationsLeft() { + return smsVerificationsLeft; + } + + + @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsVerificationsLeft(@javax.annotation.Nullable Integer smsVerificationsLeft) { + this.smsVerificationsLeft = smsVerificationsLeft; + } + + + /** + * Return true if this TemplateResponseAccountQuota object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - /** - * Signature requests remaining. - * - * @return documentsLeft - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getDocumentsLeft() { - return documentsLeft; - } - - @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDocumentsLeft(@javax.annotation.Nullable Integer documentsLeft) { - this.documentsLeft = documentsLeft; - } - - public TemplateResponseAccountQuota smsVerificationsLeft( - @javax.annotation.Nullable Integer smsVerificationsLeft) { - this.smsVerificationsLeft = smsVerificationsLeft; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseAccountQuota templateResponseAccountQuota = (TemplateResponseAccountQuota) o; + return Objects.equals(this.templatesLeft, templateResponseAccountQuota.templatesLeft) && + Objects.equals(this.apiSignatureRequestsLeft, templateResponseAccountQuota.apiSignatureRequestsLeft) && + Objects.equals(this.documentsLeft, templateResponseAccountQuota.documentsLeft) && + Objects.equals(this.smsVerificationsLeft, templateResponseAccountQuota.smsVerificationsLeft); + } + + @Override + public int hashCode() { + return Objects.hash(templatesLeft, apiSignatureRequestsLeft, documentsLeft, smsVerificationsLeft); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseAccountQuota {\n"); + sb.append(" templatesLeft: ").append(toIndentedString(templatesLeft)).append("\n"); + sb.append(" apiSignatureRequestsLeft: ").append(toIndentedString(apiSignatureRequestsLeft)).append("\n"); + sb.append(" documentsLeft: ").append(toIndentedString(documentsLeft)).append("\n"); + sb.append(" smsVerificationsLeft: ").append(toIndentedString(smsVerificationsLeft)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templatesLeft != null) { + if (isFileTypeOrListOfFiles(templatesLeft)) { + fileTypeFound = true; + } - /** - * SMS verifications remaining. - * - * @return smsVerificationsLeft - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getSmsVerificationsLeft() { - return smsVerificationsLeft; + if (templatesLeft.getClass().equals(java.io.File.class) || + templatesLeft.getClass().equals(Integer.class) || + templatesLeft.getClass().equals(String.class) || + templatesLeft.getClass().isEnum()) { + map.put("templates_left", templatesLeft); + } else if (isListOfFile(templatesLeft)) { + for(int i = 0; i< getListSize(templatesLeft); i++) { + map.put("templates_left[" + i + "]", getFromList(templatesLeft, i)); + } + } + else { + map.put("templates_left", JSON.getDefault().getMapper().writeValueAsString(templatesLeft)); + } } + if (apiSignatureRequestsLeft != null) { + if (isFileTypeOrListOfFiles(apiSignatureRequestsLeft)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsVerificationsLeft(@javax.annotation.Nullable Integer smsVerificationsLeft) { - this.smsVerificationsLeft = smsVerificationsLeft; + if (apiSignatureRequestsLeft.getClass().equals(java.io.File.class) || + apiSignatureRequestsLeft.getClass().equals(Integer.class) || + apiSignatureRequestsLeft.getClass().equals(String.class) || + apiSignatureRequestsLeft.getClass().isEnum()) { + map.put("api_signature_requests_left", apiSignatureRequestsLeft); + } else if (isListOfFile(apiSignatureRequestsLeft)) { + for(int i = 0; i< getListSize(apiSignatureRequestsLeft); i++) { + map.put("api_signature_requests_left[" + i + "]", getFromList(apiSignatureRequestsLeft, i)); + } + } + else { + map.put("api_signature_requests_left", JSON.getDefault().getMapper().writeValueAsString(apiSignatureRequestsLeft)); + } } + if (documentsLeft != null) { + if (isFileTypeOrListOfFiles(documentsLeft)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseAccountQuota object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (documentsLeft.getClass().equals(java.io.File.class) || + documentsLeft.getClass().equals(Integer.class) || + documentsLeft.getClass().equals(String.class) || + documentsLeft.getClass().isEnum()) { + map.put("documents_left", documentsLeft); + } else if (isListOfFile(documentsLeft)) { + for(int i = 0; i< getListSize(documentsLeft); i++) { + map.put("documents_left[" + i + "]", getFromList(documentsLeft, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("documents_left", JSON.getDefault().getMapper().writeValueAsString(documentsLeft)); } - TemplateResponseAccountQuota templateResponseAccountQuota = - (TemplateResponseAccountQuota) o; - return Objects.equals(this.templatesLeft, templateResponseAccountQuota.templatesLeft) - && Objects.equals( - this.apiSignatureRequestsLeft, - templateResponseAccountQuota.apiSignatureRequestsLeft) - && Objects.equals(this.documentsLeft, templateResponseAccountQuota.documentsLeft) - && Objects.equals( - this.smsVerificationsLeft, - templateResponseAccountQuota.smsVerificationsLeft); } + if (smsVerificationsLeft != null) { + if (isFileTypeOrListOfFiles(smsVerificationsLeft)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - templatesLeft, apiSignatureRequestsLeft, documentsLeft, smsVerificationsLeft); + if (smsVerificationsLeft.getClass().equals(java.io.File.class) || + smsVerificationsLeft.getClass().equals(Integer.class) || + smsVerificationsLeft.getClass().equals(String.class) || + smsVerificationsLeft.getClass().isEnum()) { + map.put("sms_verifications_left", smsVerificationsLeft); + } else if (isListOfFile(smsVerificationsLeft)) { + for(int i = 0; i< getListSize(smsVerificationsLeft); i++) { + map.put("sms_verifications_left[" + i + "]", getFromList(smsVerificationsLeft, i)); + } + } + else { + map.put("sms_verifications_left", JSON.getDefault().getMapper().writeValueAsString(smsVerificationsLeft)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseAccountQuota {\n"); - sb.append(" templatesLeft: ").append(toIndentedString(templatesLeft)).append("\n"); - sb.append(" apiSignatureRequestsLeft: ") - .append(toIndentedString(apiSignatureRequestsLeft)) - .append("\n"); - sb.append(" documentsLeft: ").append(toIndentedString(documentsLeft)).append("\n"); - sb.append(" smsVerificationsLeft: ") - .append(toIndentedString(smsVerificationsLeft)) - .append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templatesLeft != null) { - if (isFileTypeOrListOfFiles(templatesLeft)) { - fileTypeFound = true; - } - - if (templatesLeft.getClass().equals(java.io.File.class) - || templatesLeft.getClass().equals(Integer.class) - || templatesLeft.getClass().equals(String.class) - || templatesLeft.getClass().isEnum()) { - map.put("templates_left", templatesLeft); - } else if (isListOfFile(templatesLeft)) { - for (int i = 0; i < getListSize(templatesLeft); i++) { - map.put("templates_left[" + i + "]", getFromList(templatesLeft, i)); - } - } else { - map.put( - "templates_left", - JSON.getDefault().getMapper().writeValueAsString(templatesLeft)); - } - } - if (apiSignatureRequestsLeft != null) { - if (isFileTypeOrListOfFiles(apiSignatureRequestsLeft)) { - fileTypeFound = true; - } - - if (apiSignatureRequestsLeft.getClass().equals(java.io.File.class) - || apiSignatureRequestsLeft.getClass().equals(Integer.class) - || apiSignatureRequestsLeft.getClass().equals(String.class) - || apiSignatureRequestsLeft.getClass().isEnum()) { - map.put("api_signature_requests_left", apiSignatureRequestsLeft); - } else if (isListOfFile(apiSignatureRequestsLeft)) { - for (int i = 0; i < getListSize(apiSignatureRequestsLeft); i++) { - map.put( - "api_signature_requests_left[" + i + "]", - getFromList(apiSignatureRequestsLeft, i)); - } - } else { - map.put( - "api_signature_requests_left", - JSON.getDefault() - .getMapper() - .writeValueAsString(apiSignatureRequestsLeft)); - } - } - if (documentsLeft != null) { - if (isFileTypeOrListOfFiles(documentsLeft)) { - fileTypeFound = true; - } - - if (documentsLeft.getClass().equals(java.io.File.class) - || documentsLeft.getClass().equals(Integer.class) - || documentsLeft.getClass().equals(String.class) - || documentsLeft.getClass().isEnum()) { - map.put("documents_left", documentsLeft); - } else if (isListOfFile(documentsLeft)) { - for (int i = 0; i < getListSize(documentsLeft); i++) { - map.put("documents_left[" + i + "]", getFromList(documentsLeft, i)); - } - } else { - map.put( - "documents_left", - JSON.getDefault().getMapper().writeValueAsString(documentsLeft)); - } - } - if (smsVerificationsLeft != null) { - if (isFileTypeOrListOfFiles(smsVerificationsLeft)) { - fileTypeFound = true; - } - - if (smsVerificationsLeft.getClass().equals(java.io.File.class) - || smsVerificationsLeft.getClass().equals(Integer.class) - || smsVerificationsLeft.getClass().equals(String.class) - || smsVerificationsLeft.getClass().isEnum()) { - map.put("sms_verifications_left", smsVerificationsLeft); - } else if (isListOfFile(smsVerificationsLeft)) { - for (int i = 0; i < getListSize(smsVerificationsLeft); i++) { - map.put( - "sms_verifications_left[" + i + "]", - getFromList(smsVerificationsLeft, i)); - } - } else { - map.put( - "sms_verifications_left", - JSON.getDefault().getMapper().writeValueAsString(smsVerificationsLeft)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java index 00f72e343..6d7a61009 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java @@ -10,157 +10,170 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TemplateResponseCCRole */ -@JsonPropertyOrder({TemplateResponseCCRole.JSON_PROPERTY_NAME}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class TemplateResponseCCRole { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public TemplateResponseCCRole() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseCCRole init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseCCRole.class); - } - public static TemplateResponseCCRole init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), TemplateResponseCCRole.class); - } - - public TemplateResponseCCRole name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of the Role. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; +import com.dropbox.sign.ApiException; +/** + * TemplateResponseCCRole + */ +@JsonPropertyOrder({ + TemplateResponseCCRole.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateResponseCCRole { + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public TemplateResponseCCRole() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseCCRole init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseCCRole.class); + } + + static public TemplateResponseCCRole init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseCCRole.class + ); + } + + public TemplateResponseCCRole name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the Role. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + /** + * Return true if this TemplateResponseCCRole object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseCCRole templateResponseCCRole = (TemplateResponseCCRole) o; + return Objects.equals(this.name, templateResponseCCRole.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseCCRole {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseCCRole object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); } - TemplateResponseCCRole templateResponseCCRole = (TemplateResponseCCRole) o; - return Objects.equals(this.name, templateResponseCCRole.name); } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseCCRole {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java index 3cabbf112..47d8c7272 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java @@ -10,449 +10,463 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldBase; +import com.dropbox.sign.model.TemplateResponseDocumentFieldGroup; +import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; +import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** TemplateResponseDocument */ +import com.dropbox.sign.ApiException; +/** + * TemplateResponseDocument + */ @JsonPropertyOrder({ - TemplateResponseDocument.JSON_PROPERTY_NAME, - TemplateResponseDocument.JSON_PROPERTY_INDEX, - TemplateResponseDocument.JSON_PROPERTY_FIELD_GROUPS, - TemplateResponseDocument.JSON_PROPERTY_FORM_FIELDS, - TemplateResponseDocument.JSON_PROPERTY_CUSTOM_FIELDS, - TemplateResponseDocument.JSON_PROPERTY_STATIC_FIELDS + TemplateResponseDocument.JSON_PROPERTY_NAME, + TemplateResponseDocument.JSON_PROPERTY_INDEX, + TemplateResponseDocument.JSON_PROPERTY_FIELD_GROUPS, + TemplateResponseDocument.JSON_PROPERTY_FORM_FIELDS, + TemplateResponseDocument.JSON_PROPERTY_CUSTOM_FIELDS, + TemplateResponseDocument.JSON_PROPERTY_STATIC_FIELDS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateResponseDocument { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_INDEX = "index"; - @javax.annotation.Nullable private Integer index; - - public static final String JSON_PROPERTY_FIELD_GROUPS = "field_groups"; - @javax.annotation.Nullable private List fieldGroups = null; - - public static final String JSON_PROPERTY_FORM_FIELDS = "form_fields"; - - @javax.annotation.Nullable private List formFields = null; - - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - - @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_STATIC_FIELDS = "static_fields"; - - @javax.annotation.Nullable private List staticFields = null; - - public TemplateResponseDocument() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocument init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocument.class); - } - - public static TemplateResponseDocument init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocument.class); - } - - public TemplateResponseDocument name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * Name of the associated file. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public TemplateResponseDocument index(@javax.annotation.Nullable Integer index) { - this.index = index; - return this; - } - - /** - * Document ordering, the lowest index is displayed first and the highest last (0-based - * indexing). - * - * @return index - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDEX) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getIndex() { - return index; - } - - @JsonProperty(JSON_PROPERTY_INDEX) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIndex(@javax.annotation.Nullable Integer index) { - this.index = index; - } - - public TemplateResponseDocument fieldGroups( - @javax.annotation.Nullable List fieldGroups) { - this.fieldGroups = fieldGroups; - return this; - } - - public TemplateResponseDocument addFieldGroupsItem( - TemplateResponseDocumentFieldGroup fieldGroupsItem) { - if (this.fieldGroups == null) { - this.fieldGroups = new ArrayList<>(); + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_INDEX = "index"; + @javax.annotation.Nullable + private Integer index; + + public static final String JSON_PROPERTY_FIELD_GROUPS = "field_groups"; + @javax.annotation.Nullable + private List fieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELDS = "form_fields"; + @javax.annotation.Nullable + private List formFields = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_STATIC_FIELDS = "static_fields"; + @javax.annotation.Nullable + private List staticFields = null; + + public TemplateResponseDocument() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocument init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocument.class); + } + + static public TemplateResponseDocument init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocument.class + ); + } + + public TemplateResponseDocument name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name of the associated file. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public TemplateResponseDocument index(@javax.annotation.Nullable Integer index) { + this.index = index; + return this; + } + + /** + * Document ordering, the lowest index is displayed first and the highest last (0-based indexing). + * @return index + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getIndex() { + return index; + } + + + @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndex(@javax.annotation.Nullable Integer index) { + this.index = index; + } + + + public TemplateResponseDocument fieldGroups(@javax.annotation.Nullable List fieldGroups) { + this.fieldGroups = fieldGroups; + return this; + } + + public TemplateResponseDocument addFieldGroupsItem(TemplateResponseDocumentFieldGroup fieldGroupsItem) { + if (this.fieldGroups == null) { + this.fieldGroups = new ArrayList<>(); + } + this.fieldGroups.add(fieldGroupsItem); + return this; + } + + /** + * An array of Form Field Group objects. + * @return fieldGroups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFieldGroups() { + return fieldGroups; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldGroups(@javax.annotation.Nullable List fieldGroups) { + this.fieldGroups = fieldGroups; + } + + + public TemplateResponseDocument formFields(@javax.annotation.Nullable List formFields) { + this.formFields = formFields; + return this; + } + + public TemplateResponseDocument addFormFieldsItem(TemplateResponseDocumentFormFieldBase formFieldsItem) { + if (this.formFields == null) { + this.formFields = new ArrayList<>(); + } + this.formFields.add(formFieldsItem); + return this; + } + + /** + * An array of Form Field objects containing the name and type of each named field. + * @return formFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFields() { + return formFields; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFields(@javax.annotation.Nullable List formFields) { + this.formFields = formFields; + } + + + public TemplateResponseDocument customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public TemplateResponseDocument addCustomFieldsItem(TemplateResponseDocumentCustomFieldBase customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array of Form Field objects containing the name and type of each named field. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + + + public TemplateResponseDocument staticFields(@javax.annotation.Nullable List staticFields) { + this.staticFields = staticFields; + return this; + } + + public TemplateResponseDocument addStaticFieldsItem(TemplateResponseDocumentStaticFieldBase staticFieldsItem) { + if (this.staticFields == null) { + this.staticFields = new ArrayList<>(); + } + this.staticFields.add(staticFieldsItem); + return this; + } + + /** + * An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. + * @return staticFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATIC_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getStaticFields() { + return staticFields; + } + + + @JsonProperty(JSON_PROPERTY_STATIC_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStaticFields(@javax.annotation.Nullable List staticFields) { + this.staticFields = staticFields; + } + + + /** + * Return true if this TemplateResponseDocument object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocument templateResponseDocument = (TemplateResponseDocument) o; + return Objects.equals(this.name, templateResponseDocument.name) && + Objects.equals(this.index, templateResponseDocument.index) && + Objects.equals(this.fieldGroups, templateResponseDocument.fieldGroups) && + Objects.equals(this.formFields, templateResponseDocument.formFields) && + Objects.equals(this.customFields, templateResponseDocument.customFields) && + Objects.equals(this.staticFields, templateResponseDocument.staticFields); + } + + @Override + public int hashCode() { + return Objects.hash(name, index, fieldGroups, formFields, customFields, staticFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocument {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" fieldGroups: ").append(toIndentedString(fieldGroups)).append("\n"); + sb.append(" formFields: ").append(toIndentedString(formFields)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" staticFields: ").append(toIndentedString(staticFields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; } - this.fieldGroups.add(fieldGroupsItem); - return this; - } - - /** - * An array of Form Field Group objects. - * - * @return fieldGroups - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFieldGroups() { - return fieldGroups; - } - - @JsonProperty(JSON_PROPERTY_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldGroups( - @javax.annotation.Nullable List fieldGroups) { - this.fieldGroups = fieldGroups; - } - - public TemplateResponseDocument formFields( - @javax.annotation.Nullable List formFields) { - this.formFields = formFields; - return this; - } - public TemplateResponseDocument addFormFieldsItem( - TemplateResponseDocumentFormFieldBase formFieldsItem) { - if (this.formFields == null) { - this.formFields = new ArrayList<>(); + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } } - this.formFields.add(formFieldsItem); - return this; - } - - /** - * An array of Form Field objects containing the name and type of each named field. - * - * @return formFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFields() { - return formFields; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFields( - @javax.annotation.Nullable List formFields) { - this.formFields = formFields; - } - - public TemplateResponseDocument customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public TemplateResponseDocument addCustomFieldsItem( - TemplateResponseDocumentCustomFieldBase customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); } - this.customFields.add(customFieldsItem); - return this; - } - - /** - * An array of Form Field objects containing the name and type of each named field. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public TemplateResponseDocument staticFields( - @javax.annotation.Nullable List staticFields) { - this.staticFields = staticFields; - return this; } + if (index != null) { + if (isFileTypeOrListOfFiles(index)) { + fileTypeFound = true; + } - public TemplateResponseDocument addStaticFieldsItem( - TemplateResponseDocumentStaticFieldBase staticFieldsItem) { - if (this.staticFields == null) { - this.staticFields = new ArrayList<>(); + if (index.getClass().equals(java.io.File.class) || + index.getClass().equals(Integer.class) || + index.getClass().equals(String.class) || + index.getClass().isEnum()) { + map.put("index", index); + } else if (isListOfFile(index)) { + for(int i = 0; i< getListSize(index); i++) { + map.put("index[" + i + "]", getFromList(index, i)); + } + } + else { + map.put("index", JSON.getDefault().getMapper().writeValueAsString(index)); } - this.staticFields.add(staticFieldsItem); - return this; } + if (fieldGroups != null) { + if (isFileTypeOrListOfFiles(fieldGroups)) { + fileTypeFound = true; + } - /** - * An array describing static overlay fields. **NOTE:** Only available for certain - * subscriptions. - * - * @return staticFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATIC_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getStaticFields() { - return staticFields; + if (fieldGroups.getClass().equals(java.io.File.class) || + fieldGroups.getClass().equals(Integer.class) || + fieldGroups.getClass().equals(String.class) || + fieldGroups.getClass().isEnum()) { + map.put("field_groups", fieldGroups); + } else if (isListOfFile(fieldGroups)) { + for(int i = 0; i< getListSize(fieldGroups); i++) { + map.put("field_groups[" + i + "]", getFromList(fieldGroups, i)); + } + } + else { + map.put("field_groups", JSON.getDefault().getMapper().writeValueAsString(fieldGroups)); + } } + if (formFields != null) { + if (isFileTypeOrListOfFiles(formFields)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_STATIC_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStaticFields( - @javax.annotation.Nullable List staticFields) { - this.staticFields = staticFields; + if (formFields.getClass().equals(java.io.File.class) || + formFields.getClass().equals(Integer.class) || + formFields.getClass().equals(String.class) || + formFields.getClass().isEnum()) { + map.put("form_fields", formFields); + } else if (isListOfFile(formFields)) { + for(int i = 0; i< getListSize(formFields); i++) { + map.put("form_fields[" + i + "]", getFromList(formFields, i)); + } + } + else { + map.put("form_fields", JSON.getDefault().getMapper().writeValueAsString(formFields)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocument object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); } - TemplateResponseDocument templateResponseDocument = (TemplateResponseDocument) o; - return Objects.equals(this.name, templateResponseDocument.name) - && Objects.equals(this.index, templateResponseDocument.index) - && Objects.equals(this.fieldGroups, templateResponseDocument.fieldGroups) - && Objects.equals(this.formFields, templateResponseDocument.formFields) - && Objects.equals(this.customFields, templateResponseDocument.customFields) - && Objects.equals(this.staticFields, templateResponseDocument.staticFields); } + if (staticFields != null) { + if (isFileTypeOrListOfFiles(staticFields)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(name, index, fieldGroups, formFields, customFields, staticFields); + if (staticFields.getClass().equals(java.io.File.class) || + staticFields.getClass().equals(Integer.class) || + staticFields.getClass().equals(String.class) || + staticFields.getClass().isEnum()) { + map.put("static_fields", staticFields); + } else if (isListOfFile(staticFields)) { + for(int i = 0; i< getListSize(staticFields); i++) { + map.put("static_fields[" + i + "]", getFromList(staticFields, i)); + } + } + else { + map.put("static_fields", JSON.getDefault().getMapper().writeValueAsString(staticFields)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocument {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" index: ").append(toIndentedString(index)).append("\n"); - sb.append(" fieldGroups: ").append(toIndentedString(fieldGroups)).append("\n"); - sb.append(" formFields: ").append(toIndentedString(formFields)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" staticFields: ").append(toIndentedString(staticFields)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (index != null) { - if (isFileTypeOrListOfFiles(index)) { - fileTypeFound = true; - } - - if (index.getClass().equals(java.io.File.class) - || index.getClass().equals(Integer.class) - || index.getClass().equals(String.class) - || index.getClass().isEnum()) { - map.put("index", index); - } else if (isListOfFile(index)) { - for (int i = 0; i < getListSize(index); i++) { - map.put("index[" + i + "]", getFromList(index, i)); - } - } else { - map.put("index", JSON.getDefault().getMapper().writeValueAsString(index)); - } - } - if (fieldGroups != null) { - if (isFileTypeOrListOfFiles(fieldGroups)) { - fileTypeFound = true; - } - - if (fieldGroups.getClass().equals(java.io.File.class) - || fieldGroups.getClass().equals(Integer.class) - || fieldGroups.getClass().equals(String.class) - || fieldGroups.getClass().isEnum()) { - map.put("field_groups", fieldGroups); - } else if (isListOfFile(fieldGroups)) { - for (int i = 0; i < getListSize(fieldGroups); i++) { - map.put("field_groups[" + i + "]", getFromList(fieldGroups, i)); - } - } else { - map.put( - "field_groups", - JSON.getDefault().getMapper().writeValueAsString(fieldGroups)); - } - } - if (formFields != null) { - if (isFileTypeOrListOfFiles(formFields)) { - fileTypeFound = true; - } - - if (formFields.getClass().equals(java.io.File.class) - || formFields.getClass().equals(Integer.class) - || formFields.getClass().equals(String.class) - || formFields.getClass().isEnum()) { - map.put("form_fields", formFields); - } else if (isListOfFile(formFields)) { - for (int i = 0; i < getListSize(formFields); i++) { - map.put("form_fields[" + i + "]", getFromList(formFields, i)); - } - } else { - map.put( - "form_fields", - JSON.getDefault().getMapper().writeValueAsString(formFields)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (staticFields != null) { - if (isFileTypeOrListOfFiles(staticFields)) { - fileTypeFound = true; - } - - if (staticFields.getClass().equals(java.io.File.class) - || staticFields.getClass().equals(Integer.class) - || staticFields.getClass().equals(String.class) - || staticFields.getClass().isEnum()) { - map.put("static_fields", staticFields); - } else if (isListOfFile(staticFields)) { - for (int i = 0; i < getListSize(staticFields); i++) { - map.put("static_fields[" + i + "]", getFromList(staticFields, i)); - } - } else { - map.put( - "static_fields", - JSON.getDefault().getMapper().writeValueAsString(staticFields)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java index f1190eac4..ad7ea5d3e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java @@ -10,617 +10,657 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** An array of Form Field objects containing the name and type of each named field. */ + +import com.dropbox.sign.ApiException; +/** + * An array of Form Field objects containing the name and type of each named field. + */ @JsonPropertyOrder({ - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_TYPE, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_API_ID, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_NAME, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_SIGNER, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_X, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_Y, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_WIDTH, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_HEIGHT, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_REQUIRED, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_GROUP + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_TYPE, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_API_ID, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_NAME, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_SIGNER, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_X, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_Y, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_WIDTH, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_HEIGHT, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_REQUIRED, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_GROUP }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type( - value = TemplateResponseDocumentCustomFieldCheckbox.class, - name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldText.class, name = "text"), + @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldCheckbox.class, name = "checkbox"), + @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldText.class, name = "text"), }) -public class TemplateResponseDocumentCustomFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type; - - public static final String JSON_PROPERTY_API_ID = "api_id"; - @javax.annotation.Nullable private String apiId; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_SIGNER = "signer"; - @javax.annotation.Nullable private String signer; - - public static final String JSON_PROPERTY_X = "x"; - @javax.annotation.Nullable private Integer x; - - public static final String JSON_PROPERTY_Y = "y"; - @javax.annotation.Nullable private Integer y; - - public static final String JSON_PROPERTY_WIDTH = "width"; - @javax.annotation.Nullable private Integer width; - - public static final String JSON_PROPERTY_HEIGHT = "height"; - @javax.annotation.Nullable private Integer height; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - @javax.annotation.Nullable private Boolean required; - - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nullable private String group; - - public TemplateResponseDocumentCustomFieldBase() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentCustomFieldBase init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentCustomFieldBase.class); - } - - public static TemplateResponseDocumentCustomFieldBase init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentCustomFieldBase.class); - } - - public TemplateResponseDocumentCustomFieldBase type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public TemplateResponseDocumentCustomFieldBase apiId(@javax.annotation.Nullable String apiId) { - this.apiId = apiId; - return this; - } - - /** - * The unique ID for this field. - * - * @return apiId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getApiId() { - return apiId; - } - - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiId(@javax.annotation.Nullable String apiId) { - this.apiId = apiId; - } - - public TemplateResponseDocumentCustomFieldBase name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of the Custom Field. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public TemplateResponseDocumentCustomFieldBase signer( - @javax.annotation.Nullable String signer) { - this.signer = signer; - return this; - } - - public TemplateResponseDocumentCustomFieldBase signer(Integer signer) { - this.signer = String.valueOf(signer); - return this; - } - - /** - * The signer of the Custom Field. Can be `null` if field is a merge field (assigned - * to Sender). - * - * @return signer - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigner() { - return signer; - } - - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigner(@javax.annotation.Nullable String signer) { - this.signer = signer; - } - - public void setSigner(Integer signer) { - this.signer = String.valueOf(signer); - } - - public TemplateResponseDocumentCustomFieldBase x(@javax.annotation.Nullable Integer x) { - this.x = x; - return this; - } - - /** - * The horizontal offset in pixels for this form field. - * - * @return x - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getX() { - return x; - } - - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setX(@javax.annotation.Nullable Integer x) { - this.x = x; - } - - public TemplateResponseDocumentCustomFieldBase y(@javax.annotation.Nullable Integer y) { - this.y = y; - return this; - } - - /** - * The vertical offset in pixels for this form field. - * - * @return y - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getY() { - return y; - } - - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setY(@javax.annotation.Nullable Integer y) { - this.y = y; - } - - public TemplateResponseDocumentCustomFieldBase width(@javax.annotation.Nullable Integer width) { - this.width = width; - return this; - } - - /** - * The width in pixels of this form field. - * - * @return width - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getWidth() { - return width; - } - - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWidth(@javax.annotation.Nullable Integer width) { - this.width = width; - } - - public TemplateResponseDocumentCustomFieldBase height( - @javax.annotation.Nullable Integer height) { - this.height = height; - return this; - } - - /** - * The height in pixels of this form field. - * - * @return height - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getHeight() { - return height; - } - - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeight(@javax.annotation.Nullable Integer height) { - this.height = height; - } +public class TemplateResponseDocumentCustomFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type; + + public static final String JSON_PROPERTY_API_ID = "api_id"; + @javax.annotation.Nullable + private String apiId; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_SIGNER = "signer"; + @javax.annotation.Nullable + private String signer; + + public static final String JSON_PROPERTY_X = "x"; + @javax.annotation.Nullable + private Integer x; + + public static final String JSON_PROPERTY_Y = "y"; + @javax.annotation.Nullable + private Integer y; + + public static final String JSON_PROPERTY_WIDTH = "width"; + @javax.annotation.Nullable + private Integer width; + + public static final String JSON_PROPERTY_HEIGHT = "height"; + @javax.annotation.Nullable + private Integer height; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + @javax.annotation.Nullable + private Boolean required; + + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nullable + private String group; + + public TemplateResponseDocumentCustomFieldBase() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentCustomFieldBase init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentCustomFieldBase.class); + } + + static public TemplateResponseDocumentCustomFieldBase init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentCustomFieldBase.class + ); + } + + public TemplateResponseDocumentCustomFieldBase type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public TemplateResponseDocumentCustomFieldBase apiId(@javax.annotation.Nullable String apiId) { + this.apiId = apiId; + return this; + } + + /** + * The unique ID for this field. + * @return apiId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getApiId() { + return apiId; + } + + + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiId(@javax.annotation.Nullable String apiId) { + this.apiId = apiId; + } + + + public TemplateResponseDocumentCustomFieldBase name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the Custom Field. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public TemplateResponseDocumentCustomFieldBase signer(@javax.annotation.Nullable String signer) { + this.signer = signer; + return this; + } + public TemplateResponseDocumentCustomFieldBase signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } + + /** + * The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). + * @return signer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigner() { + return signer; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigner(@javax.annotation.Nullable String signer) { + this.signer = signer; + } + + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + + + public TemplateResponseDocumentCustomFieldBase x(@javax.annotation.Nullable Integer x) { + this.x = x; + return this; + } + + /** + * The horizontal offset in pixels for this form field. + * @return x + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getX() { + return x; + } + + + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setX(@javax.annotation.Nullable Integer x) { + this.x = x; + } + + + public TemplateResponseDocumentCustomFieldBase y(@javax.annotation.Nullable Integer y) { + this.y = y; + return this; + } + + /** + * The vertical offset in pixels for this form field. + * @return y + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getY() { + return y; + } + + + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setY(@javax.annotation.Nullable Integer y) { + this.y = y; + } + + + public TemplateResponseDocumentCustomFieldBase width(@javax.annotation.Nullable Integer width) { + this.width = width; + return this; + } + + /** + * The width in pixels of this form field. + * @return width + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getWidth() { + return width; + } + + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@javax.annotation.Nullable Integer width) { + this.width = width; + } + + + public TemplateResponseDocumentCustomFieldBase height(@javax.annotation.Nullable Integer height) { + this.height = height; + return this; + } + + /** + * The height in pixels of this form field. + * @return height + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getHeight() { + return height; + } + + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@javax.annotation.Nullable Integer height) { + this.height = height; + } + + + public TemplateResponseDocumentCustomFieldBase required(@javax.annotation.Nullable Boolean required) { + this.required = required; + return this; + } + + /** + * Boolean showing whether or not this field is required. + * @return required + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRequired() { + return required; + } + + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(@javax.annotation.Nullable Boolean required) { + this.required = required; + } + + + public TemplateResponseDocumentCustomFieldBase group(@javax.annotation.Nullable String group) { + this.group = group; + return this; + } + + /** + * The name of the group this field is in. If this field is not a group, this defaults to `null`. + * @return group + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(@javax.annotation.Nullable String group) { + this.group = group; + } + + + /** + * Return true if this TemplateResponseDocumentCustomFieldBase object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentCustomFieldBase templateResponseDocumentCustomFieldBase = (TemplateResponseDocumentCustomFieldBase) o; + return Objects.equals(this.type, templateResponseDocumentCustomFieldBase.type) && + Objects.equals(this.apiId, templateResponseDocumentCustomFieldBase.apiId) && + Objects.equals(this.name, templateResponseDocumentCustomFieldBase.name) && + Objects.equals(this.signer, templateResponseDocumentCustomFieldBase.signer) && + Objects.equals(this.x, templateResponseDocumentCustomFieldBase.x) && + Objects.equals(this.y, templateResponseDocumentCustomFieldBase.y) && + Objects.equals(this.width, templateResponseDocumentCustomFieldBase.width) && + Objects.equals(this.height, templateResponseDocumentCustomFieldBase.height) && + Objects.equals(this.required, templateResponseDocumentCustomFieldBase.required) && + Objects.equals(this.group, templateResponseDocumentCustomFieldBase.group); + } + + @Override + public int hashCode() { + return Objects.hash(type, apiId, name, signer, x, y, width, height, required, group); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentCustomFieldBase {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - public TemplateResponseDocumentCustomFieldBase required( - @javax.annotation.Nullable Boolean required) { - this.required = required; - return this; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (apiId != null) { + if (isFileTypeOrListOfFiles(apiId)) { + fileTypeFound = true; + } - /** - * Boolean showing whether or not this field is required. - * - * @return required - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getRequired() { - return required; + if (apiId.getClass().equals(java.io.File.class) || + apiId.getClass().equals(Integer.class) || + apiId.getClass().equals(String.class) || + apiId.getClass().isEnum()) { + map.put("api_id", apiId); + } else if (isListOfFile(apiId)) { + for(int i = 0; i< getListSize(apiId); i++) { + map.put("api_id[" + i + "]", getFromList(apiId, i)); + } + } + else { + map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(@javax.annotation.Nullable Boolean required) { - this.required = required; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (signer != null) { + if (isFileTypeOrListOfFiles(signer)) { + fileTypeFound = true; + } - public TemplateResponseDocumentCustomFieldBase group(@javax.annotation.Nullable String group) { - this.group = group; - return this; + if (signer.getClass().equals(java.io.File.class) || + signer.getClass().equals(Integer.class) || + signer.getClass().equals(String.class) || + signer.getClass().isEnum()) { + map.put("signer", signer); + } else if (isListOfFile(signer)) { + for(int i = 0; i< getListSize(signer); i++) { + map.put("signer[" + i + "]", getFromList(signer, i)); + } + } + else { + map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); + } } + if (x != null) { + if (isFileTypeOrListOfFiles(x)) { + fileTypeFound = true; + } - /** - * The name of the group this field is in. If this field is not a group, this defaults to - * `null`. - * - * @return group - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGroup() { - return group; + if (x.getClass().equals(java.io.File.class) || + x.getClass().equals(Integer.class) || + x.getClass().equals(String.class) || + x.getClass().isEnum()) { + map.put("x", x); + } else if (isListOfFile(x)) { + for(int i = 0; i< getListSize(x); i++) { + map.put("x[" + i + "]", getFromList(x, i)); + } + } + else { + map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); + } } + if (y != null) { + if (isFileTypeOrListOfFiles(y)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(@javax.annotation.Nullable String group) { - this.group = group; + if (y.getClass().equals(java.io.File.class) || + y.getClass().equals(Integer.class) || + y.getClass().equals(String.class) || + y.getClass().isEnum()) { + map.put("y", y); + } else if (isListOfFile(y)) { + for(int i = 0; i< getListSize(y); i++) { + map.put("y[" + i + "]", getFromList(y, i)); + } + } + else { + map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); + } } + if (width != null) { + if (isFileTypeOrListOfFiles(width)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentCustomFieldBase object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (width.getClass().equals(java.io.File.class) || + width.getClass().equals(Integer.class) || + width.getClass().equals(String.class) || + width.getClass().isEnum()) { + map.put("width", width); + } else if (isListOfFile(width)) { + for(int i = 0; i< getListSize(width); i++) { + map.put("width[" + i + "]", getFromList(width, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); } - TemplateResponseDocumentCustomFieldBase templateResponseDocumentCustomFieldBase = - (TemplateResponseDocumentCustomFieldBase) o; - return Objects.equals(this.type, templateResponseDocumentCustomFieldBase.type) - && Objects.equals(this.apiId, templateResponseDocumentCustomFieldBase.apiId) - && Objects.equals(this.name, templateResponseDocumentCustomFieldBase.name) - && Objects.equals(this.signer, templateResponseDocumentCustomFieldBase.signer) - && Objects.equals(this.x, templateResponseDocumentCustomFieldBase.x) - && Objects.equals(this.y, templateResponseDocumentCustomFieldBase.y) - && Objects.equals(this.width, templateResponseDocumentCustomFieldBase.width) - && Objects.equals(this.height, templateResponseDocumentCustomFieldBase.height) - && Objects.equals(this.required, templateResponseDocumentCustomFieldBase.required) - && Objects.equals(this.group, templateResponseDocumentCustomFieldBase.group); } + if (height != null) { + if (isFileTypeOrListOfFiles(height)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(type, apiId, name, signer, x, y, width, height, required, group); + if (height.getClass().equals(java.io.File.class) || + height.getClass().equals(Integer.class) || + height.getClass().equals(String.class) || + height.getClass().isEnum()) { + map.put("height", height); + } else if (isListOfFile(height)) { + for(int i = 0; i< getListSize(height); i++) { + map.put("height[" + i + "]", getFromList(height, i)); + } + } + else { + map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); + } } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentCustomFieldBase {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); - sb.append(" x: ").append(toIndentedString(x)).append("\n"); - sb.append(" y: ").append(toIndentedString(y)).append("\n"); - sb.append(" width: ").append(toIndentedString(width)).append("\n"); - sb.append(" height: ").append(toIndentedString(height)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); + if (required.getClass().equals(java.io.File.class) || + required.getClass().equals(Integer.class) || + required.getClass().equals(String.class) || + required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for(int i = 0; i< getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } + else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (apiId != null) { - if (isFileTypeOrListOfFiles(apiId)) { - fileTypeFound = true; - } - - if (apiId.getClass().equals(java.io.File.class) - || apiId.getClass().equals(Integer.class) - || apiId.getClass().equals(String.class) - || apiId.getClass().isEnum()) { - map.put("api_id", apiId); - } else if (isListOfFile(apiId)) { - for (int i = 0; i < getListSize(apiId); i++) { - map.put("api_id[" + i + "]", getFromList(apiId, i)); - } - } else { - map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (signer != null) { - if (isFileTypeOrListOfFiles(signer)) { - fileTypeFound = true; - } - - if (signer.getClass().equals(java.io.File.class) - || signer.getClass().equals(Integer.class) - || signer.getClass().equals(String.class) - || signer.getClass().isEnum()) { - map.put("signer", signer); - } else if (isListOfFile(signer)) { - for (int i = 0; i < getListSize(signer); i++) { - map.put("signer[" + i + "]", getFromList(signer, i)); - } - } else { - map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); - } - } - if (x != null) { - if (isFileTypeOrListOfFiles(x)) { - fileTypeFound = true; - } - - if (x.getClass().equals(java.io.File.class) - || x.getClass().equals(Integer.class) - || x.getClass().equals(String.class) - || x.getClass().isEnum()) { - map.put("x", x); - } else if (isListOfFile(x)) { - for (int i = 0; i < getListSize(x); i++) { - map.put("x[" + i + "]", getFromList(x, i)); - } - } else { - map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); - } + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); } - if (y != null) { - if (isFileTypeOrListOfFiles(y)) { - fileTypeFound = true; - } - - if (y.getClass().equals(java.io.File.class) - || y.getClass().equals(Integer.class) - || y.getClass().equals(String.class) - || y.getClass().isEnum()) { - map.put("y", y); - } else if (isListOfFile(y)) { - for (int i = 0; i < getListSize(y); i++) { - map.put("y[" + i + "]", getFromList(y, i)); - } - } else { - map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); - } - } - if (width != null) { - if (isFileTypeOrListOfFiles(width)) { - fileTypeFound = true; - } - - if (width.getClass().equals(java.io.File.class) - || width.getClass().equals(Integer.class) - || width.getClass().equals(String.class) - || width.getClass().isEnum()) { - map.put("width", width); - } else if (isListOfFile(width)) { - for (int i = 0; i < getListSize(width); i++) { - map.put("width[" + i + "]", getFromList(width, i)); - } - } else { - map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); - } - } - if (height != null) { - if (isFileTypeOrListOfFiles(height)) { - fileTypeFound = true; - } - - if (height.getClass().equals(java.io.File.class) - || height.getClass().equals(Integer.class) - || height.getClass().equals(String.class) - || height.getClass().isEnum()) { - map.put("height", height); - } else if (isListOfFile(height)) { - for (int i = 0; i < getListSize(height); i++) { - map.put("height[" + i + "]", getFromList(height, i)); - } - } else { - map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); - } - } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - - if (required.getClass().equals(java.io.File.class) - || required.getClass().equals(Integer.class) - || required.getClass().equals(String.class) - || required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for (int i = 0; i < getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } - } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("checkbox", TemplateResponseDocumentCustomFieldCheckbox.class); - mappings.put("text", TemplateResponseDocumentCustomFieldText.class); - mappings.put( - "TemplateResponseDocumentCustomFieldBase", - TemplateResponseDocumentCustomFieldBase.class); - JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldBase.class, "type", mappings); + /** + * 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 "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("checkbox", TemplateResponseDocumentCustomFieldCheckbox.class); + mappings.put("text", TemplateResponseDocumentCustomFieldText.class); + mappings.put("TemplateResponseDocumentCustomFieldBase", TemplateResponseDocumentCustomFieldBase.class); + JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldBase.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java index ffde88fb2..febb94df2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java @@ -10,186 +10,188 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** This class extends `TemplateResponseDocumentCustomFieldBase` */ -@JsonPropertyOrder({TemplateResponseDocumentCustomFieldCheckbox.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentCustomFieldCheckbox - extends TemplateResponseDocumentCustomFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "checkbox"; - - public TemplateResponseDocumentCustomFieldCheckbox() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentCustomFieldCheckbox init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentCustomFieldCheckbox.class); - } - public static TemplateResponseDocumentCustomFieldCheckbox init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentCustomFieldCheckbox.class); - } - - public TemplateResponseDocumentCustomFieldCheckbox type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this Custom Field. Only `text` and `checkbox` are currently - * supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses - * `TemplateResponseDocumentCustomFieldCheckbox` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentCustomFieldBase` + */ +@JsonPropertyOrder({ + TemplateResponseDocumentCustomFieldCheckbox.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocumentCustomFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "checkbox"; + + public TemplateResponseDocumentCustomFieldCheckbox() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentCustomFieldCheckbox init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentCustomFieldCheckbox.class); + } + + static public TemplateResponseDocumentCustomFieldCheckbox init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentCustomFieldCheckbox.class + ); + } + + public TemplateResponseDocumentCustomFieldCheckbox type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + /** + * Return true if this TemplateResponseDocumentCustomFieldCheckbox object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentCustomFieldCheckbox templateResponseDocumentCustomFieldCheckbox = (TemplateResponseDocumentCustomFieldCheckbox) o; + return Objects.equals(this.type, templateResponseDocumentCustomFieldCheckbox.type) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentCustomFieldCheckbox {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentCustomFieldCheckbox object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentCustomFieldCheckbox templateResponseDocumentCustomFieldCheckbox = - (TemplateResponseDocumentCustomFieldCheckbox) o; - return Objects.equals(this.type, templateResponseDocumentCustomFieldCheckbox.type) - && super.equals(o); } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentCustomFieldCheckbox {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + /** + * 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 "); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentCustomFieldCheckbox", - TemplateResponseDocumentCustomFieldCheckbox.class); - JSON.registerDiscriminator( - TemplateResponseDocumentCustomFieldCheckbox.class, "type", mappings); - } + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentCustomFieldCheckbox", TemplateResponseDocumentCustomFieldCheckbox.class); + JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldCheckbox.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java index 1540bbba5..90100ff3b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java @@ -10,389 +10,393 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldBase; +import com.dropbox.sign.model.TemplateResponseFieldAvgTextLength; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `TemplateResponseDocumentCustomFieldBase` */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentCustomFieldBase` + */ @JsonPropertyOrder({ - TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_TYPE, - TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_AVG_TEXT_LENGTH, - TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_IS_MULTILINE, - TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_ORIGINAL_FONT_SIZE, - TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_FONT_FAMILY + TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_TYPE, + TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_AVG_TEXT_LENGTH, + TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_IS_MULTILINE, + TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_ORIGINAL_FONT_SIZE, + TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_FONT_FAMILY }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentCustomFieldText - extends TemplateResponseDocumentCustomFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "text"; - - public static final String JSON_PROPERTY_AVG_TEXT_LENGTH = "avg_text_length"; - @javax.annotation.Nullable private TemplateResponseFieldAvgTextLength avgTextLength; - - public static final String JSON_PROPERTY_IS_MULTILINE = "isMultiline"; - @javax.annotation.Nullable private Boolean isMultiline; - - public static final String JSON_PROPERTY_ORIGINAL_FONT_SIZE = "originalFontSize"; - @javax.annotation.Nullable private Integer originalFontSize; - - public static final String JSON_PROPERTY_FONT_FAMILY = "fontFamily"; - @javax.annotation.Nullable private String fontFamily; - - public TemplateResponseDocumentCustomFieldText() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentCustomFieldText init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentCustomFieldText.class); - } - - public static TemplateResponseDocumentCustomFieldText init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentCustomFieldText.class); - } - - public TemplateResponseDocumentCustomFieldText type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this Custom Field. Only `text` and `checkbox` are currently - * supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses - * `TemplateResponseDocumentCustomFieldCheckbox` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCustomFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "text"; + + public static final String JSON_PROPERTY_AVG_TEXT_LENGTH = "avg_text_length"; + @javax.annotation.Nullable + private TemplateResponseFieldAvgTextLength avgTextLength; + + public static final String JSON_PROPERTY_IS_MULTILINE = "isMultiline"; + @javax.annotation.Nullable + private Boolean isMultiline; + + public static final String JSON_PROPERTY_ORIGINAL_FONT_SIZE = "originalFontSize"; + @javax.annotation.Nullable + private Integer originalFontSize; + + public static final String JSON_PROPERTY_FONT_FAMILY = "fontFamily"; + @javax.annotation.Nullable + private String fontFamily; + + public TemplateResponseDocumentCustomFieldText() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentCustomFieldText init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentCustomFieldText.class); + } + + static public TemplateResponseDocumentCustomFieldText init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentCustomFieldText.class + ); + } + + public TemplateResponseDocumentCustomFieldText type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public TemplateResponseDocumentCustomFieldText avgTextLength(@javax.annotation.Nullable TemplateResponseFieldAvgTextLength avgTextLength) { + this.avgTextLength = avgTextLength; + return this; + } + + /** + * Get avgTextLength + * @return avgTextLength + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TemplateResponseFieldAvgTextLength getAvgTextLength() { + return avgTextLength; + } + + + @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAvgTextLength(@javax.annotation.Nullable TemplateResponseFieldAvgTextLength avgTextLength) { + this.avgTextLength = avgTextLength; + } + + + public TemplateResponseDocumentCustomFieldText isMultiline(@javax.annotation.Nullable Boolean isMultiline) { + this.isMultiline = isMultiline; + return this; + } + + /** + * Whether this form field is multiline text. + * @return isMultiline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_MULTILINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsMultiline() { + return isMultiline; + } + + + @JsonProperty(JSON_PROPERTY_IS_MULTILINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMultiline(@javax.annotation.Nullable Boolean isMultiline) { + this.isMultiline = isMultiline; + } + + + public TemplateResponseDocumentCustomFieldText originalFontSize(@javax.annotation.Nullable Integer originalFontSize) { + this.originalFontSize = originalFontSize; + return this; + } + + /** + * Original font size used in this form field's text. + * @return originalFontSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getOriginalFontSize() { + return originalFontSize; + } + + + @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalFontSize(@javax.annotation.Nullable Integer originalFontSize) { + this.originalFontSize = originalFontSize; + } + + + public TemplateResponseDocumentCustomFieldText fontFamily(@javax.annotation.Nullable String fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family used in this form field's text. + * @return fontFamily + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFontFamily() { + return fontFamily; + } + + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(@javax.annotation.Nullable String fontFamily) { + this.fontFamily = fontFamily; + } + + + /** + * Return true if this TemplateResponseDocumentCustomFieldText object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public TemplateResponseDocumentCustomFieldText avgTextLength( - @javax.annotation.Nullable TemplateResponseFieldAvgTextLength avgTextLength) { - this.avgTextLength = avgTextLength; - return this; - } - - /** - * Get avgTextLength - * - * @return avgTextLength - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TemplateResponseFieldAvgTextLength getAvgTextLength() { - return avgTextLength; - } - - @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAvgTextLength( - @javax.annotation.Nullable TemplateResponseFieldAvgTextLength avgTextLength) { - this.avgTextLength = avgTextLength; - } - - public TemplateResponseDocumentCustomFieldText isMultiline( - @javax.annotation.Nullable Boolean isMultiline) { - this.isMultiline = isMultiline; - return this; - } - - /** - * Whether this form field is multiline text. - * - * @return isMultiline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_MULTILINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsMultiline() { - return isMultiline; - } - - @JsonProperty(JSON_PROPERTY_IS_MULTILINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsMultiline(@javax.annotation.Nullable Boolean isMultiline) { - this.isMultiline = isMultiline; - } - - public TemplateResponseDocumentCustomFieldText originalFontSize( - @javax.annotation.Nullable Integer originalFontSize) { - this.originalFontSize = originalFontSize; - return this; - } - - /** - * Original font size used in this form field's text. - * - * @return originalFontSize - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getOriginalFontSize() { - return originalFontSize; - } - - @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOriginalFontSize(@javax.annotation.Nullable Integer originalFontSize) { - this.originalFontSize = originalFontSize; - } - - public TemplateResponseDocumentCustomFieldText fontFamily( - @javax.annotation.Nullable String fontFamily) { - this.fontFamily = fontFamily; - return this; - } - - /** - * Font family used in this form field's text. - * - * @return fontFamily - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFontFamily() { - return fontFamily; + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentCustomFieldText templateResponseDocumentCustomFieldText = (TemplateResponseDocumentCustomFieldText) o; + return Objects.equals(this.type, templateResponseDocumentCustomFieldText.type) && + Objects.equals(this.avgTextLength, templateResponseDocumentCustomFieldText.avgTextLength) && + Objects.equals(this.isMultiline, templateResponseDocumentCustomFieldText.isMultiline) && + Objects.equals(this.originalFontSize, templateResponseDocumentCustomFieldText.originalFontSize) && + Objects.equals(this.fontFamily, templateResponseDocumentCustomFieldText.fontFamily) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, avgTextLength, isMultiline, originalFontSize, fontFamily, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentCustomFieldText {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" avgTextLength: ").append(toIndentedString(avgTextLength)).append("\n"); + sb.append(" isMultiline: ").append(toIndentedString(isMultiline)).append("\n"); + sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(@javax.annotation.Nullable String fontFamily) { - this.fontFamily = fontFamily; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (avgTextLength != null) { + if (isFileTypeOrListOfFiles(avgTextLength)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentCustomFieldText object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (avgTextLength.getClass().equals(java.io.File.class) || + avgTextLength.getClass().equals(Integer.class) || + avgTextLength.getClass().equals(String.class) || + avgTextLength.getClass().isEnum()) { + map.put("avg_text_length", avgTextLength); + } else if (isListOfFile(avgTextLength)) { + for(int i = 0; i< getListSize(avgTextLength); i++) { + map.put("avg_text_length[" + i + "]", getFromList(avgTextLength, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("avg_text_length", JSON.getDefault().getMapper().writeValueAsString(avgTextLength)); } - TemplateResponseDocumentCustomFieldText templateResponseDocumentCustomFieldText = - (TemplateResponseDocumentCustomFieldText) o; - return Objects.equals(this.type, templateResponseDocumentCustomFieldText.type) - && Objects.equals( - this.avgTextLength, templateResponseDocumentCustomFieldText.avgTextLength) - && Objects.equals( - this.isMultiline, templateResponseDocumentCustomFieldText.isMultiline) - && Objects.equals( - this.originalFontSize, - templateResponseDocumentCustomFieldText.originalFontSize) - && Objects.equals( - this.fontFamily, templateResponseDocumentCustomFieldText.fontFamily) - && super.equals(o); } + if (isMultiline != null) { + if (isFileTypeOrListOfFiles(isMultiline)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - type, avgTextLength, isMultiline, originalFontSize, fontFamily, super.hashCode()); + if (isMultiline.getClass().equals(java.io.File.class) || + isMultiline.getClass().equals(Integer.class) || + isMultiline.getClass().equals(String.class) || + isMultiline.getClass().isEnum()) { + map.put("isMultiline", isMultiline); + } else if (isListOfFile(isMultiline)) { + for(int i = 0; i< getListSize(isMultiline); i++) { + map.put("isMultiline[" + i + "]", getFromList(isMultiline, i)); + } + } + else { + map.put("isMultiline", JSON.getDefault().getMapper().writeValueAsString(isMultiline)); + } } + if (originalFontSize != null) { + if (isFileTypeOrListOfFiles(originalFontSize)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentCustomFieldText {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" avgTextLength: ").append(toIndentedString(avgTextLength)).append("\n"); - sb.append(" isMultiline: ").append(toIndentedString(isMultiline)).append("\n"); - sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append("}"); - return sb.toString(); + if (originalFontSize.getClass().equals(java.io.File.class) || + originalFontSize.getClass().equals(Integer.class) || + originalFontSize.getClass().equals(String.class) || + originalFontSize.getClass().isEnum()) { + map.put("originalFontSize", originalFontSize); + } else if (isListOfFile(originalFontSize)) { + for(int i = 0; i< getListSize(originalFontSize); i++) { + map.put("originalFontSize[" + i + "]", getFromList(originalFontSize, i)); + } + } + else { + map.put("originalFontSize", JSON.getDefault().getMapper().writeValueAsString(originalFontSize)); + } } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (avgTextLength != null) { - if (isFileTypeOrListOfFiles(avgTextLength)) { - fileTypeFound = true; - } - - if (avgTextLength.getClass().equals(java.io.File.class) - || avgTextLength.getClass().equals(Integer.class) - || avgTextLength.getClass().equals(String.class) - || avgTextLength.getClass().isEnum()) { - map.put("avg_text_length", avgTextLength); - } else if (isListOfFile(avgTextLength)) { - for (int i = 0; i < getListSize(avgTextLength); i++) { - map.put("avg_text_length[" + i + "]", getFromList(avgTextLength, i)); - } - } else { - map.put( - "avg_text_length", - JSON.getDefault().getMapper().writeValueAsString(avgTextLength)); - } - } - if (isMultiline != null) { - if (isFileTypeOrListOfFiles(isMultiline)) { - fileTypeFound = true; - } - - if (isMultiline.getClass().equals(java.io.File.class) - || isMultiline.getClass().equals(Integer.class) - || isMultiline.getClass().equals(String.class) - || isMultiline.getClass().isEnum()) { - map.put("isMultiline", isMultiline); - } else if (isListOfFile(isMultiline)) { - for (int i = 0; i < getListSize(isMultiline); i++) { - map.put("isMultiline[" + i + "]", getFromList(isMultiline, i)); - } - } else { - map.put( - "isMultiline", - JSON.getDefault().getMapper().writeValueAsString(isMultiline)); - } + if (fontFamily.getClass().equals(java.io.File.class) || + fontFamily.getClass().equals(Integer.class) || + fontFamily.getClass().equals(String.class) || + fontFamily.getClass().isEnum()) { + map.put("fontFamily", fontFamily); + } else if (isListOfFile(fontFamily)) { + for(int i = 0; i< getListSize(fontFamily); i++) { + map.put("fontFamily[" + i + "]", getFromList(fontFamily, i)); } - if (originalFontSize != null) { - if (isFileTypeOrListOfFiles(originalFontSize)) { - fileTypeFound = true; - } - - if (originalFontSize.getClass().equals(java.io.File.class) - || originalFontSize.getClass().equals(Integer.class) - || originalFontSize.getClass().equals(String.class) - || originalFontSize.getClass().isEnum()) { - map.put("originalFontSize", originalFontSize); - } else if (isListOfFile(originalFontSize)) { - for (int i = 0; i < getListSize(originalFontSize); i++) { - map.put("originalFontSize[" + i + "]", getFromList(originalFontSize, i)); - } - } else { - map.put( - "originalFontSize", - JSON.getDefault().getMapper().writeValueAsString(originalFontSize)); - } - } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - - if (fontFamily.getClass().equals(java.io.File.class) - || fontFamily.getClass().equals(Integer.class) - || fontFamily.getClass().equals(String.class) - || fontFamily.getClass().isEnum()) { - map.put("fontFamily", fontFamily); - } else if (isListOfFile(fontFamily)) { - for (int i = 0; i < getListSize(fontFamily); i++) { - map.put("fontFamily[" + i + "]", getFromList(fontFamily, i)); - } - } else { - map.put( - "fontFamily", - JSON.getDefault().getMapper().writeValueAsString(fontFamily)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("fontFamily", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentCustomFieldText", - TemplateResponseDocumentCustomFieldText.class); - JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldText.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentCustomFieldText", TemplateResponseDocumentCustomFieldText.class); + JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldText.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java index d7e2969d5..b31c07c35 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java @@ -10,208 +10,222 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentFieldGroupRule; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TemplateResponseDocumentFieldGroup */ + +import com.dropbox.sign.ApiException; +/** + * TemplateResponseDocumentFieldGroup + */ @JsonPropertyOrder({ - TemplateResponseDocumentFieldGroup.JSON_PROPERTY_NAME, - TemplateResponseDocumentFieldGroup.JSON_PROPERTY_RULE + TemplateResponseDocumentFieldGroup.JSON_PROPERTY_NAME, + TemplateResponseDocumentFieldGroup.JSON_PROPERTY_RULE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateResponseDocumentFieldGroup { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_RULE = "rule"; - @javax.annotation.Nullable private TemplateResponseDocumentFieldGroupRule rule; - - public TemplateResponseDocumentFieldGroup() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentFieldGroup init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFieldGroup.class); - } - - public static TemplateResponseDocumentFieldGroup init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFieldGroup.class); - } - - public TemplateResponseDocumentFieldGroup name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of the form field group. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public TemplateResponseDocumentFieldGroup rule( - @javax.annotation.Nullable TemplateResponseDocumentFieldGroupRule rule) { - this.rule = rule; - return this; - } - - /** - * Get rule - * - * @return rule - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RULE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TemplateResponseDocumentFieldGroupRule getRule() { - return rule; - } + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_RULE = "rule"; + @javax.annotation.Nullable + private TemplateResponseDocumentFieldGroupRule rule; + + public TemplateResponseDocumentFieldGroup() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentFieldGroup init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFieldGroup.class); + } + + static public TemplateResponseDocumentFieldGroup init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFieldGroup.class + ); + } + + public TemplateResponseDocumentFieldGroup name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the form field group. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public TemplateResponseDocumentFieldGroup rule(@javax.annotation.Nullable TemplateResponseDocumentFieldGroupRule rule) { + this.rule = rule; + return this; + } + + /** + * Get rule + * @return rule + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TemplateResponseDocumentFieldGroupRule getRule() { + return rule; + } + + + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRule(@javax.annotation.Nullable TemplateResponseDocumentFieldGroupRule rule) { + this.rule = rule; + } + + + /** + * Return true if this TemplateResponseDocumentFieldGroup object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentFieldGroup templateResponseDocumentFieldGroup = (TemplateResponseDocumentFieldGroup) o; + return Objects.equals(this.name, templateResponseDocumentFieldGroup.name) && + Objects.equals(this.rule, templateResponseDocumentFieldGroup.rule); + } + + @Override + public int hashCode() { + return Objects.hash(name, rule); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFieldGroup {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_RULE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRule(@javax.annotation.Nullable TemplateResponseDocumentFieldGroupRule rule) { - this.rule = rule; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (rule != null) { + if (isFileTypeOrListOfFiles(rule)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentFieldGroup object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (rule.getClass().equals(java.io.File.class) || + rule.getClass().equals(Integer.class) || + rule.getClass().equals(String.class) || + rule.getClass().isEnum()) { + map.put("rule", rule); + } else if (isListOfFile(rule)) { + for(int i = 0; i< getListSize(rule); i++) { + map.put("rule[" + i + "]", getFromList(rule, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("rule", JSON.getDefault().getMapper().writeValueAsString(rule)); } - TemplateResponseDocumentFieldGroup templateResponseDocumentFieldGroup = - (TemplateResponseDocumentFieldGroup) o; - return Objects.equals(this.name, templateResponseDocumentFieldGroup.name) - && Objects.equals(this.rule, templateResponseDocumentFieldGroup.rule); } - - @Override - public int hashCode() { - return Objects.hash(name, rule); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFieldGroup {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (rule != null) { - if (isFileTypeOrListOfFiles(rule)) { - fileTypeFound = true; - } - - if (rule.getClass().equals(java.io.File.class) - || rule.getClass().equals(Integer.class) - || rule.getClass().equals(String.class) - || rule.getClass().isEnum()) { - map.put("rule", rule); - } else if (isListOfFile(rule)) { - for (int i = 0; i < getListSize(rule); i++) { - map.put("rule[" + i + "]", getFromList(rule, i)); - } - } else { - map.put("rule", JSON.getDefault().getMapper().writeValueAsString(rule)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java index ea499db4b..0355be1ff 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java @@ -10,222 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; + +import com.dropbox.sign.ApiException; /** - * The rule used to validate checkboxes in the form field group. See [checkbox field - * grouping](/api/reference/constants/#checkbox-field-grouping). + * The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping). */ @JsonPropertyOrder({ - TemplateResponseDocumentFieldGroupRule.JSON_PROPERTY_REQUIREMENT, - TemplateResponseDocumentFieldGroupRule.JSON_PROPERTY_GROUP_LABEL + TemplateResponseDocumentFieldGroupRule.JSON_PROPERTY_REQUIREMENT, + TemplateResponseDocumentFieldGroupRule.JSON_PROPERTY_GROUP_LABEL }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateResponseDocumentFieldGroupRule { - public static final String JSON_PROPERTY_REQUIREMENT = "requirement"; - @javax.annotation.Nullable private String requirement; - - public static final String JSON_PROPERTY_GROUP_LABEL = "groupLabel"; - @javax.annotation.Nullable private String groupLabel; - - public TemplateResponseDocumentFieldGroupRule() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentFieldGroupRule init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFieldGroupRule.class); - } - - public static TemplateResponseDocumentFieldGroupRule init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFieldGroupRule.class); - } - - public TemplateResponseDocumentFieldGroupRule requirement( - @javax.annotation.Nullable String requirement) { - this.requirement = requirement; - return this; - } - - /** - * Examples: `require_0-1` `require_1` `require_1-ormore` - Check - * out the list of [acceptable `requirement` checkbox type - * values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of - * [acceptable `requirement` radio type - * fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** - * two fields per group. - * - * @return requirement - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIREMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRequirement() { - return requirement; - } - - @JsonProperty(JSON_PROPERTY_REQUIREMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequirement(@javax.annotation.Nullable String requirement) { - this.requirement = requirement; - } - - public TemplateResponseDocumentFieldGroupRule groupLabel( - @javax.annotation.Nullable String groupLabel) { - this.groupLabel = groupLabel; - return this; - } - - /** - * Name of the group - * - * @return groupLabel - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP_LABEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGroupLabel() { - return groupLabel; - } + public static final String JSON_PROPERTY_REQUIREMENT = "requirement"; + @javax.annotation.Nullable + private String requirement; + + public static final String JSON_PROPERTY_GROUP_LABEL = "groupLabel"; + @javax.annotation.Nullable + private String groupLabel; + + public TemplateResponseDocumentFieldGroupRule() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentFieldGroupRule init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFieldGroupRule.class); + } + + static public TemplateResponseDocumentFieldGroupRule init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFieldGroupRule.class + ); + } + + public TemplateResponseDocumentFieldGroupRule requirement(@javax.annotation.Nullable String requirement) { + this.requirement = requirement; + return this; + } + + /** + * Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. + * @return requirement + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIREMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRequirement() { + return requirement; + } + + + @JsonProperty(JSON_PROPERTY_REQUIREMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequirement(@javax.annotation.Nullable String requirement) { + this.requirement = requirement; + } + + + public TemplateResponseDocumentFieldGroupRule groupLabel(@javax.annotation.Nullable String groupLabel) { + this.groupLabel = groupLabel; + return this; + } + + /** + * Name of the group + * @return groupLabel + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroupLabel() { + return groupLabel; + } + + + @JsonProperty(JSON_PROPERTY_GROUP_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupLabel(@javax.annotation.Nullable String groupLabel) { + this.groupLabel = groupLabel; + } + + + /** + * Return true if this TemplateResponseDocumentFieldGroupRule object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentFieldGroupRule templateResponseDocumentFieldGroupRule = (TemplateResponseDocumentFieldGroupRule) o; + return Objects.equals(this.requirement, templateResponseDocumentFieldGroupRule.requirement) && + Objects.equals(this.groupLabel, templateResponseDocumentFieldGroupRule.groupLabel); + } + + @Override + public int hashCode() { + return Objects.hash(requirement, groupLabel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFieldGroupRule {\n"); + sb.append(" requirement: ").append(toIndentedString(requirement)).append("\n"); + sb.append(" groupLabel: ").append(toIndentedString(groupLabel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (requirement != null) { + if (isFileTypeOrListOfFiles(requirement)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_GROUP_LABEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroupLabel(@javax.annotation.Nullable String groupLabel) { - this.groupLabel = groupLabel; + if (requirement.getClass().equals(java.io.File.class) || + requirement.getClass().equals(Integer.class) || + requirement.getClass().equals(String.class) || + requirement.getClass().isEnum()) { + map.put("requirement", requirement); + } else if (isListOfFile(requirement)) { + for(int i = 0; i< getListSize(requirement); i++) { + map.put("requirement[" + i + "]", getFromList(requirement, i)); + } + } + else { + map.put("requirement", JSON.getDefault().getMapper().writeValueAsString(requirement)); + } } + if (groupLabel != null) { + if (isFileTypeOrListOfFiles(groupLabel)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentFieldGroupRule object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (groupLabel.getClass().equals(java.io.File.class) || + groupLabel.getClass().equals(Integer.class) || + groupLabel.getClass().equals(String.class) || + groupLabel.getClass().isEnum()) { + map.put("groupLabel", groupLabel); + } else if (isListOfFile(groupLabel)) { + for(int i = 0; i< getListSize(groupLabel); i++) { + map.put("groupLabel[" + i + "]", getFromList(groupLabel, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("groupLabel", JSON.getDefault().getMapper().writeValueAsString(groupLabel)); } - TemplateResponseDocumentFieldGroupRule templateResponseDocumentFieldGroupRule = - (TemplateResponseDocumentFieldGroupRule) o; - return Objects.equals(this.requirement, templateResponseDocumentFieldGroupRule.requirement) - && Objects.equals( - this.groupLabel, templateResponseDocumentFieldGroupRule.groupLabel); } - - @Override - public int hashCode() { - return Objects.hash(requirement, groupLabel); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFieldGroupRule {\n"); - sb.append(" requirement: ").append(toIndentedString(requirement)).append("\n"); - sb.append(" groupLabel: ").append(toIndentedString(groupLabel)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (requirement != null) { - if (isFileTypeOrListOfFiles(requirement)) { - fileTypeFound = true; - } - - if (requirement.getClass().equals(java.io.File.class) - || requirement.getClass().equals(Integer.class) - || requirement.getClass().equals(String.class) - || requirement.getClass().isEnum()) { - map.put("requirement", requirement); - } else if (isListOfFile(requirement)) { - for (int i = 0; i < getListSize(requirement); i++) { - map.put("requirement[" + i + "]", getFromList(requirement, i)); - } - } else { - map.put( - "requirement", - JSON.getDefault().getMapper().writeValueAsString(requirement)); - } - } - if (groupLabel != null) { - if (isFileTypeOrListOfFiles(groupLabel)) { - fileTypeFound = true; - } - - if (groupLabel.getClass().equals(java.io.File.class) - || groupLabel.getClass().equals(Integer.class) - || groupLabel.getClass().equals(String.class) - || groupLabel.getClass().isEnum()) { - map.put("groupLabel", groupLabel); - } else if (isListOfFile(groupLabel)) { - for (int i = 0; i < getListSize(groupLabel); i++) { - map.put("groupLabel[" + i + "]", getFromList(groupLabel, i)); - } - } else { - map.put( - "groupLabel", - JSON.getDefault().getMapper().writeValueAsString(groupLabel)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java index 9ab25a45b..969495019 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java @@ -10,582 +10,618 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** An array of Form Field objects containing the name and type of each named field. */ + +import com.dropbox.sign.ApiException; +/** + * An array of Form Field objects containing the name and type of each named field. + */ @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_TYPE, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_API_ID, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_NAME, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_SIGNER, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_X, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_Y, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_WIDTH, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_HEIGHT, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_REQUIRED + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_TYPE, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_API_ID, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_NAME, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_SIGNER, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_X, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_Y, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_WIDTH, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_HEIGHT, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_REQUIRED }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type( - value = TemplateResponseDocumentFormFieldDateSigned.class, - name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type( - value = TemplateResponseDocumentFormFieldHyperlink.class, - name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldRadio.class, name = "radio"), - @JsonSubTypes.Type( - value = TemplateResponseDocumentFormFieldSignature.class, - name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldText.class, name = "text"), + @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), + @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDateSigned.class, name = "date_signed"), + @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDropdown.class, name = "dropdown"), + @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldHyperlink.class, name = "hyperlink"), + @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldInitials.class, name = "initials"), + @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldRadio.class, name = "radio"), + @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldSignature.class, name = "signature"), + @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldText.class, name = "text"), }) -public class TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type; - - public static final String JSON_PROPERTY_API_ID = "api_id"; - @javax.annotation.Nullable private String apiId; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_SIGNER = "signer"; - @javax.annotation.Nullable private String signer; - - public static final String JSON_PROPERTY_X = "x"; - @javax.annotation.Nullable private Integer x; - - public static final String JSON_PROPERTY_Y = "y"; - @javax.annotation.Nullable private Integer y; - - public static final String JSON_PROPERTY_WIDTH = "width"; - @javax.annotation.Nullable private Integer width; - - public static final String JSON_PROPERTY_HEIGHT = "height"; - @javax.annotation.Nullable private Integer height; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - @javax.annotation.Nullable private Boolean required; - - public TemplateResponseDocumentFormFieldBase() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentFormFieldBase init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldBase.class); - } - - public static TemplateResponseDocumentFormFieldBase init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldBase.class); - } - - public TemplateResponseDocumentFormFieldBase type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public TemplateResponseDocumentFormFieldBase apiId(@javax.annotation.Nullable String apiId) { - this.apiId = apiId; - return this; - } - - /** - * A unique id for the form field. - * - * @return apiId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getApiId() { - return apiId; - } - - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiId(@javax.annotation.Nullable String apiId) { - this.apiId = apiId; - } - - public TemplateResponseDocumentFormFieldBase name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of the form field. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public TemplateResponseDocumentFormFieldBase signer(@javax.annotation.Nullable String signer) { - this.signer = signer; - return this; - } - - public TemplateResponseDocumentFormFieldBase signer(Integer signer) { - this.signer = String.valueOf(signer); - return this; - } - - /** - * The signer of the Form Field. - * - * @return signer - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigner() { - return signer; - } - - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigner(@javax.annotation.Nullable String signer) { - this.signer = signer; - } - - public void setSigner(Integer signer) { - this.signer = String.valueOf(signer); - } - - public TemplateResponseDocumentFormFieldBase x(@javax.annotation.Nullable Integer x) { - this.x = x; - return this; - } - - /** - * The horizontal offset in pixels for this form field. - * - * @return x - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getX() { - return x; - } - - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setX(@javax.annotation.Nullable Integer x) { - this.x = x; - } - - public TemplateResponseDocumentFormFieldBase y(@javax.annotation.Nullable Integer y) { - this.y = y; - return this; - } - - /** - * The vertical offset in pixels for this form field. - * - * @return y - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getY() { - return y; - } - - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setY(@javax.annotation.Nullable Integer y) { - this.y = y; - } - - public TemplateResponseDocumentFormFieldBase width(@javax.annotation.Nullable Integer width) { - this.width = width; - return this; - } - - /** - * The width in pixels of this form field. - * - * @return width - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getWidth() { - return width; - } - - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWidth(@javax.annotation.Nullable Integer width) { - this.width = width; - } - - public TemplateResponseDocumentFormFieldBase height(@javax.annotation.Nullable Integer height) { - this.height = height; - return this; - } - - /** - * The height in pixels of this form field. - * - * @return height - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getHeight() { - return height; - } - - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeight(@javax.annotation.Nullable Integer height) { - this.height = height; - } - - public TemplateResponseDocumentFormFieldBase required( - @javax.annotation.Nullable Boolean required) { - this.required = required; - return this; - } - - /** - * Boolean showing whether or not this field is required. - * - * @return required - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getRequired() { - return required; - } - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(@javax.annotation.Nullable Boolean required) { - this.required = required; - } +public class TemplateResponseDocumentFormFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type; + + public static final String JSON_PROPERTY_API_ID = "api_id"; + @javax.annotation.Nullable + private String apiId; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_SIGNER = "signer"; + @javax.annotation.Nullable + private String signer; + + public static final String JSON_PROPERTY_X = "x"; + @javax.annotation.Nullable + private Integer x; + + public static final String JSON_PROPERTY_Y = "y"; + @javax.annotation.Nullable + private Integer y; + + public static final String JSON_PROPERTY_WIDTH = "width"; + @javax.annotation.Nullable + private Integer width; + + public static final String JSON_PROPERTY_HEIGHT = "height"; + @javax.annotation.Nullable + private Integer height; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + @javax.annotation.Nullable + private Boolean required; + + public TemplateResponseDocumentFormFieldBase() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentFormFieldBase init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldBase.class); + } + + static public TemplateResponseDocumentFormFieldBase init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldBase.class + ); + } + + public TemplateResponseDocumentFormFieldBase type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public TemplateResponseDocumentFormFieldBase apiId(@javax.annotation.Nullable String apiId) { + this.apiId = apiId; + return this; + } + + /** + * A unique id for the form field. + * @return apiId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getApiId() { + return apiId; + } + + + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiId(@javax.annotation.Nullable String apiId) { + this.apiId = apiId; + } + + + public TemplateResponseDocumentFormFieldBase name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the form field. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public TemplateResponseDocumentFormFieldBase signer(@javax.annotation.Nullable String signer) { + this.signer = signer; + return this; + } + public TemplateResponseDocumentFormFieldBase signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } + + /** + * The signer of the Form Field. + * @return signer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigner() { + return signer; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigner(@javax.annotation.Nullable String signer) { + this.signer = signer; + } + + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + + + public TemplateResponseDocumentFormFieldBase x(@javax.annotation.Nullable Integer x) { + this.x = x; + return this; + } + + /** + * The horizontal offset in pixels for this form field. + * @return x + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getX() { + return x; + } + + + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setX(@javax.annotation.Nullable Integer x) { + this.x = x; + } + + + public TemplateResponseDocumentFormFieldBase y(@javax.annotation.Nullable Integer y) { + this.y = y; + return this; + } + + /** + * The vertical offset in pixels for this form field. + * @return y + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getY() { + return y; + } + + + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setY(@javax.annotation.Nullable Integer y) { + this.y = y; + } + + + public TemplateResponseDocumentFormFieldBase width(@javax.annotation.Nullable Integer width) { + this.width = width; + return this; + } + + /** + * The width in pixels of this form field. + * @return width + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getWidth() { + return width; + } + + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@javax.annotation.Nullable Integer width) { + this.width = width; + } + + + public TemplateResponseDocumentFormFieldBase height(@javax.annotation.Nullable Integer height) { + this.height = height; + return this; + } + + /** + * The height in pixels of this form field. + * @return height + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getHeight() { + return height; + } + + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@javax.annotation.Nullable Integer height) { + this.height = height; + } + + + public TemplateResponseDocumentFormFieldBase required(@javax.annotation.Nullable Boolean required) { + this.required = required; + return this; + } + + /** + * Boolean showing whether or not this field is required. + * @return required + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRequired() { + return required; + } + + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(@javax.annotation.Nullable Boolean required) { + this.required = required; + } + + + /** + * Return true if this TemplateResponseDocumentFormFieldBase object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentFormFieldBase templateResponseDocumentFormFieldBase = (TemplateResponseDocumentFormFieldBase) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldBase.type) && + Objects.equals(this.apiId, templateResponseDocumentFormFieldBase.apiId) && + Objects.equals(this.name, templateResponseDocumentFormFieldBase.name) && + Objects.equals(this.signer, templateResponseDocumentFormFieldBase.signer) && + Objects.equals(this.x, templateResponseDocumentFormFieldBase.x) && + Objects.equals(this.y, templateResponseDocumentFormFieldBase.y) && + Objects.equals(this.width, templateResponseDocumentFormFieldBase.width) && + Objects.equals(this.height, templateResponseDocumentFormFieldBase.height) && + Objects.equals(this.required, templateResponseDocumentFormFieldBase.required); + } + + @Override + public int hashCode() { + return Objects.hash(type, apiId, name, signer, x, y, width, height, required); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldBase {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentFormFieldBase object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentFormFieldBase templateResponseDocumentFormFieldBase = - (TemplateResponseDocumentFormFieldBase) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldBase.type) - && Objects.equals(this.apiId, templateResponseDocumentFormFieldBase.apiId) - && Objects.equals(this.name, templateResponseDocumentFormFieldBase.name) - && Objects.equals(this.signer, templateResponseDocumentFormFieldBase.signer) - && Objects.equals(this.x, templateResponseDocumentFormFieldBase.x) - && Objects.equals(this.y, templateResponseDocumentFormFieldBase.y) - && Objects.equals(this.width, templateResponseDocumentFormFieldBase.width) - && Objects.equals(this.height, templateResponseDocumentFormFieldBase.height) - && Objects.equals(this.required, templateResponseDocumentFormFieldBase.required); - } - - @Override - public int hashCode() { - return Objects.hash(type, apiId, name, signer, x, y, width, height, required); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldBase {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); - sb.append(" x: ").append(toIndentedString(x)).append("\n"); - sb.append(" y: ").append(toIndentedString(y)).append("\n"); - sb.append(" width: ").append(toIndentedString(width)).append("\n"); - sb.append(" height: ").append(toIndentedString(height)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (apiId != null) { + if (isFileTypeOrListOfFiles(apiId)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (apiId != null) { - if (isFileTypeOrListOfFiles(apiId)) { - fileTypeFound = true; - } - - if (apiId.getClass().equals(java.io.File.class) - || apiId.getClass().equals(Integer.class) - || apiId.getClass().equals(String.class) - || apiId.getClass().isEnum()) { - map.put("api_id", apiId); - } else if (isListOfFile(apiId)) { - for (int i = 0; i < getListSize(apiId); i++) { - map.put("api_id[" + i + "]", getFromList(apiId, i)); - } - } else { - map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (signer != null) { - if (isFileTypeOrListOfFiles(signer)) { - fileTypeFound = true; - } - - if (signer.getClass().equals(java.io.File.class) - || signer.getClass().equals(Integer.class) - || signer.getClass().equals(String.class) - || signer.getClass().isEnum()) { - map.put("signer", signer); - } else if (isListOfFile(signer)) { - for (int i = 0; i < getListSize(signer); i++) { - map.put("signer[" + i + "]", getFromList(signer, i)); - } - } else { - map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); - } - } - if (x != null) { - if (isFileTypeOrListOfFiles(x)) { - fileTypeFound = true; - } - - if (x.getClass().equals(java.io.File.class) - || x.getClass().equals(Integer.class) - || x.getClass().equals(String.class) - || x.getClass().isEnum()) { - map.put("x", x); - } else if (isListOfFile(x)) { - for (int i = 0; i < getListSize(x); i++) { - map.put("x[" + i + "]", getFromList(x, i)); - } - } else { - map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); - } - } - if (y != null) { - if (isFileTypeOrListOfFiles(y)) { - fileTypeFound = true; - } - - if (y.getClass().equals(java.io.File.class) - || y.getClass().equals(Integer.class) - || y.getClass().equals(String.class) - || y.getClass().isEnum()) { - map.put("y", y); - } else if (isListOfFile(y)) { - for (int i = 0; i < getListSize(y); i++) { - map.put("y[" + i + "]", getFromList(y, i)); - } - } else { - map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); - } + if (apiId.getClass().equals(java.io.File.class) || + apiId.getClass().equals(Integer.class) || + apiId.getClass().equals(String.class) || + apiId.getClass().isEnum()) { + map.put("api_id", apiId); + } else if (isListOfFile(apiId)) { + for(int i = 0; i< getListSize(apiId); i++) { + map.put("api_id[" + i + "]", getFromList(apiId, i)); } - if (width != null) { - if (isFileTypeOrListOfFiles(width)) { - fileTypeFound = true; - } - - if (width.getClass().equals(java.io.File.class) - || width.getClass().equals(Integer.class) - || width.getClass().equals(String.class) - || width.getClass().isEnum()) { - map.put("width", width); - } else if (isListOfFile(width)) { - for (int i = 0; i < getListSize(width); i++) { - map.put("width[" + i + "]", getFromList(width, i)); - } - } else { - map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); - } - } - if (height != null) { - if (isFileTypeOrListOfFiles(height)) { - fileTypeFound = true; - } - - if (height.getClass().equals(java.io.File.class) - || height.getClass().equals(Integer.class) - || height.getClass().equals(String.class) - || height.getClass().isEnum()) { - map.put("height", height); - } else if (isListOfFile(height)) { - for (int i = 0; i < getListSize(height); i++) { - map.put("height[" + i + "]", getFromList(height, i)); - } - } else { - map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); - } - } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - - if (required.getClass().equals(java.io.File.class) - || required.getClass().equals(Integer.class) - || required.getClass().equals(String.class) - || required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for (int i = 0; i < getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (signer != null) { + if (isFileTypeOrListOfFiles(signer)) { + fileTypeFound = true; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; + if (signer.getClass().equals(java.io.File.class) || + signer.getClass().equals(Integer.class) || + signer.getClass().equals(String.class) || + signer.getClass().isEnum()) { + map.put("signer", signer); + } else if (isListOfFile(signer)) { + for(int i = 0; i< getListSize(signer); i++) { + map.put("signer[" + i + "]", getFromList(signer, i)); + } + } + else { + map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); + } } + if (x != null) { + if (isFileTypeOrListOfFiles(x)) { + fileTypeFound = true; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + if (x.getClass().equals(java.io.File.class) || + x.getClass().equals(Integer.class) || + x.getClass().equals(String.class) || + x.getClass().isEnum()) { + map.put("x", x); + } else if (isListOfFile(x)) { + for(int i = 0; i< getListSize(x); i++) { + map.put("x[" + i + "]", getFromList(x, i)); + } + } + else { + map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); + } } + if (y != null) { + if (isFileTypeOrListOfFiles(y)) { + fileTypeFound = true; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); + if (y.getClass().equals(java.io.File.class) || + y.getClass().equals(Integer.class) || + y.getClass().equals(String.class) || + y.getClass().isEnum()) { + map.put("y", y); + } else if (isListOfFile(y)) { + for(int i = 0; i< getListSize(y); i++) { + map.put("y[" + i + "]", getFromList(y, i)); + } + } + else { + map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); + } } + if (width != null) { + if (isFileTypeOrListOfFiles(width)) { + fileTypeFound = true; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + if (width.getClass().equals(java.io.File.class) || + width.getClass().equals(Integer.class) || + width.getClass().equals(String.class) || + width.getClass().isEnum()) { + map.put("width", width); + } else if (isListOfFile(width)) { + for(int i = 0; i< getListSize(width); i++) { + map.put("width[" + i + "]", getFromList(width, i)); + } + } + else { + map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); + } } + if (height != null) { + if (isFileTypeOrListOfFiles(height)) { + fileTypeFound = true; + } - /** - * 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"; + if (height.getClass().equals(java.io.File.class) || + height.getClass().equals(Integer.class) || + height.getClass().equals(String.class) || + height.getClass().isEnum()) { + map.put("height", height); + } else if (isListOfFile(height)) { + for(int i = 0; i< getListSize(height); i++) { + map.put("height[" + i + "]", getFromList(height, i)); + } + } + else { + map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); } - return o.toString().replace("\n", "\n "); } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("checkbox", TemplateResponseDocumentFormFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentFormFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentFormFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentFormFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentFormFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentFormFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentFormFieldSignature.class); - mappings.put("text", TemplateResponseDocumentFormFieldText.class); - mappings.put( - "TemplateResponseDocumentFormFieldBase", - TemplateResponseDocumentFormFieldBase.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldBase.class, "type", mappings); + if (required.getClass().equals(java.io.File.class) || + required.getClass().equals(Integer.class) || + required.getClass().equals(String.class) || + required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for(int i = 0; i< getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } + else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("checkbox", TemplateResponseDocumentFormFieldCheckbox.class); + mappings.put("date_signed", TemplateResponseDocumentFormFieldDateSigned.class); + mappings.put("dropdown", TemplateResponseDocumentFormFieldDropdown.class); + mappings.put("hyperlink", TemplateResponseDocumentFormFieldHyperlink.class); + mappings.put("initials", TemplateResponseDocumentFormFieldInitials.class); + mappings.put("radio", TemplateResponseDocumentFormFieldRadio.class); + mappings.put("signature", TemplateResponseDocumentFormFieldSignature.class); + mappings.put("text", TemplateResponseDocumentFormFieldText.class); + mappings.put("TemplateResponseDocumentFormFieldBase", TemplateResponseDocumentFormFieldBase.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldBase.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java index 2e7cc69cf..123fafcb5 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java @@ -10,241 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `TemplateResponseDocumentFormFieldBase` */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentFormFieldBase` + */ @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldCheckbox.JSON_PROPERTY_TYPE, - TemplateResponseDocumentFormFieldCheckbox.JSON_PROPERTY_GROUP + TemplateResponseDocumentFormFieldCheckbox.JSON_PROPERTY_TYPE, + TemplateResponseDocumentFormFieldCheckbox.JSON_PROPERTY_GROUP }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentFormFieldCheckbox - extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "checkbox"; - - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nullable private String group; - - public TemplateResponseDocumentFormFieldCheckbox() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentFormFieldCheckbox init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentFormFieldCheckbox.class); - } - - public static TemplateResponseDocumentFormFieldCheckbox init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldCheckbox.class); - } - - public TemplateResponseDocumentFormFieldCheckbox type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text - * Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses - * `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentFormFieldRadio` * Signature Field uses - * `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentFormFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public TemplateResponseDocumentFormFieldCheckbox group( - @javax.annotation.Nullable String group) { - this.group = group; - return this; - } - - /** - * The name of the group this field is in. If this field is not a group, this defaults to - * `null` except for Radio fields. - * - * @return group - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGroup() { - return group; - } - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(@javax.annotation.Nullable String group) { - this.group = group; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocumentFormFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "checkbox"; + + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nullable + private String group; + + public TemplateResponseDocumentFormFieldCheckbox() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentFormFieldCheckbox init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldCheckbox.class); + } + + static public TemplateResponseDocumentFormFieldCheckbox init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldCheckbox.class + ); + } + + public TemplateResponseDocumentFormFieldCheckbox type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public TemplateResponseDocumentFormFieldCheckbox group(@javax.annotation.Nullable String group) { + this.group = group; + return this; + } + + /** + * The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. + * @return group + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(@javax.annotation.Nullable String group) { + this.group = group; + } + + + /** + * Return true if this TemplateResponseDocumentFormFieldCheckbox object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentFormFieldCheckbox templateResponseDocumentFormFieldCheckbox = (TemplateResponseDocumentFormFieldCheckbox) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldCheckbox.type) && + Objects.equals(this.group, templateResponseDocumentFormFieldCheckbox.group) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, group, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldCheckbox {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentFormFieldCheckbox object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentFormFieldCheckbox templateResponseDocumentFormFieldCheckbox = - (TemplateResponseDocumentFormFieldCheckbox) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldCheckbox.type) - && Objects.equals(this.group, templateResponseDocumentFormFieldCheckbox.group) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, group, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldCheckbox {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentFormFieldCheckbox", - TemplateResponseDocumentFormFieldCheckbox.class); - JSON.registerDiscriminator( - TemplateResponseDocumentFormFieldCheckbox.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldCheckbox", TemplateResponseDocumentFormFieldCheckbox.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldCheckbox.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java index 80cfc712f..d268296b2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java @@ -10,242 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `TemplateResponseDocumentFormFieldBase` */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentFormFieldBase` + */ @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldDateSigned.JSON_PROPERTY_TYPE, - TemplateResponseDocumentFormFieldDateSigned.JSON_PROPERTY_GROUP + TemplateResponseDocumentFormFieldDateSigned.JSON_PROPERTY_TYPE, + TemplateResponseDocumentFormFieldDateSigned.JSON_PROPERTY_GROUP }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentFormFieldDateSigned - extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "date_signed"; - - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nullable private String group; - - public TemplateResponseDocumentFormFieldDateSigned() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentFormFieldDateSigned init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentFormFieldDateSigned.class); - } - - public static TemplateResponseDocumentFormFieldDateSigned init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldDateSigned.class); - } - - public TemplateResponseDocumentFormFieldDateSigned type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text - * Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses - * `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentFormFieldRadio` * Signature Field uses - * `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentFormFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public TemplateResponseDocumentFormFieldDateSigned group( - @javax.annotation.Nullable String group) { - this.group = group; - return this; - } - - /** - * The name of the group this field is in. If this field is not a group, this defaults to - * `null` except for Radio fields. - * - * @return group - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGroup() { - return group; - } - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(@javax.annotation.Nullable String group) { - this.group = group; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocumentFormFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "date_signed"; + + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nullable + private String group; + + public TemplateResponseDocumentFormFieldDateSigned() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentFormFieldDateSigned init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldDateSigned.class); + } + + static public TemplateResponseDocumentFormFieldDateSigned init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldDateSigned.class + ); + } + + public TemplateResponseDocumentFormFieldDateSigned type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public TemplateResponseDocumentFormFieldDateSigned group(@javax.annotation.Nullable String group) { + this.group = group; + return this; + } + + /** + * The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. + * @return group + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(@javax.annotation.Nullable String group) { + this.group = group; + } + + + /** + * Return true if this TemplateResponseDocumentFormFieldDateSigned object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentFormFieldDateSigned templateResponseDocumentFormFieldDateSigned = (TemplateResponseDocumentFormFieldDateSigned) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldDateSigned.type) && + Objects.equals(this.group, templateResponseDocumentFormFieldDateSigned.group) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, group, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldDateSigned {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentFormFieldDateSigned object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentFormFieldDateSigned templateResponseDocumentFormFieldDateSigned = - (TemplateResponseDocumentFormFieldDateSigned) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldDateSigned.type) - && Objects.equals(this.group, templateResponseDocumentFormFieldDateSigned.group) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, group, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldDateSigned {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentFormFieldDateSigned", - TemplateResponseDocumentFormFieldDateSigned.class); - JSON.registerDiscriminator( - TemplateResponseDocumentFormFieldDateSigned.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldDateSigned", TemplateResponseDocumentFormFieldDateSigned.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldDateSigned.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java index 109b3413f..9ee1e26e8 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java @@ -10,241 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `TemplateResponseDocumentFormFieldBase` */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentFormFieldBase` + */ @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_TYPE, - TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_GROUP + TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_TYPE, + TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_GROUP }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentFormFieldDropdown - extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "dropdown"; - - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nullable private String group; - - public TemplateResponseDocumentFormFieldDropdown() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentFormFieldDropdown init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentFormFieldDropdown.class); - } - - public static TemplateResponseDocumentFormFieldDropdown init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldDropdown.class); - } - - public TemplateResponseDocumentFormFieldDropdown type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text - * Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses - * `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentFormFieldRadio` * Signature Field uses - * `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentFormFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public TemplateResponseDocumentFormFieldDropdown group( - @javax.annotation.Nullable String group) { - this.group = group; - return this; - } - - /** - * The name of the group this field is in. If this field is not a group, this defaults to - * `null` except for Radio fields. - * - * @return group - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGroup() { - return group; - } - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(@javax.annotation.Nullable String group) { - this.group = group; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocumentFormFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "dropdown"; + + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nullable + private String group; + + public TemplateResponseDocumentFormFieldDropdown() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentFormFieldDropdown init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldDropdown.class); + } + + static public TemplateResponseDocumentFormFieldDropdown init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldDropdown.class + ); + } + + public TemplateResponseDocumentFormFieldDropdown type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public TemplateResponseDocumentFormFieldDropdown group(@javax.annotation.Nullable String group) { + this.group = group; + return this; + } + + /** + * The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. + * @return group + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(@javax.annotation.Nullable String group) { + this.group = group; + } + + + /** + * Return true if this TemplateResponseDocumentFormFieldDropdown object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentFormFieldDropdown templateResponseDocumentFormFieldDropdown = (TemplateResponseDocumentFormFieldDropdown) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldDropdown.type) && + Objects.equals(this.group, templateResponseDocumentFormFieldDropdown.group) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, group, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldDropdown {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentFormFieldDropdown object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentFormFieldDropdown templateResponseDocumentFormFieldDropdown = - (TemplateResponseDocumentFormFieldDropdown) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldDropdown.type) - && Objects.equals(this.group, templateResponseDocumentFormFieldDropdown.group) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, group, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldDropdown {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentFormFieldDropdown", - TemplateResponseDocumentFormFieldDropdown.class); - JSON.registerDiscriminator( - TemplateResponseDocumentFormFieldDropdown.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldDropdown", TemplateResponseDocumentFormFieldDropdown.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldDropdown.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java index d1d89de56..74acb7356 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java @@ -10,452 +10,444 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; +import com.dropbox.sign.model.TemplateResponseFieldAvgTextLength; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `TemplateResponseDocumentFormFieldBase` */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentFormFieldBase` + */ @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_TYPE, - TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_AVG_TEXT_LENGTH, - TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_IS_MULTILINE, - TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_ORIGINAL_FONT_SIZE, - TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_FONT_FAMILY, - TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_GROUP + TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_TYPE, + TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_AVG_TEXT_LENGTH, + TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_IS_MULTILINE, + TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_ORIGINAL_FONT_SIZE, + TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_FONT_FAMILY, + TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_GROUP }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentFormFieldHyperlink - extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "hyperlink"; - - public static final String JSON_PROPERTY_AVG_TEXT_LENGTH = "avg_text_length"; - @javax.annotation.Nullable private TemplateResponseFieldAvgTextLength avgTextLength; - - public static final String JSON_PROPERTY_IS_MULTILINE = "isMultiline"; - @javax.annotation.Nullable private Boolean isMultiline; - - public static final String JSON_PROPERTY_ORIGINAL_FONT_SIZE = "originalFontSize"; - @javax.annotation.Nullable private Integer originalFontSize; - - public static final String JSON_PROPERTY_FONT_FAMILY = "fontFamily"; - @javax.annotation.Nullable private String fontFamily; - - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nullable private String group; - - public TemplateResponseDocumentFormFieldHyperlink() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentFormFieldHyperlink init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentFormFieldHyperlink.class); - } - - public static TemplateResponseDocumentFormFieldHyperlink init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldHyperlink.class); - } - - public TemplateResponseDocumentFormFieldHyperlink type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text - * Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses - * `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentFormFieldRadio` * Signature Field uses - * `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentFormFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public TemplateResponseDocumentFormFieldHyperlink avgTextLength( - @javax.annotation.Nullable TemplateResponseFieldAvgTextLength avgTextLength) { - this.avgTextLength = avgTextLength; - return this; - } - - /** - * Get avgTextLength - * - * @return avgTextLength - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TemplateResponseFieldAvgTextLength getAvgTextLength() { - return avgTextLength; - } - - @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAvgTextLength( - @javax.annotation.Nullable TemplateResponseFieldAvgTextLength avgTextLength) { - this.avgTextLength = avgTextLength; - } - - public TemplateResponseDocumentFormFieldHyperlink isMultiline( - @javax.annotation.Nullable Boolean isMultiline) { - this.isMultiline = isMultiline; - return this; - } - - /** - * Whether this form field is multiline text. - * - * @return isMultiline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_MULTILINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsMultiline() { - return isMultiline; - } - - @JsonProperty(JSON_PROPERTY_IS_MULTILINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsMultiline(@javax.annotation.Nullable Boolean isMultiline) { - this.isMultiline = isMultiline; - } - - public TemplateResponseDocumentFormFieldHyperlink originalFontSize( - @javax.annotation.Nullable Integer originalFontSize) { - this.originalFontSize = originalFontSize; - return this; - } - - /** - * Original font size used in this form field's text. - * - * @return originalFontSize - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getOriginalFontSize() { - return originalFontSize; - } - - @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOriginalFontSize(@javax.annotation.Nullable Integer originalFontSize) { - this.originalFontSize = originalFontSize; + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumentFormFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "hyperlink"; + + public static final String JSON_PROPERTY_AVG_TEXT_LENGTH = "avg_text_length"; + @javax.annotation.Nullable + private TemplateResponseFieldAvgTextLength avgTextLength; + + public static final String JSON_PROPERTY_IS_MULTILINE = "isMultiline"; + @javax.annotation.Nullable + private Boolean isMultiline; + + public static final String JSON_PROPERTY_ORIGINAL_FONT_SIZE = "originalFontSize"; + @javax.annotation.Nullable + private Integer originalFontSize; + + public static final String JSON_PROPERTY_FONT_FAMILY = "fontFamily"; + @javax.annotation.Nullable + private String fontFamily; + + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nullable + private String group; + + public TemplateResponseDocumentFormFieldHyperlink() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentFormFieldHyperlink init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldHyperlink.class); + } + + static public TemplateResponseDocumentFormFieldHyperlink init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldHyperlink.class + ); + } + + public TemplateResponseDocumentFormFieldHyperlink type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public TemplateResponseDocumentFormFieldHyperlink avgTextLength(@javax.annotation.Nullable TemplateResponseFieldAvgTextLength avgTextLength) { + this.avgTextLength = avgTextLength; + return this; + } + + /** + * Get avgTextLength + * @return avgTextLength + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TemplateResponseFieldAvgTextLength getAvgTextLength() { + return avgTextLength; + } + + + @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAvgTextLength(@javax.annotation.Nullable TemplateResponseFieldAvgTextLength avgTextLength) { + this.avgTextLength = avgTextLength; + } + + + public TemplateResponseDocumentFormFieldHyperlink isMultiline(@javax.annotation.Nullable Boolean isMultiline) { + this.isMultiline = isMultiline; + return this; + } + + /** + * Whether this form field is multiline text. + * @return isMultiline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_MULTILINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsMultiline() { + return isMultiline; + } + + + @JsonProperty(JSON_PROPERTY_IS_MULTILINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMultiline(@javax.annotation.Nullable Boolean isMultiline) { + this.isMultiline = isMultiline; + } + + + public TemplateResponseDocumentFormFieldHyperlink originalFontSize(@javax.annotation.Nullable Integer originalFontSize) { + this.originalFontSize = originalFontSize; + return this; + } + + /** + * Original font size used in this form field's text. + * @return originalFontSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getOriginalFontSize() { + return originalFontSize; + } + + + @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalFontSize(@javax.annotation.Nullable Integer originalFontSize) { + this.originalFontSize = originalFontSize; + } + + + public TemplateResponseDocumentFormFieldHyperlink fontFamily(@javax.annotation.Nullable String fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family used in this form field's text. + * @return fontFamily + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFontFamily() { + return fontFamily; + } + + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(@javax.annotation.Nullable String fontFamily) { + this.fontFamily = fontFamily; + } + + + public TemplateResponseDocumentFormFieldHyperlink group(@javax.annotation.Nullable String group) { + this.group = group; + return this; + } + + /** + * The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. + * @return group + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(@javax.annotation.Nullable String group) { + this.group = group; + } + + + /** + * Return true if this TemplateResponseDocumentFormFieldHyperlink object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public TemplateResponseDocumentFormFieldHyperlink fontFamily( - @javax.annotation.Nullable String fontFamily) { - this.fontFamily = fontFamily; - return this; - } - - /** - * Font family used in this form field's text. - * - * @return fontFamily - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFontFamily() { - return fontFamily; - } - - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(@javax.annotation.Nullable String fontFamily) { - this.fontFamily = fontFamily; - } - - public TemplateResponseDocumentFormFieldHyperlink group( - @javax.annotation.Nullable String group) { - this.group = group; - return this; + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentFormFieldHyperlink templateResponseDocumentFormFieldHyperlink = (TemplateResponseDocumentFormFieldHyperlink) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldHyperlink.type) && + Objects.equals(this.avgTextLength, templateResponseDocumentFormFieldHyperlink.avgTextLength) && + Objects.equals(this.isMultiline, templateResponseDocumentFormFieldHyperlink.isMultiline) && + Objects.equals(this.originalFontSize, templateResponseDocumentFormFieldHyperlink.originalFontSize) && + Objects.equals(this.fontFamily, templateResponseDocumentFormFieldHyperlink.fontFamily) && + Objects.equals(this.group, templateResponseDocumentFormFieldHyperlink.group) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, avgTextLength, isMultiline, originalFontSize, fontFamily, group, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldHyperlink {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" avgTextLength: ").append(toIndentedString(avgTextLength)).append("\n"); + sb.append(" isMultiline: ").append(toIndentedString(isMultiline)).append("\n"); + sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** - * The name of the group this field is in. If this field is not a group, this defaults to - * `null` except for Radio fields. - * - * @return group - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGroup() { - return group; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (avgTextLength != null) { + if (isFileTypeOrListOfFiles(avgTextLength)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(@javax.annotation.Nullable String group) { - this.group = group; + if (avgTextLength.getClass().equals(java.io.File.class) || + avgTextLength.getClass().equals(Integer.class) || + avgTextLength.getClass().equals(String.class) || + avgTextLength.getClass().isEnum()) { + map.put("avg_text_length", avgTextLength); + } else if (isListOfFile(avgTextLength)) { + for(int i = 0; i< getListSize(avgTextLength); i++) { + map.put("avg_text_length[" + i + "]", getFromList(avgTextLength, i)); + } + } + else { + map.put("avg_text_length", JSON.getDefault().getMapper().writeValueAsString(avgTextLength)); + } } + if (isMultiline != null) { + if (isFileTypeOrListOfFiles(isMultiline)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentFormFieldHyperlink object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (isMultiline.getClass().equals(java.io.File.class) || + isMultiline.getClass().equals(Integer.class) || + isMultiline.getClass().equals(String.class) || + isMultiline.getClass().isEnum()) { + map.put("isMultiline", isMultiline); + } else if (isListOfFile(isMultiline)) { + for(int i = 0; i< getListSize(isMultiline); i++) { + map.put("isMultiline[" + i + "]", getFromList(isMultiline, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("isMultiline", JSON.getDefault().getMapper().writeValueAsString(isMultiline)); } - TemplateResponseDocumentFormFieldHyperlink templateResponseDocumentFormFieldHyperlink = - (TemplateResponseDocumentFormFieldHyperlink) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldHyperlink.type) - && Objects.equals( - this.avgTextLength, - templateResponseDocumentFormFieldHyperlink.avgTextLength) - && Objects.equals( - this.isMultiline, templateResponseDocumentFormFieldHyperlink.isMultiline) - && Objects.equals( - this.originalFontSize, - templateResponseDocumentFormFieldHyperlink.originalFontSize) - && Objects.equals( - this.fontFamily, templateResponseDocumentFormFieldHyperlink.fontFamily) - && Objects.equals(this.group, templateResponseDocumentFormFieldHyperlink.group) - && super.equals(o); } + if (originalFontSize != null) { + if (isFileTypeOrListOfFiles(originalFontSize)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - type, - avgTextLength, - isMultiline, - originalFontSize, - fontFamily, - group, - super.hashCode()); + if (originalFontSize.getClass().equals(java.io.File.class) || + originalFontSize.getClass().equals(Integer.class) || + originalFontSize.getClass().equals(String.class) || + originalFontSize.getClass().isEnum()) { + map.put("originalFontSize", originalFontSize); + } else if (isListOfFile(originalFontSize)) { + for(int i = 0; i< getListSize(originalFontSize); i++) { + map.put("originalFontSize[" + i + "]", getFromList(originalFontSize, i)); + } + } + else { + map.put("originalFontSize", JSON.getDefault().getMapper().writeValueAsString(originalFontSize)); + } } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldHyperlink {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" avgTextLength: ").append(toIndentedString(avgTextLength)).append("\n"); - sb.append(" isMultiline: ").append(toIndentedString(isMultiline)).append("\n"); - sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); + if (fontFamily.getClass().equals(java.io.File.class) || + fontFamily.getClass().equals(Integer.class) || + fontFamily.getClass().equals(String.class) || + fontFamily.getClass().isEnum()) { + map.put("fontFamily", fontFamily); + } else if (isListOfFile(fontFamily)) { + for(int i = 0; i< getListSize(fontFamily); i++) { + map.put("fontFamily[" + i + "]", getFromList(fontFamily, i)); + } + } + else { + map.put("fontFamily", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (avgTextLength != null) { - if (isFileTypeOrListOfFiles(avgTextLength)) { - fileTypeFound = true; - } - - if (avgTextLength.getClass().equals(java.io.File.class) - || avgTextLength.getClass().equals(Integer.class) - || avgTextLength.getClass().equals(String.class) - || avgTextLength.getClass().isEnum()) { - map.put("avg_text_length", avgTextLength); - } else if (isListOfFile(avgTextLength)) { - for (int i = 0; i < getListSize(avgTextLength); i++) { - map.put("avg_text_length[" + i + "]", getFromList(avgTextLength, i)); - } - } else { - map.put( - "avg_text_length", - JSON.getDefault().getMapper().writeValueAsString(avgTextLength)); - } + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); } - if (isMultiline != null) { - if (isFileTypeOrListOfFiles(isMultiline)) { - fileTypeFound = true; - } - - if (isMultiline.getClass().equals(java.io.File.class) - || isMultiline.getClass().equals(Integer.class) - || isMultiline.getClass().equals(String.class) - || isMultiline.getClass().isEnum()) { - map.put("isMultiline", isMultiline); - } else if (isListOfFile(isMultiline)) { - for (int i = 0; i < getListSize(isMultiline); i++) { - map.put("isMultiline[" + i + "]", getFromList(isMultiline, i)); - } - } else { - map.put( - "isMultiline", - JSON.getDefault().getMapper().writeValueAsString(isMultiline)); - } - } - if (originalFontSize != null) { - if (isFileTypeOrListOfFiles(originalFontSize)) { - fileTypeFound = true; - } - - if (originalFontSize.getClass().equals(java.io.File.class) - || originalFontSize.getClass().equals(Integer.class) - || originalFontSize.getClass().equals(String.class) - || originalFontSize.getClass().isEnum()) { - map.put("originalFontSize", originalFontSize); - } else if (isListOfFile(originalFontSize)) { - for (int i = 0; i < getListSize(originalFontSize); i++) { - map.put("originalFontSize[" + i + "]", getFromList(originalFontSize, i)); - } - } else { - map.put( - "originalFontSize", - JSON.getDefault().getMapper().writeValueAsString(originalFontSize)); - } - } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - - if (fontFamily.getClass().equals(java.io.File.class) - || fontFamily.getClass().equals(Integer.class) - || fontFamily.getClass().equals(String.class) - || fontFamily.getClass().isEnum()) { - map.put("fontFamily", fontFamily); - } else if (isListOfFile(fontFamily)) { - for (int i = 0; i < getListSize(fontFamily); i++) { - map.put("fontFamily[" + i + "]", getFromList(fontFamily, i)); - } - } else { - map.put( - "fontFamily", - JSON.getDefault().getMapper().writeValueAsString(fontFamily)); - } - } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentFormFieldHyperlink", - TemplateResponseDocumentFormFieldHyperlink.class); - JSON.registerDiscriminator( - TemplateResponseDocumentFormFieldHyperlink.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldHyperlink", TemplateResponseDocumentFormFieldHyperlink.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldHyperlink.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java index 6e0f78592..37e3f3ddb 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java @@ -10,241 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `TemplateResponseDocumentFormFieldBase` */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentFormFieldBase` + */ @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldInitials.JSON_PROPERTY_TYPE, - TemplateResponseDocumentFormFieldInitials.JSON_PROPERTY_GROUP + TemplateResponseDocumentFormFieldInitials.JSON_PROPERTY_TYPE, + TemplateResponseDocumentFormFieldInitials.JSON_PROPERTY_GROUP }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentFormFieldInitials - extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "initials"; - - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nullable private String group; - - public TemplateResponseDocumentFormFieldInitials() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentFormFieldInitials init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentFormFieldInitials.class); - } - - public static TemplateResponseDocumentFormFieldInitials init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldInitials.class); - } - - public TemplateResponseDocumentFormFieldInitials type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text - * Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses - * `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentFormFieldRadio` * Signature Field uses - * `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentFormFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public TemplateResponseDocumentFormFieldInitials group( - @javax.annotation.Nullable String group) { - this.group = group; - return this; - } - - /** - * The name of the group this field is in. If this field is not a group, this defaults to - * `null` except for Radio fields. - * - * @return group - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGroup() { - return group; - } - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(@javax.annotation.Nullable String group) { - this.group = group; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocumentFormFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "initials"; + + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nullable + private String group; + + public TemplateResponseDocumentFormFieldInitials() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentFormFieldInitials init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldInitials.class); + } + + static public TemplateResponseDocumentFormFieldInitials init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldInitials.class + ); + } + + public TemplateResponseDocumentFormFieldInitials type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public TemplateResponseDocumentFormFieldInitials group(@javax.annotation.Nullable String group) { + this.group = group; + return this; + } + + /** + * The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. + * @return group + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(@javax.annotation.Nullable String group) { + this.group = group; + } + + + /** + * Return true if this TemplateResponseDocumentFormFieldInitials object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentFormFieldInitials templateResponseDocumentFormFieldInitials = (TemplateResponseDocumentFormFieldInitials) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldInitials.type) && + Objects.equals(this.group, templateResponseDocumentFormFieldInitials.group) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, group, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldInitials {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentFormFieldInitials object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentFormFieldInitials templateResponseDocumentFormFieldInitials = - (TemplateResponseDocumentFormFieldInitials) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldInitials.type) - && Objects.equals(this.group, templateResponseDocumentFormFieldInitials.group) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, group, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldInitials {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentFormFieldInitials", - TemplateResponseDocumentFormFieldInitials.class); - JSON.registerDiscriminator( - TemplateResponseDocumentFormFieldInitials.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldInitials", TemplateResponseDocumentFormFieldInitials.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldInitials.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java index 0ff1b8a4b..b9c49af00 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java @@ -10,238 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `TemplateResponseDocumentFormFieldBase` */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentFormFieldBase` + */ @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldRadio.JSON_PROPERTY_TYPE, - TemplateResponseDocumentFormFieldRadio.JSON_PROPERTY_GROUP + TemplateResponseDocumentFormFieldRadio.JSON_PROPERTY_TYPE, + TemplateResponseDocumentFormFieldRadio.JSON_PROPERTY_GROUP }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "radio"; - - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nonnull private String group; - - public TemplateResponseDocumentFormFieldRadio() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentFormFieldRadio init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldRadio.class); - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - public static TemplateResponseDocumentFormFieldRadio init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldRadio.class); - } - - public TemplateResponseDocumentFormFieldRadio type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text - * Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses - * `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentFormFieldRadio` * Signature Field uses - * `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentFormFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public TemplateResponseDocumentFormFieldRadio group(@javax.annotation.Nonnull String group) { - this.group = group; - return this; - } - - /** - * The name of the group this field is in. If this field is not a group, this defaults to - * `null` except for Radio fields. - * - * @return group - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getGroup() { - return group; - } - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGroup(@javax.annotation.Nonnull String group) { - this.group = group; - } +public class TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFormFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "radio"; + + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nonnull + private String group; + + public TemplateResponseDocumentFormFieldRadio() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentFormFieldRadio init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldRadio.class); + } + + static public TemplateResponseDocumentFormFieldRadio init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldRadio.class + ); + } + + public TemplateResponseDocumentFormFieldRadio type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public TemplateResponseDocumentFormFieldRadio group(@javax.annotation.Nonnull String group) { + this.group = group; + return this; + } + + /** + * The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. + * @return group + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGroup(@javax.annotation.Nonnull String group) { + this.group = group; + } + + + /** + * Return true if this TemplateResponseDocumentFormFieldRadio object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentFormFieldRadio templateResponseDocumentFormFieldRadio = (TemplateResponseDocumentFormFieldRadio) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldRadio.type) && + Objects.equals(this.group, templateResponseDocumentFormFieldRadio.group) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, group, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldRadio {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentFormFieldRadio object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentFormFieldRadio templateResponseDocumentFormFieldRadio = - (TemplateResponseDocumentFormFieldRadio) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldRadio.type) - && Objects.equals(this.group, templateResponseDocumentFormFieldRadio.group) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, group, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldRadio {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentFormFieldRadio", - TemplateResponseDocumentFormFieldRadio.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldRadio.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldRadio", TemplateResponseDocumentFormFieldRadio.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldRadio.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java index 53e1b3776..dcb7806ef 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java @@ -10,242 +10,239 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `TemplateResponseDocumentFormFieldBase` */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentFormFieldBase` + */ @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldSignature.JSON_PROPERTY_TYPE, - TemplateResponseDocumentFormFieldSignature.JSON_PROPERTY_GROUP + TemplateResponseDocumentFormFieldSignature.JSON_PROPERTY_TYPE, + TemplateResponseDocumentFormFieldSignature.JSON_PROPERTY_GROUP }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentFormFieldSignature - extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "signature"; - - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nullable private String group; - - public TemplateResponseDocumentFormFieldSignature() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentFormFieldSignature init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentFormFieldSignature.class); - } - - public static TemplateResponseDocumentFormFieldSignature init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldSignature.class); - } - - public TemplateResponseDocumentFormFieldSignature type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text - * Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses - * `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentFormFieldRadio` * Signature Field uses - * `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentFormFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public TemplateResponseDocumentFormFieldSignature group( - @javax.annotation.Nullable String group) { - this.group = group; - return this; - } - - /** - * The name of the group this field is in. If this field is not a group, this defaults to - * `null` except for Radio fields. - * - * @return group - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGroup() { - return group; - } - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(@javax.annotation.Nullable String group) { - this.group = group; - } + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumentFormFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "signature"; + + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nullable + private String group; + + public TemplateResponseDocumentFormFieldSignature() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentFormFieldSignature init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldSignature.class); + } + + static public TemplateResponseDocumentFormFieldSignature init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldSignature.class + ); + } + + public TemplateResponseDocumentFormFieldSignature type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public TemplateResponseDocumentFormFieldSignature group(@javax.annotation.Nullable String group) { + this.group = group; + return this; + } + + /** + * The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. + * @return group + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(@javax.annotation.Nullable String group) { + this.group = group; + } + + + /** + * Return true if this TemplateResponseDocumentFormFieldSignature object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentFormFieldSignature templateResponseDocumentFormFieldSignature = (TemplateResponseDocumentFormFieldSignature) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldSignature.type) && + Objects.equals(this.group, templateResponseDocumentFormFieldSignature.group) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, group, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldSignature {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentFormFieldSignature object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentFormFieldSignature templateResponseDocumentFormFieldSignature = - (TemplateResponseDocumentFormFieldSignature) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldSignature.type) - && Objects.equals(this.group, templateResponseDocumentFormFieldSignature.group) - && super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, group, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldSignature {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentFormFieldSignature", - TemplateResponseDocumentFormFieldSignature.class); - JSON.registerDiscriminator( - TemplateResponseDocumentFormFieldSignature.class, "type", mappings); + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldSignature", TemplateResponseDocumentFormFieldSignature.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldSignature.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java index 1eb8a426c..d4d789a8f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java @@ -10,675 +10,648 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; +import com.dropbox.sign.model.TemplateResponseFieldAvgTextLength; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** This class extends `TemplateResponseDocumentFormFieldBase` */ + +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentFormFieldBase` + */ @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_TYPE, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_AVG_TEXT_LENGTH, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_IS_MULTILINE, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_ORIGINAL_FONT_SIZE, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_FONT_FAMILY, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_TYPE, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_GROUP + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_TYPE, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_AVG_TEXT_LENGTH, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_IS_MULTILINE, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_ORIGINAL_FONT_SIZE, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_FONT_FAMILY, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_TYPE, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_GROUP }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "text"; + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) - public static final String JSON_PROPERTY_AVG_TEXT_LENGTH = "avg_text_length"; - @javax.annotation.Nullable private TemplateResponseFieldAvgTextLength avgTextLength; - - public static final String JSON_PROPERTY_IS_MULTILINE = "isMultiline"; - @javax.annotation.Nullable private Boolean isMultiline; - - public static final String JSON_PROPERTY_ORIGINAL_FONT_SIZE = "originalFontSize"; - @javax.annotation.Nullable private Integer originalFontSize; - - public static final String JSON_PROPERTY_FONT_FAMILY = "fontFamily"; - @javax.annotation.Nullable private String fontFamily; - - /** - * Each text field may contain a `validation_type` parameter. Check out the list of - * [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about - * the possible values. - */ - public enum ValidationTypeEnum { - NUMBERS_ONLY(String.valueOf("numbers_only")), - - LETTERS_ONLY(String.valueOf("letters_only")), - - PHONE_NUMBER(String.valueOf("phone_number")), - - BANK_ROUTING_NUMBER(String.valueOf("bank_routing_number")), - - BANK_ACCOUNT_NUMBER(String.valueOf("bank_account_number")), - - EMAIL_ADDRESS(String.valueOf("email_address")), - - ZIP_CODE(String.valueOf("zip_code")), - - SOCIAL_SECURITY_NUMBER(String.valueOf("social_security_number")), - - EMPLOYER_IDENTIFICATION_NUMBER(String.valueOf("employer_identification_number")), - - CUSTOM_REGEX(String.valueOf("custom_regex")); - - private String value; +public class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentFormFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "text"; + + public static final String JSON_PROPERTY_AVG_TEXT_LENGTH = "avg_text_length"; + @javax.annotation.Nullable + private TemplateResponseFieldAvgTextLength avgTextLength; + + public static final String JSON_PROPERTY_IS_MULTILINE = "isMultiline"; + @javax.annotation.Nullable + private Boolean isMultiline; + + public static final String JSON_PROPERTY_ORIGINAL_FONT_SIZE = "originalFontSize"; + @javax.annotation.Nullable + private Integer originalFontSize; + + public static final String JSON_PROPERTY_FONT_FAMILY = "fontFamily"; + @javax.annotation.Nullable + private String fontFamily; + + /** + * Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. + */ + public enum ValidationTypeEnum { + NUMBERS_ONLY(String.valueOf("numbers_only")), + + LETTERS_ONLY(String.valueOf("letters_only")), + + PHONE_NUMBER(String.valueOf("phone_number")), + + BANK_ROUTING_NUMBER(String.valueOf("bank_routing_number")), + + BANK_ACCOUNT_NUMBER(String.valueOf("bank_account_number")), + + EMAIL_ADDRESS(String.valueOf("email_address")), + + ZIP_CODE(String.valueOf("zip_code")), + + SOCIAL_SECURITY_NUMBER(String.valueOf("social_security_number")), + + EMPLOYER_IDENTIFICATION_NUMBER(String.valueOf("employer_identification_number")), + + CUSTOM_REGEX(String.valueOf("custom_regex")); + + private String value; + + ValidationTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } - ValidationTypeEnum(String value) { - this.value = value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @JsonValue - public String getValue() { - return value; + @JsonCreator + public static ValidationTypeEnum fromValue(String value) { + for (ValidationTypeEnum b : ValidationTypeEnum.values()) { + if (b.value.equals(value)) { + return b; } - - @Override - public String toString() { - return String.valueOf(value); + } + return null; + } + } + + public static final String JSON_PROPERTY_VALIDATION_TYPE = "validation_type"; + @javax.annotation.Nullable + private ValidationTypeEnum validationType; + + public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX = "validation_custom_regex"; + @javax.annotation.Nullable + private String validationCustomRegex; + + public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL = "validation_custom_regex_format_label"; + @javax.annotation.Nullable + private String validationCustomRegexFormatLabel; + + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nullable + private String group; + + public TemplateResponseDocumentFormFieldText() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentFormFieldText init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldText.class); + } + + static public TemplateResponseDocumentFormFieldText init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldText.class + ); + } + + public TemplateResponseDocumentFormFieldText type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public TemplateResponseDocumentFormFieldText avgTextLength(@javax.annotation.Nullable TemplateResponseFieldAvgTextLength avgTextLength) { + this.avgTextLength = avgTextLength; + return this; + } + + /** + * Get avgTextLength + * @return avgTextLength + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TemplateResponseFieldAvgTextLength getAvgTextLength() { + return avgTextLength; + } + + + @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAvgTextLength(@javax.annotation.Nullable TemplateResponseFieldAvgTextLength avgTextLength) { + this.avgTextLength = avgTextLength; + } + + + public TemplateResponseDocumentFormFieldText isMultiline(@javax.annotation.Nullable Boolean isMultiline) { + this.isMultiline = isMultiline; + return this; + } + + /** + * Whether this form field is multiline text. + * @return isMultiline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_MULTILINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsMultiline() { + return isMultiline; + } + + + @JsonProperty(JSON_PROPERTY_IS_MULTILINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMultiline(@javax.annotation.Nullable Boolean isMultiline) { + this.isMultiline = isMultiline; + } + + + public TemplateResponseDocumentFormFieldText originalFontSize(@javax.annotation.Nullable Integer originalFontSize) { + this.originalFontSize = originalFontSize; + return this; + } + + /** + * Original font size used in this form field's text. + * @return originalFontSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getOriginalFontSize() { + return originalFontSize; + } + + + @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalFontSize(@javax.annotation.Nullable Integer originalFontSize) { + this.originalFontSize = originalFontSize; + } + + + public TemplateResponseDocumentFormFieldText fontFamily(@javax.annotation.Nullable String fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family used in this form field's text. + * @return fontFamily + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFontFamily() { + return fontFamily; + } + + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(@javax.annotation.Nullable String fontFamily) { + this.fontFamily = fontFamily; + } + + + public TemplateResponseDocumentFormFieldText validationType(@javax.annotation.Nullable ValidationTypeEnum validationType) { + this.validationType = validationType; + return this; + } + + /** + * Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. + * @return validationType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ValidationTypeEnum getValidationType() { + return validationType; + } + + + @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationType(@javax.annotation.Nullable ValidationTypeEnum validationType) { + this.validationType = validationType; + } + + + public TemplateResponseDocumentFormFieldText validationCustomRegex(@javax.annotation.Nullable String validationCustomRegex) { + this.validationCustomRegex = validationCustomRegex; + return this; + } + + /** + * When `validation_type` is set to `custom_regex`, this specifies the custom regular expression pattern that will be used to validate the text field. + * @return validationCustomRegex + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValidationCustomRegex() { + return validationCustomRegex; + } + + + @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationCustomRegex(@javax.annotation.Nullable String validationCustomRegex) { + this.validationCustomRegex = validationCustomRegex; + } + + + public TemplateResponseDocumentFormFieldText validationCustomRegexFormatLabel(@javax.annotation.Nullable String validationCustomRegexFormatLabel) { + this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; + return this; + } + + /** + * When `validation_type` is set to `custom_regex`, this specifies the error message displayed to the signer when the text does not match the provided regex pattern. + * @return validationCustomRegexFormatLabel + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValidationCustomRegexFormatLabel() { + return validationCustomRegexFormatLabel; + } + + + @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationCustomRegexFormatLabel(@javax.annotation.Nullable String validationCustomRegexFormatLabel) { + this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; + } + + + public TemplateResponseDocumentFormFieldText group(@javax.annotation.Nullable String group) { + this.group = group; + return this; + } + + /** + * The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. + * @return group + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(@javax.annotation.Nullable String group) { + this.group = group; + } + + + /** + * Return true if this TemplateResponseDocumentFormFieldText object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentFormFieldText templateResponseDocumentFormFieldText = (TemplateResponseDocumentFormFieldText) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldText.type) && + Objects.equals(this.avgTextLength, templateResponseDocumentFormFieldText.avgTextLength) && + Objects.equals(this.isMultiline, templateResponseDocumentFormFieldText.isMultiline) && + Objects.equals(this.originalFontSize, templateResponseDocumentFormFieldText.originalFontSize) && + Objects.equals(this.fontFamily, templateResponseDocumentFormFieldText.fontFamily) && + Objects.equals(this.validationType, templateResponseDocumentFormFieldText.validationType) && + Objects.equals(this.validationCustomRegex, templateResponseDocumentFormFieldText.validationCustomRegex) && + Objects.equals(this.validationCustomRegexFormatLabel, templateResponseDocumentFormFieldText.validationCustomRegexFormatLabel) && + Objects.equals(this.group, templateResponseDocumentFormFieldText.group) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, avgTextLength, isMultiline, originalFontSize, fontFamily, validationType, validationCustomRegex, validationCustomRegexFormatLabel, group, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldText {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" avgTextLength: ").append(toIndentedString(avgTextLength)).append("\n"); + sb.append(" isMultiline: ").append(toIndentedString(isMultiline)).append("\n"); + sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" validationType: ").append(toIndentedString(validationType)).append("\n"); + sb.append(" validationCustomRegex: ").append(toIndentedString(validationCustomRegex)).append("\n"); + sb.append(" validationCustomRegexFormatLabel: ").append(toIndentedString(validationCustomRegexFormatLabel)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; } - @JsonCreator - public static ValidationTypeEnum fromValue(String value) { - for (ValidationTypeEnum b : ValidationTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); } - return null; + } + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } } + if (avgTextLength != null) { + if (isFileTypeOrListOfFiles(avgTextLength)) { + fileTypeFound = true; + } - public static final String JSON_PROPERTY_VALIDATION_TYPE = "validation_type"; - @javax.annotation.Nullable private ValidationTypeEnum validationType; - - public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX = "validation_custom_regex"; - @javax.annotation.Nullable private String validationCustomRegex; - - public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL = - "validation_custom_regex_format_label"; - @javax.annotation.Nullable private String validationCustomRegexFormatLabel; - - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nullable private String group; - - public TemplateResponseDocumentFormFieldText() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentFormFieldText init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldText.class); - } - - public static TemplateResponseDocumentFormFieldText init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldText.class); - } - - public TemplateResponseDocumentFormFieldText type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text - * Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses - * `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentFormFieldRadio` * Signature Field uses - * `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentFormFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public TemplateResponseDocumentFormFieldText avgTextLength( - @javax.annotation.Nullable TemplateResponseFieldAvgTextLength avgTextLength) { - this.avgTextLength = avgTextLength; - return this; - } - - /** - * Get avgTextLength - * - * @return avgTextLength - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TemplateResponseFieldAvgTextLength getAvgTextLength() { - return avgTextLength; - } - - @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAvgTextLength( - @javax.annotation.Nullable TemplateResponseFieldAvgTextLength avgTextLength) { - this.avgTextLength = avgTextLength; - } - - public TemplateResponseDocumentFormFieldText isMultiline( - @javax.annotation.Nullable Boolean isMultiline) { - this.isMultiline = isMultiline; - return this; - } - - /** - * Whether this form field is multiline text. - * - * @return isMultiline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_MULTILINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsMultiline() { - return isMultiline; - } - - @JsonProperty(JSON_PROPERTY_IS_MULTILINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsMultiline(@javax.annotation.Nullable Boolean isMultiline) { - this.isMultiline = isMultiline; - } - - public TemplateResponseDocumentFormFieldText originalFontSize( - @javax.annotation.Nullable Integer originalFontSize) { - this.originalFontSize = originalFontSize; - return this; - } - - /** - * Original font size used in this form field's text. - * - * @return originalFontSize - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getOriginalFontSize() { - return originalFontSize; - } - - @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOriginalFontSize(@javax.annotation.Nullable Integer originalFontSize) { - this.originalFontSize = originalFontSize; - } - - public TemplateResponseDocumentFormFieldText fontFamily( - @javax.annotation.Nullable String fontFamily) { - this.fontFamily = fontFamily; - return this; - } - - /** - * Font family used in this form field's text. - * - * @return fontFamily - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFontFamily() { - return fontFamily; - } - - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(@javax.annotation.Nullable String fontFamily) { - this.fontFamily = fontFamily; - } - - public TemplateResponseDocumentFormFieldText validationType( - @javax.annotation.Nullable ValidationTypeEnum validationType) { - this.validationType = validationType; - return this; - } - - /** - * Each text field may contain a `validation_type` parameter. Check out the list of - * [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about - * the possible values. - * - * @return validationType - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ValidationTypeEnum getValidationType() { - return validationType; - } - - @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValidationType(@javax.annotation.Nullable ValidationTypeEnum validationType) { - this.validationType = validationType; - } - - public TemplateResponseDocumentFormFieldText validationCustomRegex( - @javax.annotation.Nullable String validationCustomRegex) { - this.validationCustomRegex = validationCustomRegex; - return this; - } - - /** - * When `validation_type` is set to `custom_regex`, this specifies the - * custom regular expression pattern that will be used to validate the text field. - * - * @return validationCustomRegex - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValidationCustomRegex() { - return validationCustomRegex; - } - - @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValidationCustomRegex(@javax.annotation.Nullable String validationCustomRegex) { - this.validationCustomRegex = validationCustomRegex; - } - - public TemplateResponseDocumentFormFieldText validationCustomRegexFormatLabel( - @javax.annotation.Nullable String validationCustomRegexFormatLabel) { - this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; - return this; - } - - /** - * When `validation_type` is set to `custom_regex`, this specifies the error - * message displayed to the signer when the text does not match the provided regex pattern. - * - * @return validationCustomRegexFormatLabel - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getValidationCustomRegexFormatLabel() { - return validationCustomRegexFormatLabel; - } - - @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValidationCustomRegexFormatLabel( - @javax.annotation.Nullable String validationCustomRegexFormatLabel) { - this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; + if (avgTextLength.getClass().equals(java.io.File.class) || + avgTextLength.getClass().equals(Integer.class) || + avgTextLength.getClass().equals(String.class) || + avgTextLength.getClass().isEnum()) { + map.put("avg_text_length", avgTextLength); + } else if (isListOfFile(avgTextLength)) { + for(int i = 0; i< getListSize(avgTextLength); i++) { + map.put("avg_text_length[" + i + "]", getFromList(avgTextLength, i)); + } + } + else { + map.put("avg_text_length", JSON.getDefault().getMapper().writeValueAsString(avgTextLength)); + } } + if (isMultiline != null) { + if (isFileTypeOrListOfFiles(isMultiline)) { + fileTypeFound = true; + } - public TemplateResponseDocumentFormFieldText group(@javax.annotation.Nullable String group) { - this.group = group; - return this; + if (isMultiline.getClass().equals(java.io.File.class) || + isMultiline.getClass().equals(Integer.class) || + isMultiline.getClass().equals(String.class) || + isMultiline.getClass().isEnum()) { + map.put("isMultiline", isMultiline); + } else if (isListOfFile(isMultiline)) { + for(int i = 0; i< getListSize(isMultiline); i++) { + map.put("isMultiline[" + i + "]", getFromList(isMultiline, i)); + } + } + else { + map.put("isMultiline", JSON.getDefault().getMapper().writeValueAsString(isMultiline)); + } } + if (originalFontSize != null) { + if (isFileTypeOrListOfFiles(originalFontSize)) { + fileTypeFound = true; + } - /** - * The name of the group this field is in. If this field is not a group, this defaults to - * `null` except for Radio fields. - * - * @return group - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGroup() { - return group; + if (originalFontSize.getClass().equals(java.io.File.class) || + originalFontSize.getClass().equals(Integer.class) || + originalFontSize.getClass().equals(String.class) || + originalFontSize.getClass().isEnum()) { + map.put("originalFontSize", originalFontSize); + } else if (isListOfFile(originalFontSize)) { + for(int i = 0; i< getListSize(originalFontSize); i++) { + map.put("originalFontSize[" + i + "]", getFromList(originalFontSize, i)); + } + } + else { + map.put("originalFontSize", JSON.getDefault().getMapper().writeValueAsString(originalFontSize)); + } } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(@javax.annotation.Nullable String group) { - this.group = group; + if (fontFamily.getClass().equals(java.io.File.class) || + fontFamily.getClass().equals(Integer.class) || + fontFamily.getClass().equals(String.class) || + fontFamily.getClass().isEnum()) { + map.put("fontFamily", fontFamily); + } else if (isListOfFile(fontFamily)) { + for(int i = 0; i< getListSize(fontFamily); i++) { + map.put("fontFamily[" + i + "]", getFromList(fontFamily, i)); + } + } + else { + map.put("fontFamily", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } } + if (validationType != null) { + if (isFileTypeOrListOfFiles(validationType)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentFormFieldText object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (validationType.getClass().equals(java.io.File.class) || + validationType.getClass().equals(Integer.class) || + validationType.getClass().equals(String.class) || + validationType.getClass().isEnum()) { + map.put("validation_type", validationType); + } else if (isListOfFile(validationType)) { + for(int i = 0; i< getListSize(validationType); i++) { + map.put("validation_type[" + i + "]", getFromList(validationType, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("validation_type", JSON.getDefault().getMapper().writeValueAsString(validationType)); } - TemplateResponseDocumentFormFieldText templateResponseDocumentFormFieldText = - (TemplateResponseDocumentFormFieldText) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldText.type) - && Objects.equals( - this.avgTextLength, templateResponseDocumentFormFieldText.avgTextLength) - && Objects.equals( - this.isMultiline, templateResponseDocumentFormFieldText.isMultiline) - && Objects.equals( - this.originalFontSize, - templateResponseDocumentFormFieldText.originalFontSize) - && Objects.equals(this.fontFamily, templateResponseDocumentFormFieldText.fontFamily) - && Objects.equals( - this.validationType, templateResponseDocumentFormFieldText.validationType) - && Objects.equals( - this.validationCustomRegex, - templateResponseDocumentFormFieldText.validationCustomRegex) - && Objects.equals( - this.validationCustomRegexFormatLabel, - templateResponseDocumentFormFieldText.validationCustomRegexFormatLabel) - && Objects.equals(this.group, templateResponseDocumentFormFieldText.group) - && super.equals(o); } + if (validationCustomRegex != null) { + if (isFileTypeOrListOfFiles(validationCustomRegex)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - type, - avgTextLength, - isMultiline, - originalFontSize, - fontFamily, - validationType, - validationCustomRegex, - validationCustomRegexFormatLabel, - group, - super.hashCode()); + if (validationCustomRegex.getClass().equals(java.io.File.class) || + validationCustomRegex.getClass().equals(Integer.class) || + validationCustomRegex.getClass().equals(String.class) || + validationCustomRegex.getClass().isEnum()) { + map.put("validation_custom_regex", validationCustomRegex); + } else if (isListOfFile(validationCustomRegex)) { + for(int i = 0; i< getListSize(validationCustomRegex); i++) { + map.put("validation_custom_regex[" + i + "]", getFromList(validationCustomRegex, i)); + } + } + else { + map.put("validation_custom_regex", JSON.getDefault().getMapper().writeValueAsString(validationCustomRegex)); + } } + if (validationCustomRegexFormatLabel != null) { + if (isFileTypeOrListOfFiles(validationCustomRegexFormatLabel)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldText {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" avgTextLength: ").append(toIndentedString(avgTextLength)).append("\n"); - sb.append(" isMultiline: ").append(toIndentedString(isMultiline)).append("\n"); - sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" validationType: ").append(toIndentedString(validationType)).append("\n"); - sb.append(" validationCustomRegex: ") - .append(toIndentedString(validationCustomRegex)) - .append("\n"); - sb.append(" validationCustomRegexFormatLabel: ") - .append(toIndentedString(validationCustomRegexFormatLabel)) - .append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); + if (validationCustomRegexFormatLabel.getClass().equals(java.io.File.class) || + validationCustomRegexFormatLabel.getClass().equals(Integer.class) || + validationCustomRegexFormatLabel.getClass().equals(String.class) || + validationCustomRegexFormatLabel.getClass().isEnum()) { + map.put("validation_custom_regex_format_label", validationCustomRegexFormatLabel); + } else if (isListOfFile(validationCustomRegexFormatLabel)) { + for(int i = 0; i< getListSize(validationCustomRegexFormatLabel); i++) { + map.put("validation_custom_regex_format_label[" + i + "]", getFromList(validationCustomRegexFormatLabel, i)); + } + } + else { + map.put("validation_custom_regex_format_label", JSON.getDefault().getMapper().writeValueAsString(validationCustomRegexFormatLabel)); + } } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (avgTextLength != null) { - if (isFileTypeOrListOfFiles(avgTextLength)) { - fileTypeFound = true; - } - - if (avgTextLength.getClass().equals(java.io.File.class) - || avgTextLength.getClass().equals(Integer.class) - || avgTextLength.getClass().equals(String.class) - || avgTextLength.getClass().isEnum()) { - map.put("avg_text_length", avgTextLength); - } else if (isListOfFile(avgTextLength)) { - for (int i = 0; i < getListSize(avgTextLength); i++) { - map.put("avg_text_length[" + i + "]", getFromList(avgTextLength, i)); - } - } else { - map.put( - "avg_text_length", - JSON.getDefault().getMapper().writeValueAsString(avgTextLength)); - } - } - if (isMultiline != null) { - if (isFileTypeOrListOfFiles(isMultiline)) { - fileTypeFound = true; - } - - if (isMultiline.getClass().equals(java.io.File.class) - || isMultiline.getClass().equals(Integer.class) - || isMultiline.getClass().equals(String.class) - || isMultiline.getClass().isEnum()) { - map.put("isMultiline", isMultiline); - } else if (isListOfFile(isMultiline)) { - for (int i = 0; i < getListSize(isMultiline); i++) { - map.put("isMultiline[" + i + "]", getFromList(isMultiline, i)); - } - } else { - map.put( - "isMultiline", - JSON.getDefault().getMapper().writeValueAsString(isMultiline)); - } + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); } - if (originalFontSize != null) { - if (isFileTypeOrListOfFiles(originalFontSize)) { - fileTypeFound = true; - } - - if (originalFontSize.getClass().equals(java.io.File.class) - || originalFontSize.getClass().equals(Integer.class) - || originalFontSize.getClass().equals(String.class) - || originalFontSize.getClass().isEnum()) { - map.put("originalFontSize", originalFontSize); - } else if (isListOfFile(originalFontSize)) { - for (int i = 0; i < getListSize(originalFontSize); i++) { - map.put("originalFontSize[" + i + "]", getFromList(originalFontSize, i)); - } - } else { - map.put( - "originalFontSize", - JSON.getDefault().getMapper().writeValueAsString(originalFontSize)); - } - } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - - if (fontFamily.getClass().equals(java.io.File.class) - || fontFamily.getClass().equals(Integer.class) - || fontFamily.getClass().equals(String.class) - || fontFamily.getClass().isEnum()) { - map.put("fontFamily", fontFamily); - } else if (isListOfFile(fontFamily)) { - for (int i = 0; i < getListSize(fontFamily); i++) { - map.put("fontFamily[" + i + "]", getFromList(fontFamily, i)); - } - } else { - map.put( - "fontFamily", - JSON.getDefault().getMapper().writeValueAsString(fontFamily)); - } - } - if (validationType != null) { - if (isFileTypeOrListOfFiles(validationType)) { - fileTypeFound = true; - } - - if (validationType.getClass().equals(java.io.File.class) - || validationType.getClass().equals(Integer.class) - || validationType.getClass().equals(String.class) - || validationType.getClass().isEnum()) { - map.put("validation_type", validationType); - } else if (isListOfFile(validationType)) { - for (int i = 0; i < getListSize(validationType); i++) { - map.put("validation_type[" + i + "]", getFromList(validationType, i)); - } - } else { - map.put( - "validation_type", - JSON.getDefault().getMapper().writeValueAsString(validationType)); - } - } - if (validationCustomRegex != null) { - if (isFileTypeOrListOfFiles(validationCustomRegex)) { - fileTypeFound = true; - } - - if (validationCustomRegex.getClass().equals(java.io.File.class) - || validationCustomRegex.getClass().equals(Integer.class) - || validationCustomRegex.getClass().equals(String.class) - || validationCustomRegex.getClass().isEnum()) { - map.put("validation_custom_regex", validationCustomRegex); - } else if (isListOfFile(validationCustomRegex)) { - for (int i = 0; i < getListSize(validationCustomRegex); i++) { - map.put( - "validation_custom_regex[" + i + "]", - getFromList(validationCustomRegex, i)); - } - } else { - map.put( - "validation_custom_regex", - JSON.getDefault() - .getMapper() - .writeValueAsString(validationCustomRegex)); - } - } - if (validationCustomRegexFormatLabel != null) { - if (isFileTypeOrListOfFiles(validationCustomRegexFormatLabel)) { - fileTypeFound = true; - } - - if (validationCustomRegexFormatLabel.getClass().equals(java.io.File.class) - || validationCustomRegexFormatLabel.getClass().equals(Integer.class) - || validationCustomRegexFormatLabel.getClass().equals(String.class) - || validationCustomRegexFormatLabel.getClass().isEnum()) { - map.put( - "validation_custom_regex_format_label", - validationCustomRegexFormatLabel); - } else if (isListOfFile(validationCustomRegexFormatLabel)) { - for (int i = 0; i < getListSize(validationCustomRegexFormatLabel); i++) { - map.put( - "validation_custom_regex_format_label[" + i + "]", - getFromList(validationCustomRegexFormatLabel, i)); - } - } else { - map.put( - "validation_custom_regex_format_label", - JSON.getDefault() - .getMapper() - .writeValueAsString(validationCustomRegexFormatLabel)); - } - } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } catch (Exception e) { + throw new ApiException(e); } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentFormFieldText", - TemplateResponseDocumentFormFieldText.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldText.class, "type", mappings); + /** + * 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 "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldText", TemplateResponseDocumentFormFieldText.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldText.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java index 6a2ae2ce6..7dbfa89ac 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java @@ -10,631 +10,661 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; + +import com.dropbox.sign.ApiException; /** * An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. */ @JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_TYPE, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_API_ID, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_NAME, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_SIGNER, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_X, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_Y, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_WIDTH, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_HEIGHT, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_REQUIRED, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_GROUP + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_TYPE, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_API_ID, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_NAME, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_SIGNER, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_X, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_Y, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_WIDTH, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_HEIGHT, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_REQUIRED, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_GROUP }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type( - value = TemplateResponseDocumentStaticFieldCheckbox.class, - name = "checkbox"), - @JsonSubTypes.Type( - value = TemplateResponseDocumentStaticFieldDateSigned.class, - name = "date_signed"), - @JsonSubTypes.Type( - value = TemplateResponseDocumentStaticFieldDropdown.class, - name = "dropdown"), - @JsonSubTypes.Type( - value = TemplateResponseDocumentStaticFieldHyperlink.class, - name = "hyperlink"), - @JsonSubTypes.Type( - value = TemplateResponseDocumentStaticFieldInitials.class, - name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldRadio.class, name = "radio"), - @JsonSubTypes.Type( - value = TemplateResponseDocumentStaticFieldSignature.class, - name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldText.class, name = "text"), + @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "checkbox"), + @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDateSigned.class, name = "date_signed"), + @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDropdown.class, name = "dropdown"), + @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldHyperlink.class, name = "hyperlink"), + @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldInitials.class, name = "initials"), + @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldRadio.class, name = "radio"), + @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldSignature.class, name = "signature"), + @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldText.class, name = "text"), }) -public class TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type; - - public static final String JSON_PROPERTY_API_ID = "api_id"; - @javax.annotation.Nullable private String apiId; - - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_SIGNER = "signer"; - @javax.annotation.Nullable private String signer = "me_now"; - - public static final String JSON_PROPERTY_X = "x"; - @javax.annotation.Nullable private Integer x; - - public static final String JSON_PROPERTY_Y = "y"; - @javax.annotation.Nullable private Integer y; - - public static final String JSON_PROPERTY_WIDTH = "width"; - @javax.annotation.Nullable private Integer width; - - public static final String JSON_PROPERTY_HEIGHT = "height"; - @javax.annotation.Nullable private Integer height; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - @javax.annotation.Nullable private Boolean required; - - public static final String JSON_PROPERTY_GROUP = "group"; - @javax.annotation.Nullable private String group; - - public TemplateResponseDocumentStaticFieldBase() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentStaticFieldBase init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentStaticFieldBase.class); - } - - public static TemplateResponseDocumentStaticFieldBase init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldBase.class); - } - - public TemplateResponseDocumentStaticFieldBase type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } - - public TemplateResponseDocumentStaticFieldBase apiId(@javax.annotation.Nullable String apiId) { - this.apiId = apiId; - return this; - } - - /** - * A unique id for the static field. - * - * @return apiId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getApiId() { - return apiId; - } - - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiId(@javax.annotation.Nullable String apiId) { - this.apiId = apiId; - } - - public TemplateResponseDocumentStaticFieldBase name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of the static field. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public TemplateResponseDocumentStaticFieldBase signer( - @javax.annotation.Nullable String signer) { - this.signer = signer; - return this; - } - - /** - * The signer of the Static Field. - * - * @return signer - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigner() { - return signer; - } - - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigner(@javax.annotation.Nullable String signer) { - this.signer = signer; - } - - public TemplateResponseDocumentStaticFieldBase x(@javax.annotation.Nullable Integer x) { - this.x = x; - return this; - } - - /** - * The horizontal offset in pixels for this static field. - * - * @return x - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getX() { - return x; - } - - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setX(@javax.annotation.Nullable Integer x) { - this.x = x; - } - - public TemplateResponseDocumentStaticFieldBase y(@javax.annotation.Nullable Integer y) { - this.y = y; - return this; - } - - /** - * The vertical offset in pixels for this static field. - * - * @return y - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getY() { - return y; - } - - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setY(@javax.annotation.Nullable Integer y) { - this.y = y; - } - - public TemplateResponseDocumentStaticFieldBase width(@javax.annotation.Nullable Integer width) { - this.width = width; - return this; - } - - /** - * The width in pixels of this static field. - * - * @return width - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getWidth() { - return width; - } - - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWidth(@javax.annotation.Nullable Integer width) { - this.width = width; - } - - public TemplateResponseDocumentStaticFieldBase height( - @javax.annotation.Nullable Integer height) { - this.height = height; - return this; - } - - /** - * The height in pixels of this static field. - * - * @return height - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getHeight() { - return height; - } - - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeight(@javax.annotation.Nullable Integer height) { - this.height = height; - } - public TemplateResponseDocumentStaticFieldBase required( - @javax.annotation.Nullable Boolean required) { - this.required = required; - return this; - } - - /** - * Boolean showing whether or not this field is required. - * - * @return required - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getRequired() { - return required; - } - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(@javax.annotation.Nullable Boolean required) { - this.required = required; - } - - public TemplateResponseDocumentStaticFieldBase group(@javax.annotation.Nullable String group) { - this.group = group; - return this; - } - - /** - * The name of the group this field is in. If this field is not a group, this defaults to - * `null`. - * - * @return group - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGroup() { - return group; - } - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(@javax.annotation.Nullable String group) { - this.group = group; - } +public class TemplateResponseDocumentStaticFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type; + + public static final String JSON_PROPERTY_API_ID = "api_id"; + @javax.annotation.Nullable + private String apiId; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_SIGNER = "signer"; + @javax.annotation.Nullable + private String signer = "me_now"; + + public static final String JSON_PROPERTY_X = "x"; + @javax.annotation.Nullable + private Integer x; + + public static final String JSON_PROPERTY_Y = "y"; + @javax.annotation.Nullable + private Integer y; + + public static final String JSON_PROPERTY_WIDTH = "width"; + @javax.annotation.Nullable + private Integer width; + + public static final String JSON_PROPERTY_HEIGHT = "height"; + @javax.annotation.Nullable + private Integer height; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + @javax.annotation.Nullable + private Boolean required; + + public static final String JSON_PROPERTY_GROUP = "group"; + @javax.annotation.Nullable + private String group; + + public TemplateResponseDocumentStaticFieldBase() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentStaticFieldBase init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldBase.class); + } + + static public TemplateResponseDocumentStaticFieldBase init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldBase.class + ); + } + + public TemplateResponseDocumentStaticFieldBase type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public TemplateResponseDocumentStaticFieldBase apiId(@javax.annotation.Nullable String apiId) { + this.apiId = apiId; + return this; + } + + /** + * A unique id for the static field. + * @return apiId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getApiId() { + return apiId; + } + + + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiId(@javax.annotation.Nullable String apiId) { + this.apiId = apiId; + } + + + public TemplateResponseDocumentStaticFieldBase name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the static field. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public TemplateResponseDocumentStaticFieldBase signer(@javax.annotation.Nullable String signer) { + this.signer = signer; + return this; + } + + /** + * The signer of the Static Field. + * @return signer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigner() { + return signer; + } + + + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigner(@javax.annotation.Nullable String signer) { + this.signer = signer; + } + + + public TemplateResponseDocumentStaticFieldBase x(@javax.annotation.Nullable Integer x) { + this.x = x; + return this; + } + + /** + * The horizontal offset in pixels for this static field. + * @return x + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getX() { + return x; + } + + + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setX(@javax.annotation.Nullable Integer x) { + this.x = x; + } + + + public TemplateResponseDocumentStaticFieldBase y(@javax.annotation.Nullable Integer y) { + this.y = y; + return this; + } + + /** + * The vertical offset in pixels for this static field. + * @return y + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getY() { + return y; + } + + + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setY(@javax.annotation.Nullable Integer y) { + this.y = y; + } + + + public TemplateResponseDocumentStaticFieldBase width(@javax.annotation.Nullable Integer width) { + this.width = width; + return this; + } + + /** + * The width in pixels of this static field. + * @return width + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getWidth() { + return width; + } + + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(@javax.annotation.Nullable Integer width) { + this.width = width; + } + + + public TemplateResponseDocumentStaticFieldBase height(@javax.annotation.Nullable Integer height) { + this.height = height; + return this; + } + + /** + * The height in pixels of this static field. + * @return height + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getHeight() { + return height; + } + + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@javax.annotation.Nullable Integer height) { + this.height = height; + } + + + public TemplateResponseDocumentStaticFieldBase required(@javax.annotation.Nullable Boolean required) { + this.required = required; + return this; + } + + /** + * Boolean showing whether or not this field is required. + * @return required + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRequired() { + return required; + } + + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(@javax.annotation.Nullable Boolean required) { + this.required = required; + } + + + public TemplateResponseDocumentStaticFieldBase group(@javax.annotation.Nullable String group) { + this.group = group; + return this; + } + + /** + * The name of the group this field is in. If this field is not a group, this defaults to `null`. + * @return group + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getGroup() { + return group; + } + + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(@javax.annotation.Nullable String group) { + this.group = group; + } + + + /** + * Return true if this TemplateResponseDocumentStaticFieldBase object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentStaticFieldBase templateResponseDocumentStaticFieldBase = (TemplateResponseDocumentStaticFieldBase) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldBase.type) && + Objects.equals(this.apiId, templateResponseDocumentStaticFieldBase.apiId) && + Objects.equals(this.name, templateResponseDocumentStaticFieldBase.name) && + Objects.equals(this.signer, templateResponseDocumentStaticFieldBase.signer) && + Objects.equals(this.x, templateResponseDocumentStaticFieldBase.x) && + Objects.equals(this.y, templateResponseDocumentStaticFieldBase.y) && + Objects.equals(this.width, templateResponseDocumentStaticFieldBase.width) && + Objects.equals(this.height, templateResponseDocumentStaticFieldBase.height) && + Objects.equals(this.required, templateResponseDocumentStaticFieldBase.required) && + Objects.equals(this.group, templateResponseDocumentStaticFieldBase.group); + } + + @Override + public int hashCode() { + return Objects.hash(type, apiId, name, signer, x, y, width, height, required, group); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldBase {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentStaticFieldBase object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentStaticFieldBase templateResponseDocumentStaticFieldBase = - (TemplateResponseDocumentStaticFieldBase) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldBase.type) - && Objects.equals(this.apiId, templateResponseDocumentStaticFieldBase.apiId) - && Objects.equals(this.name, templateResponseDocumentStaticFieldBase.name) - && Objects.equals(this.signer, templateResponseDocumentStaticFieldBase.signer) - && Objects.equals(this.x, templateResponseDocumentStaticFieldBase.x) - && Objects.equals(this.y, templateResponseDocumentStaticFieldBase.y) - && Objects.equals(this.width, templateResponseDocumentStaticFieldBase.width) - && Objects.equals(this.height, templateResponseDocumentStaticFieldBase.height) - && Objects.equals(this.required, templateResponseDocumentStaticFieldBase.required) - && Objects.equals(this.group, templateResponseDocumentStaticFieldBase.group); - } - - @Override - public int hashCode() { - return Objects.hash(type, apiId, name, signer, x, y, width, height, required, group); } + if (apiId != null) { + if (isFileTypeOrListOfFiles(apiId)) { + fileTypeFound = true; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldBase {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); - sb.append(" x: ").append(toIndentedString(x)).append("\n"); - sb.append(" y: ").append(toIndentedString(y)).append("\n"); - sb.append(" width: ").append(toIndentedString(width)).append("\n"); - sb.append(" height: ").append(toIndentedString(height)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); + if (apiId.getClass().equals(java.io.File.class) || + apiId.getClass().equals(Integer.class) || + apiId.getClass().equals(String.class) || + apiId.getClass().isEnum()) { + map.put("api_id", apiId); + } else if (isListOfFile(apiId)) { + for(int i = 0; i< getListSize(apiId); i++) { + map.put("api_id[" + i + "]", getFromList(apiId, i)); + } + } + else { + map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (apiId != null) { - if (isFileTypeOrListOfFiles(apiId)) { - fileTypeFound = true; - } - - if (apiId.getClass().equals(java.io.File.class) - || apiId.getClass().equals(Integer.class) - || apiId.getClass().equals(String.class) - || apiId.getClass().isEnum()) { - map.put("api_id", apiId); - } else if (isListOfFile(apiId)) { - for (int i = 0; i < getListSize(apiId); i++) { - map.put("api_id[" + i + "]", getFromList(apiId, i)); - } - } else { - map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); - } - } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (signer != null) { - if (isFileTypeOrListOfFiles(signer)) { - fileTypeFound = true; - } - - if (signer.getClass().equals(java.io.File.class) - || signer.getClass().equals(Integer.class) - || signer.getClass().equals(String.class) - || signer.getClass().isEnum()) { - map.put("signer", signer); - } else if (isListOfFile(signer)) { - for (int i = 0; i < getListSize(signer); i++) { - map.put("signer[" + i + "]", getFromList(signer, i)); - } - } else { - map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); - } - } - if (x != null) { - if (isFileTypeOrListOfFiles(x)) { - fileTypeFound = true; - } - - if (x.getClass().equals(java.io.File.class) - || x.getClass().equals(Integer.class) - || x.getClass().equals(String.class) - || x.getClass().isEnum()) { - map.put("x", x); - } else if (isListOfFile(x)) { - for (int i = 0; i < getListSize(x); i++) { - map.put("x[" + i + "]", getFromList(x, i)); - } - } else { - map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); - } - } - if (y != null) { - if (isFileTypeOrListOfFiles(y)) { - fileTypeFound = true; - } - - if (y.getClass().equals(java.io.File.class) - || y.getClass().equals(Integer.class) - || y.getClass().equals(String.class) - || y.getClass().isEnum()) { - map.put("y", y); - } else if (isListOfFile(y)) { - for (int i = 0; i < getListSize(y); i++) { - map.put("y[" + i + "]", getFromList(y, i)); - } - } else { - map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); - } + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); } - if (width != null) { - if (isFileTypeOrListOfFiles(width)) { - fileTypeFound = true; - } - - if (width.getClass().equals(java.io.File.class) - || width.getClass().equals(Integer.class) - || width.getClass().equals(String.class) - || width.getClass().isEnum()) { - map.put("width", width); - } else if (isListOfFile(width)) { - for (int i = 0; i < getListSize(width); i++) { - map.put("width[" + i + "]", getFromList(width, i)); - } - } else { - map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); - } - } - if (height != null) { - if (isFileTypeOrListOfFiles(height)) { - fileTypeFound = true; - } - - if (height.getClass().equals(java.io.File.class) - || height.getClass().equals(Integer.class) - || height.getClass().equals(String.class) - || height.getClass().isEnum()) { - map.put("height", height); - } else if (isListOfFile(height)) { - for (int i = 0; i < getListSize(height); i++) { - map.put("height[" + i + "]", getFromList(height, i)); - } - } else { - map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); - } - } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - - if (required.getClass().equals(java.io.File.class) - || required.getClass().equals(Integer.class) - || required.getClass().equals(String.class) - || required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for (int i = 0; i < getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } - } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - - if (group.getClass().equals(java.io.File.class) - || group.getClass().equals(Integer.class) - || group.getClass().equals(String.class) - || group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for (int i = 0; i < getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } - } - } catch (Exception e) { - throw new ApiException(e); } - - return fileTypeFound ? map : new HashMap<>(); + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (signer != null) { + if (isFileTypeOrListOfFiles(signer)) { + fileTypeFound = true; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + if (signer.getClass().equals(java.io.File.class) || + signer.getClass().equals(Integer.class) || + signer.getClass().equals(String.class) || + signer.getClass().isEnum()) { + map.put("signer", signer); + } else if (isListOfFile(signer)) { + for(int i = 0; i< getListSize(signer); i++) { + map.put("signer[" + i + "]", getFromList(signer, i)); + } + } + else { + map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); + } } + if (x != null) { + if (isFileTypeOrListOfFiles(x)) { + fileTypeFound = true; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; + if (x.getClass().equals(java.io.File.class) || + x.getClass().equals(Integer.class) || + x.getClass().equals(String.class) || + x.getClass().isEnum()) { + map.put("x", x); + } else if (isListOfFile(x)) { + for(int i = 0; i< getListSize(x); i++) { + map.put("x[" + i + "]", getFromList(x, i)); + } + } + else { + map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); + } } + if (y != null) { + if (isFileTypeOrListOfFiles(y)) { + fileTypeFound = true; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + if (y.getClass().equals(java.io.File.class) || + y.getClass().equals(Integer.class) || + y.getClass().equals(String.class) || + y.getClass().isEnum()) { + map.put("y", y); + } else if (isListOfFile(y)) { + for(int i = 0; i< getListSize(y); i++) { + map.put("y[" + i + "]", getFromList(y, i)); + } + } + else { + map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); + } } + if (width != null) { + if (isFileTypeOrListOfFiles(width)) { + fileTypeFound = true; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); + if (width.getClass().equals(java.io.File.class) || + width.getClass().equals(Integer.class) || + width.getClass().equals(String.class) || + width.getClass().isEnum()) { + map.put("width", width); + } else if (isListOfFile(width)) { + for(int i = 0; i< getListSize(width); i++) { + map.put("width[" + i + "]", getFromList(width, i)); + } + } + else { + map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); + } } + if (height != null) { + if (isFileTypeOrListOfFiles(height)) { + fileTypeFound = true; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + if (height.getClass().equals(java.io.File.class) || + height.getClass().equals(Integer.class) || + height.getClass().equals(String.class) || + height.getClass().isEnum()) { + map.put("height", height); + } else if (isListOfFile(height)) { + for(int i = 0; i< getListSize(height); i++) { + map.put("height[" + i + "]", getFromList(height, i)); + } + } + else { + map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); + } } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } - /** - * 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"; + if (required.getClass().equals(java.io.File.class) || + required.getClass().equals(Integer.class) || + required.getClass().equals(String.class) || + required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for(int i = 0; i< getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } + else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); } - return o.toString().replace("\n", "\n "); } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("checkbox", TemplateResponseDocumentStaticFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentStaticFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentStaticFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentStaticFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentStaticFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentStaticFieldSignature.class); - mappings.put("text", TemplateResponseDocumentStaticFieldText.class); - mappings.put( - "TemplateResponseDocumentStaticFieldBase", - TemplateResponseDocumentStaticFieldBase.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldBase.class, "type", mappings); + if (group.getClass().equals(java.io.File.class) || + group.getClass().equals(Integer.class) || + group.getClass().equals(String.class) || + group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for(int i = 0; i< getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); + } + } + else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("checkbox", TemplateResponseDocumentStaticFieldCheckbox.class); + mappings.put("date_signed", TemplateResponseDocumentStaticFieldDateSigned.class); + mappings.put("dropdown", TemplateResponseDocumentStaticFieldDropdown.class); + mappings.put("hyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); + mappings.put("initials", TemplateResponseDocumentStaticFieldInitials.class); + mappings.put("radio", TemplateResponseDocumentStaticFieldRadio.class); + mappings.put("signature", TemplateResponseDocumentStaticFieldSignature.class); + mappings.put("text", TemplateResponseDocumentStaticFieldText.class); + mappings.put("TemplateResponseDocumentStaticFieldBase", TemplateResponseDocumentStaticFieldBase.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldBase.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java index 97294dd19..647b488c9 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java @@ -10,192 +10,188 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** This class extends `TemplateResponseDocumentStaticFieldBase` */ -@JsonPropertyOrder({TemplateResponseDocumentStaticFieldCheckbox.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentStaticFieldCheckbox - extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "checkbox"; - - public TemplateResponseDocumentStaticFieldCheckbox() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentStaticFieldCheckbox init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentStaticFieldCheckbox.class); - } - public static TemplateResponseDocumentStaticFieldCheckbox init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldCheckbox.class); - } - - public TemplateResponseDocumentStaticFieldCheckbox type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * - * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses - * `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses - * `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentStaticFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentStaticFieldBase` + */ +@JsonPropertyOrder({ + TemplateResponseDocumentStaticFieldCheckbox.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocumentStaticFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "checkbox"; + + public TemplateResponseDocumentStaticFieldCheckbox() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentStaticFieldCheckbox init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldCheckbox.class); + } + + static public TemplateResponseDocumentStaticFieldCheckbox init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldCheckbox.class + ); + } + + public TemplateResponseDocumentStaticFieldCheckbox type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + /** + * Return true if this TemplateResponseDocumentStaticFieldCheckbox object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentStaticFieldCheckbox templateResponseDocumentStaticFieldCheckbox = (TemplateResponseDocumentStaticFieldCheckbox) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldCheckbox.type) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldCheckbox {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentStaticFieldCheckbox object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentStaticFieldCheckbox templateResponseDocumentStaticFieldCheckbox = - (TemplateResponseDocumentStaticFieldCheckbox) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldCheckbox.type) - && super.equals(o); } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldCheckbox {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + /** + * 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 "); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentStaticFieldCheckbox", - TemplateResponseDocumentStaticFieldCheckbox.class); - JSON.registerDiscriminator( - TemplateResponseDocumentStaticFieldCheckbox.class, "type", mappings); - } + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldCheckbox", TemplateResponseDocumentStaticFieldCheckbox.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldCheckbox.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java index 3a42fbb7b..8952cbddb 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java @@ -10,195 +10,188 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** This class extends `TemplateResponseDocumentStaticFieldBase` */ -@JsonPropertyOrder({TemplateResponseDocumentStaticFieldDateSigned.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentStaticFieldDateSigned - extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "date_signed"; - - public TemplateResponseDocumentStaticFieldDateSigned() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentStaticFieldDateSigned init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentStaticFieldDateSigned.class); - } - public static TemplateResponseDocumentStaticFieldDateSigned init(HashMap data) - throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldDateSigned.class); - } - - public TemplateResponseDocumentStaticFieldDateSigned type( - @javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * - * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses - * `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses - * `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentStaticFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentStaticFieldBase` + */ +@JsonPropertyOrder({ + TemplateResponseDocumentStaticFieldDateSigned.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocumentStaticFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "date_signed"; + + public TemplateResponseDocumentStaticFieldDateSigned() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentStaticFieldDateSigned init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldDateSigned.class); + } + + static public TemplateResponseDocumentStaticFieldDateSigned init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldDateSigned.class + ); + } + + public TemplateResponseDocumentStaticFieldDateSigned type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + /** + * Return true if this TemplateResponseDocumentStaticFieldDateSigned object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentStaticFieldDateSigned templateResponseDocumentStaticFieldDateSigned = (TemplateResponseDocumentStaticFieldDateSigned) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldDateSigned.type) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldDateSigned {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentStaticFieldDateSigned object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentStaticFieldDateSigned - templateResponseDocumentStaticFieldDateSigned = - (TemplateResponseDocumentStaticFieldDateSigned) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldDateSigned.type) - && super.equals(o); } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldDateSigned {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + /** + * 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 "); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentStaticFieldDateSigned", - TemplateResponseDocumentStaticFieldDateSigned.class); - JSON.registerDiscriminator( - TemplateResponseDocumentStaticFieldDateSigned.class, "type", mappings); - } + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldDateSigned", TemplateResponseDocumentStaticFieldDateSigned.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldDateSigned.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java index ba9fc8e2d..986bc4929 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java @@ -10,192 +10,188 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** This class extends `TemplateResponseDocumentStaticFieldBase` */ -@JsonPropertyOrder({TemplateResponseDocumentStaticFieldDropdown.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentStaticFieldDropdown - extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "dropdown"; - - public TemplateResponseDocumentStaticFieldDropdown() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentStaticFieldDropdown init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentStaticFieldDropdown.class); - } - public static TemplateResponseDocumentStaticFieldDropdown init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldDropdown.class); - } - - public TemplateResponseDocumentStaticFieldDropdown type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * - * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses - * `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses - * `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentStaticFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentStaticFieldBase` + */ +@JsonPropertyOrder({ + TemplateResponseDocumentStaticFieldDropdown.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocumentStaticFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "dropdown"; + + public TemplateResponseDocumentStaticFieldDropdown() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentStaticFieldDropdown init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldDropdown.class); + } + + static public TemplateResponseDocumentStaticFieldDropdown init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldDropdown.class + ); + } + + public TemplateResponseDocumentStaticFieldDropdown type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + /** + * Return true if this TemplateResponseDocumentStaticFieldDropdown object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentStaticFieldDropdown templateResponseDocumentStaticFieldDropdown = (TemplateResponseDocumentStaticFieldDropdown) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldDropdown.type) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldDropdown {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentStaticFieldDropdown object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentStaticFieldDropdown templateResponseDocumentStaticFieldDropdown = - (TemplateResponseDocumentStaticFieldDropdown) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldDropdown.type) - && super.equals(o); } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldDropdown {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + /** + * 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 "); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentStaticFieldDropdown", - TemplateResponseDocumentStaticFieldDropdown.class); - JSON.registerDiscriminator( - TemplateResponseDocumentStaticFieldDropdown.class, "type", mappings); - } + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldDropdown", TemplateResponseDocumentStaticFieldDropdown.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldDropdown.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java index 29052c92c..2e83b846b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java @@ -10,193 +10,188 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** This class extends `TemplateResponseDocumentStaticFieldBase` */ -@JsonPropertyOrder({TemplateResponseDocumentStaticFieldHyperlink.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentStaticFieldHyperlink - extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "hyperlink"; - - public TemplateResponseDocumentStaticFieldHyperlink() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentStaticFieldHyperlink init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentStaticFieldHyperlink.class); - } - public static TemplateResponseDocumentStaticFieldHyperlink init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldHyperlink.class); - } - - public TemplateResponseDocumentStaticFieldHyperlink type( - @javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * - * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses - * `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses - * `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentStaticFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentStaticFieldBase` + */ +@JsonPropertyOrder({ + TemplateResponseDocumentStaticFieldHyperlink.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocumentStaticFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "hyperlink"; + + public TemplateResponseDocumentStaticFieldHyperlink() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentStaticFieldHyperlink init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldHyperlink.class); + } + + static public TemplateResponseDocumentStaticFieldHyperlink init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldHyperlink.class + ); + } + + public TemplateResponseDocumentStaticFieldHyperlink type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + /** + * Return true if this TemplateResponseDocumentStaticFieldHyperlink object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentStaticFieldHyperlink templateResponseDocumentStaticFieldHyperlink = (TemplateResponseDocumentStaticFieldHyperlink) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldHyperlink.type) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldHyperlink {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentStaticFieldHyperlink object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentStaticFieldHyperlink templateResponseDocumentStaticFieldHyperlink = - (TemplateResponseDocumentStaticFieldHyperlink) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldHyperlink.type) - && super.equals(o); } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldHyperlink {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + /** + * 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 "); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentStaticFieldHyperlink", - TemplateResponseDocumentStaticFieldHyperlink.class); - JSON.registerDiscriminator( - TemplateResponseDocumentStaticFieldHyperlink.class, "type", mappings); - } + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldHyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldHyperlink.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java index bd5c5f0e5..09c1333b8 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java @@ -10,192 +10,188 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** This class extends `TemplateResponseDocumentStaticFieldBase` */ -@JsonPropertyOrder({TemplateResponseDocumentStaticFieldInitials.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentStaticFieldInitials - extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "initials"; - - public TemplateResponseDocumentStaticFieldInitials() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentStaticFieldInitials init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentStaticFieldInitials.class); - } - public static TemplateResponseDocumentStaticFieldInitials init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldInitials.class); - } - - public TemplateResponseDocumentStaticFieldInitials type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * - * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses - * `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses - * `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentStaticFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentStaticFieldBase` + */ +@JsonPropertyOrder({ + TemplateResponseDocumentStaticFieldInitials.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocumentStaticFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "initials"; + + public TemplateResponseDocumentStaticFieldInitials() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentStaticFieldInitials init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldInitials.class); + } + + static public TemplateResponseDocumentStaticFieldInitials init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldInitials.class + ); + } + + public TemplateResponseDocumentStaticFieldInitials type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + /** + * Return true if this TemplateResponseDocumentStaticFieldInitials object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentStaticFieldInitials templateResponseDocumentStaticFieldInitials = (TemplateResponseDocumentStaticFieldInitials) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldInitials.type) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldInitials {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentStaticFieldInitials object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentStaticFieldInitials templateResponseDocumentStaticFieldInitials = - (TemplateResponseDocumentStaticFieldInitials) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldInitials.type) - && super.equals(o); } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldInitials {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + /** + * 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 "); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentStaticFieldInitials", - TemplateResponseDocumentStaticFieldInitials.class); - JSON.registerDiscriminator( - TemplateResponseDocumentStaticFieldInitials.class, "type", mappings); - } + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldInitials", TemplateResponseDocumentStaticFieldInitials.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldInitials.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java index 3b0590111..269e5bb6e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java @@ -10,191 +10,188 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** This class extends `TemplateResponseDocumentStaticFieldBase` */ -@JsonPropertyOrder({TemplateResponseDocumentStaticFieldRadio.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentStaticFieldRadio - extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "radio"; - - public TemplateResponseDocumentStaticFieldRadio() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentStaticFieldRadio init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentStaticFieldRadio.class); - } - public static TemplateResponseDocumentStaticFieldRadio init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldRadio.class); - } - - public TemplateResponseDocumentStaticFieldRadio type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * - * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses - * `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses - * `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentStaticFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentStaticFieldBase` + */ +@JsonPropertyOrder({ + TemplateResponseDocumentStaticFieldRadio.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentStaticFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "radio"; + + public TemplateResponseDocumentStaticFieldRadio() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentStaticFieldRadio init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldRadio.class); + } + + static public TemplateResponseDocumentStaticFieldRadio init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldRadio.class + ); + } + + public TemplateResponseDocumentStaticFieldRadio type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + /** + * Return true if this TemplateResponseDocumentStaticFieldRadio object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentStaticFieldRadio templateResponseDocumentStaticFieldRadio = (TemplateResponseDocumentStaticFieldRadio) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldRadio.type) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldRadio {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentStaticFieldRadio object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentStaticFieldRadio templateResponseDocumentStaticFieldRadio = - (TemplateResponseDocumentStaticFieldRadio) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldRadio.type) - && super.equals(o); } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldRadio {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + /** + * 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 "); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentStaticFieldRadio", - TemplateResponseDocumentStaticFieldRadio.class); - JSON.registerDiscriminator( - TemplateResponseDocumentStaticFieldRadio.class, "type", mappings); - } + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldRadio", TemplateResponseDocumentStaticFieldRadio.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldRadio.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java index cd319353d..d12a2807a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java @@ -10,193 +10,188 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** This class extends `TemplateResponseDocumentStaticFieldBase` */ -@JsonPropertyOrder({TemplateResponseDocumentStaticFieldSignature.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentStaticFieldSignature - extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "signature"; - - public TemplateResponseDocumentStaticFieldSignature() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentStaticFieldSignature init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentStaticFieldSignature.class); - } - public static TemplateResponseDocumentStaticFieldSignature init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldSignature.class); - } - - public TemplateResponseDocumentStaticFieldSignature type( - @javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * - * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses - * `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses - * `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentStaticFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentStaticFieldBase` + */ +@JsonPropertyOrder({ + TemplateResponseDocumentStaticFieldSignature.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocumentStaticFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "signature"; + + public TemplateResponseDocumentStaticFieldSignature() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentStaticFieldSignature init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldSignature.class); + } + + static public TemplateResponseDocumentStaticFieldSignature init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldSignature.class + ); + } + + public TemplateResponseDocumentStaticFieldSignature type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + /** + * Return true if this TemplateResponseDocumentStaticFieldSignature object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentStaticFieldSignature templateResponseDocumentStaticFieldSignature = (TemplateResponseDocumentStaticFieldSignature) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldSignature.type) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldSignature {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentStaticFieldSignature object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentStaticFieldSignature templateResponseDocumentStaticFieldSignature = - (TemplateResponseDocumentStaticFieldSignature) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldSignature.type) - && super.equals(o); } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldSignature {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + /** + * 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 "); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentStaticFieldSignature", - TemplateResponseDocumentStaticFieldSignature.class); - JSON.registerDiscriminator( - TemplateResponseDocumentStaticFieldSignature.class, "type", mappings); - } + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldSignature", TemplateResponseDocumentStaticFieldSignature.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldSignature.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java index ca3d5682c..ea827c7e2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java @@ -10,190 +10,188 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** This class extends `TemplateResponseDocumentStaticFieldBase` */ -@JsonPropertyOrder({TemplateResponseDocumentStaticFieldText.JSON_PROPERTY_TYPE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties( - allowSetters = true, // allows the type to be set during deserialization - ignoreUnknown = true) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXISTING_PROPERTY, - property = "type", - visible = true) -public class TemplateResponseDocumentStaticFieldText - extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private String type = "text"; - - public TemplateResponseDocumentStaticFieldText() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseDocumentStaticFieldText init(String jsonData) throws Exception { - return new ObjectMapper() - .readValue(jsonData, TemplateResponseDocumentStaticFieldText.class); - } - public static TemplateResponseDocumentStaticFieldText init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldText.class); - } - - public TemplateResponseDocumentStaticFieldText type(@javax.annotation.Nonnull String type) { - this.type = type; - return this; - } - - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * - * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses - * `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses - * `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses - * `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses - * `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses - * `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses - * `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses - * `TemplateResponseDocumentStaticFieldInitials` - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getType() { - return type; - } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull String type) { - this.type = type; - } +import com.dropbox.sign.ApiException; +/** + * This class extends `TemplateResponseDocumentStaticFieldBase` + */ +@JsonPropertyOrder({ + TemplateResponseDocumentStaticFieldText.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) + +public class TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentStaticFieldBase { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type = "text"; + + public TemplateResponseDocumentStaticFieldText() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseDocumentStaticFieldText init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldText.class); + } + + static public TemplateResponseDocumentStaticFieldText init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldText.class + ); + } + + public TemplateResponseDocumentStaticFieldText type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + /** + * Return true if this TemplateResponseDocumentStaticFieldText object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseDocumentStaticFieldText templateResponseDocumentStaticFieldText = (TemplateResponseDocumentStaticFieldText) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldText.type) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldText {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseDocumentStaticFieldText object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - TemplateResponseDocumentStaticFieldText templateResponseDocumentStaticFieldText = - (TemplateResponseDocumentStaticFieldText) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldText.type) - && super.equals(o); } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldText {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } - - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } - - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + /** + * 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 "); + } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put( - "TemplateResponseDocumentStaticFieldText", - TemplateResponseDocumentStaticFieldText.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldText.class, "type", mappings); - } + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldText", TemplateResponseDocumentStaticFieldText.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldText.class, "type", mappings); + } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java index 9c0fca40a..a37e6aa97 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java @@ -10,214 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** Average text length in this field. */ + +import com.dropbox.sign.ApiException; +/** + * Average text length in this field. + */ @JsonPropertyOrder({ - TemplateResponseFieldAvgTextLength.JSON_PROPERTY_NUM_LINES, - TemplateResponseFieldAvgTextLength.JSON_PROPERTY_NUM_CHARS_PER_LINE + TemplateResponseFieldAvgTextLength.JSON_PROPERTY_NUM_LINES, + TemplateResponseFieldAvgTextLength.JSON_PROPERTY_NUM_CHARS_PER_LINE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateResponseFieldAvgTextLength { - public static final String JSON_PROPERTY_NUM_LINES = "num_lines"; - @javax.annotation.Nullable private Integer numLines; - - public static final String JSON_PROPERTY_NUM_CHARS_PER_LINE = "num_chars_per_line"; - @javax.annotation.Nullable private Integer numCharsPerLine; - - public TemplateResponseFieldAvgTextLength() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseFieldAvgTextLength init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseFieldAvgTextLength.class); - } - - public static TemplateResponseFieldAvgTextLength init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseFieldAvgTextLength.class); - } - - public TemplateResponseFieldAvgTextLength numLines( - @javax.annotation.Nullable Integer numLines) { - this.numLines = numLines; - return this; - } - - /** - * Number of lines. - * - * @return numLines - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_LINES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getNumLines() { - return numLines; - } - - @JsonProperty(JSON_PROPERTY_NUM_LINES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumLines(@javax.annotation.Nullable Integer numLines) { - this.numLines = numLines; - } - - public TemplateResponseFieldAvgTextLength numCharsPerLine( - @javax.annotation.Nullable Integer numCharsPerLine) { - this.numCharsPerLine = numCharsPerLine; - return this; - } - - /** - * Number of characters per line. - * - * @return numCharsPerLine - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_CHARS_PER_LINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getNumCharsPerLine() { - return numCharsPerLine; - } + public static final String JSON_PROPERTY_NUM_LINES = "num_lines"; + @javax.annotation.Nullable + private Integer numLines; + + public static final String JSON_PROPERTY_NUM_CHARS_PER_LINE = "num_chars_per_line"; + @javax.annotation.Nullable + private Integer numCharsPerLine; + + public TemplateResponseFieldAvgTextLength() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseFieldAvgTextLength init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseFieldAvgTextLength.class); + } + + static public TemplateResponseFieldAvgTextLength init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseFieldAvgTextLength.class + ); + } + + public TemplateResponseFieldAvgTextLength numLines(@javax.annotation.Nullable Integer numLines) { + this.numLines = numLines; + return this; + } + + /** + * Number of lines. + * @return numLines + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_LINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getNumLines() { + return numLines; + } + + + @JsonProperty(JSON_PROPERTY_NUM_LINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumLines(@javax.annotation.Nullable Integer numLines) { + this.numLines = numLines; + } + + + public TemplateResponseFieldAvgTextLength numCharsPerLine(@javax.annotation.Nullable Integer numCharsPerLine) { + this.numCharsPerLine = numCharsPerLine; + return this; + } + + /** + * Number of characters per line. + * @return numCharsPerLine + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_CHARS_PER_LINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getNumCharsPerLine() { + return numCharsPerLine; + } + + + @JsonProperty(JSON_PROPERTY_NUM_CHARS_PER_LINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumCharsPerLine(@javax.annotation.Nullable Integer numCharsPerLine) { + this.numCharsPerLine = numCharsPerLine; + } + + + /** + * Return true if this TemplateResponseFieldAvgTextLength object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseFieldAvgTextLength templateResponseFieldAvgTextLength = (TemplateResponseFieldAvgTextLength) o; + return Objects.equals(this.numLines, templateResponseFieldAvgTextLength.numLines) && + Objects.equals(this.numCharsPerLine, templateResponseFieldAvgTextLength.numCharsPerLine); + } + + @Override + public int hashCode() { + return Objects.hash(numLines, numCharsPerLine); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseFieldAvgTextLength {\n"); + sb.append(" numLines: ").append(toIndentedString(numLines)).append("\n"); + sb.append(" numCharsPerLine: ").append(toIndentedString(numCharsPerLine)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (numLines != null) { + if (isFileTypeOrListOfFiles(numLines)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_NUM_CHARS_PER_LINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumCharsPerLine(@javax.annotation.Nullable Integer numCharsPerLine) { - this.numCharsPerLine = numCharsPerLine; + if (numLines.getClass().equals(java.io.File.class) || + numLines.getClass().equals(Integer.class) || + numLines.getClass().equals(String.class) || + numLines.getClass().isEnum()) { + map.put("num_lines", numLines); + } else if (isListOfFile(numLines)) { + for(int i = 0; i< getListSize(numLines); i++) { + map.put("num_lines[" + i + "]", getFromList(numLines, i)); + } + } + else { + map.put("num_lines", JSON.getDefault().getMapper().writeValueAsString(numLines)); + } } + if (numCharsPerLine != null) { + if (isFileTypeOrListOfFiles(numCharsPerLine)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseFieldAvgTextLength object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (numCharsPerLine.getClass().equals(java.io.File.class) || + numCharsPerLine.getClass().equals(Integer.class) || + numCharsPerLine.getClass().equals(String.class) || + numCharsPerLine.getClass().isEnum()) { + map.put("num_chars_per_line", numCharsPerLine); + } else if (isListOfFile(numCharsPerLine)) { + for(int i = 0; i< getListSize(numCharsPerLine); i++) { + map.put("num_chars_per_line[" + i + "]", getFromList(numCharsPerLine, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("num_chars_per_line", JSON.getDefault().getMapper().writeValueAsString(numCharsPerLine)); } - TemplateResponseFieldAvgTextLength templateResponseFieldAvgTextLength = - (TemplateResponseFieldAvgTextLength) o; - return Objects.equals(this.numLines, templateResponseFieldAvgTextLength.numLines) - && Objects.equals( - this.numCharsPerLine, templateResponseFieldAvgTextLength.numCharsPerLine); } - - @Override - public int hashCode() { - return Objects.hash(numLines, numCharsPerLine); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseFieldAvgTextLength {\n"); - sb.append(" numLines: ").append(toIndentedString(numLines)).append("\n"); - sb.append(" numCharsPerLine: ").append(toIndentedString(numCharsPerLine)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (numLines != null) { - if (isFileTypeOrListOfFiles(numLines)) { - fileTypeFound = true; - } - - if (numLines.getClass().equals(java.io.File.class) - || numLines.getClass().equals(Integer.class) - || numLines.getClass().equals(String.class) - || numLines.getClass().isEnum()) { - map.put("num_lines", numLines); - } else if (isListOfFile(numLines)) { - for (int i = 0; i < getListSize(numLines); i++) { - map.put("num_lines[" + i + "]", getFromList(numLines, i)); - } - } else { - map.put( - "num_lines", - JSON.getDefault().getMapper().writeValueAsString(numLines)); - } - } - if (numCharsPerLine != null) { - if (isFileTypeOrListOfFiles(numCharsPerLine)) { - fileTypeFound = true; - } - - if (numCharsPerLine.getClass().equals(java.io.File.class) - || numCharsPerLine.getClass().equals(Integer.class) - || numCharsPerLine.getClass().equals(String.class) - || numCharsPerLine.getClass().isEnum()) { - map.put("num_chars_per_line", numCharsPerLine); - } else if (isListOfFile(numCharsPerLine)) { - for (int i = 0; i < getListSize(numCharsPerLine); i++) { - map.put("num_chars_per_line[" + i + "]", getFromList(numCharsPerLine, i)); - } - } else { - map.put( - "num_chars_per_line", - JSON.getDefault().getMapper().writeValueAsString(numCharsPerLine)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java index b313ab8d8..412eeda59 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java @@ -10,206 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TemplateResponseSignerRole */ + +import com.dropbox.sign.ApiException; +/** + * TemplateResponseSignerRole + */ @JsonPropertyOrder({ - TemplateResponseSignerRole.JSON_PROPERTY_NAME, - TemplateResponseSignerRole.JSON_PROPERTY_ORDER + TemplateResponseSignerRole.JSON_PROPERTY_NAME, + TemplateResponseSignerRole.JSON_PROPERTY_ORDER }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateResponseSignerRole { - public static final String JSON_PROPERTY_NAME = "name"; - @javax.annotation.Nullable private String name; - - public static final String JSON_PROPERTY_ORDER = "order"; - @javax.annotation.Nullable private Integer order; - - public TemplateResponseSignerRole() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateResponseSignerRole init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseSignerRole.class); - } - - public static TemplateResponseSignerRole init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseSignerRole.class); - } - - public TemplateResponseSignerRole name(@javax.annotation.Nullable String name) { - this.name = name; - return this; - } - - /** - * The name of the Role. - * - * @return name - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@javax.annotation.Nullable String name) { - this.name = name; - } - - public TemplateResponseSignerRole order(@javax.annotation.Nullable Integer order) { - this.order = order; - return this; - } - - /** - * If signer order is assigned this is the 0-based index for this role. - * - * @return order - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getOrder() { - return order; - } + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_ORDER = "order"; + @javax.annotation.Nullable + private Integer order; + + public TemplateResponseSignerRole() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateResponseSignerRole init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseSignerRole.class); + } + + static public TemplateResponseSignerRole init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseSignerRole.class + ); + } + + public TemplateResponseSignerRole name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the Role. + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public TemplateResponseSignerRole order(@javax.annotation.Nullable Integer order) { + this.order = order; + return this; + } + + /** + * If signer order is assigned this is the 0-based index for this role. + * @return order + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getOrder() { + return order; + } + + + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(@javax.annotation.Nullable Integer order) { + this.order = order; + } + + + /** + * Return true if this TemplateResponseSignerRole object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponseSignerRole templateResponseSignerRole = (TemplateResponseSignerRole) o; + return Objects.equals(this.name, templateResponseSignerRole.name) && + Objects.equals(this.order, templateResponseSignerRole.order); + } + + @Override + public int hashCode() { + return Objects.hash(name, order); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseSignerRole {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrder(@javax.annotation.Nullable Integer order) { - this.order = order; + if (name.getClass().equals(java.io.File.class) || + name.getClass().equals(Integer.class) || + name.getClass().equals(String.class) || + name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for(int i = 0; i< getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } + else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (order != null) { + if (isFileTypeOrListOfFiles(order)) { + fileTypeFound = true; + } - /** Return true if this TemplateResponseSignerRole object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (order.getClass().equals(java.io.File.class) || + order.getClass().equals(Integer.class) || + order.getClass().equals(String.class) || + order.getClass().isEnum()) { + map.put("order", order); + } else if (isListOfFile(order)) { + for(int i = 0; i< getListSize(order); i++) { + map.put("order[" + i + "]", getFromList(order, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); } - TemplateResponseSignerRole templateResponseSignerRole = (TemplateResponseSignerRole) o; - return Objects.equals(this.name, templateResponseSignerRole.name) - && Objects.equals(this.order, templateResponseSignerRole.order); } - - @Override - public int hashCode() { - return Objects.hash(name, order); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseSignerRole {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - - if (name.getClass().equals(java.io.File.class) - || name.getClass().equals(Integer.class) - || name.getClass().equals(String.class) - || name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for (int i = 0; i < getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } - } - if (order != null) { - if (isFileTypeOrListOfFiles(order)) { - fileTypeFound = true; - } - - if (order.getClass().equals(java.io.File.class) - || order.getClass().equals(Integer.class) - || order.getClass().equals(String.class) - || order.getClass().isEnum()) { - map.put("order", order); - } else if (isListOfFile(order)) { - for (int i = 0; i < getListSize(order); i++) { - map.put("order[" + i + "]", getFromList(order, i)); - } - } else { - map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java index d1720e7ef..feb95caef 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java @@ -10,418 +10,444 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** TemplateUpdateFilesRequest */ + +import com.dropbox.sign.ApiException; +/** + * TemplateUpdateFilesRequest + */ @JsonPropertyOrder({ - TemplateUpdateFilesRequest.JSON_PROPERTY_CLIENT_ID, - TemplateUpdateFilesRequest.JSON_PROPERTY_FILES, - TemplateUpdateFilesRequest.JSON_PROPERTY_FILE_URLS, - TemplateUpdateFilesRequest.JSON_PROPERTY_MESSAGE, - TemplateUpdateFilesRequest.JSON_PROPERTY_SUBJECT, - TemplateUpdateFilesRequest.JSON_PROPERTY_TEST_MODE + TemplateUpdateFilesRequest.JSON_PROPERTY_CLIENT_ID, + TemplateUpdateFilesRequest.JSON_PROPERTY_FILES, + TemplateUpdateFilesRequest.JSON_PROPERTY_FILE_URLS, + TemplateUpdateFilesRequest.JSON_PROPERTY_MESSAGE, + TemplateUpdateFilesRequest.JSON_PROPERTY_SUBJECT, + TemplateUpdateFilesRequest.JSON_PROPERTY_TEST_MODE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateUpdateFilesRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nullable private String clientId; - - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; - - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public TemplateUpdateFilesRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateUpdateFilesRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateUpdateFilesRequest.class); - } - - public static TemplateUpdateFilesRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateUpdateFilesRequest.class); - } - - public TemplateUpdateFilesRequest clientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Client id of the app you're using to update this template. - * - * @return clientId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - } - - public TemplateUpdateFilesRequest files(@javax.annotation.Nullable List files) { - this.files = files; - return this; - } - - public TemplateUpdateFilesRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public TemplateUpdateFilesRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateUpdateFilesRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateUpdateFilesRequest.class); + } + + static public TemplateUpdateFilesRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateUpdateFilesRequest.class + ); + } + + public TemplateUpdateFilesRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app you're using to update this template. + * @return clientId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public TemplateUpdateFilesRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public TemplateUpdateFilesRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public TemplateUpdateFilesRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public TemplateUpdateFilesRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public TemplateUpdateFilesRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The new default template email message. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public TemplateUpdateFilesRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The new default template email subject. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public TemplateUpdateFilesRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + /** + * Return true if this TemplateUpdateFilesRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateUpdateFilesRequest templateUpdateFilesRequest = (TemplateUpdateFilesRequest) o; + return Objects.equals(this.clientId, templateUpdateFilesRequest.clientId) && + Objects.equals(this.files, templateUpdateFilesRequest.files) && + Objects.equals(this.fileUrls, templateUpdateFilesRequest.fileUrls) && + Objects.equals(this.message, templateUpdateFilesRequest.message) && + Objects.equals(this.subject, templateUpdateFilesRequest.subject) && + Objects.equals(this.testMode, templateUpdateFilesRequest.testMode); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, files, fileUrls, message, subject, testMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateUpdateFilesRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; } - this.files.add(filesItem); - return this; - } - - /** - * Use `files[]` to indicate the uploaded file(s) to use for the template. This - * endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } - public TemplateUpdateFilesRequest fileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public TemplateUpdateFilesRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the - * template. This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - public TemplateUpdateFilesRequest message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The new default template email message. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public TemplateUpdateFilesRequest subject(@javax.annotation.Nullable String subject) { - this.subject = subject; - return this; - } - - /** - * The new default template email subject. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; - } - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } - public TemplateUpdateFilesRequest testMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request created from this draft will not be legally - * binding if set to `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - /** Return true if this TemplateUpdateFilesRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); } - TemplateUpdateFilesRequest templateUpdateFilesRequest = (TemplateUpdateFilesRequest) o; - return Objects.equals(this.clientId, templateUpdateFilesRequest.clientId) - && Objects.equals(this.files, templateUpdateFilesRequest.files) - && Objects.equals(this.fileUrls, templateUpdateFilesRequest.fileUrls) - && Objects.equals(this.message, templateUpdateFilesRequest.message) - && Objects.equals(this.subject, templateUpdateFilesRequest.subject) - && Objects.equals(this.testMode, templateUpdateFilesRequest.testMode); } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(clientId, files, fileUrls, message, subject, testMode); + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateUpdateFilesRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java index be84c8a80..cc741b890 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java @@ -10,161 +10,171 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.TemplateUpdateFilesResponseTemplate; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** TemplateUpdateFilesResponse */ -@JsonPropertyOrder({TemplateUpdateFilesResponse.JSON_PROPERTY_TEMPLATE}) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) -public class TemplateUpdateFilesResponse { - public static final String JSON_PROPERTY_TEMPLATE = "template"; - @javax.annotation.Nonnull private TemplateUpdateFilesResponseTemplate template; - - public TemplateUpdateFilesResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateUpdateFilesResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateUpdateFilesResponse.class); - } - public static TemplateUpdateFilesResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateUpdateFilesResponse.class); - } - - public TemplateUpdateFilesResponse template( - @javax.annotation.Nonnull TemplateUpdateFilesResponseTemplate template) { - this.template = template; - return this; - } - - /** - * Get template - * - * @return template - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TemplateUpdateFilesResponseTemplate getTemplate() { - return template; +import com.dropbox.sign.ApiException; +/** + * TemplateUpdateFilesResponse + */ +@JsonPropertyOrder({ + TemplateUpdateFilesResponse.JSON_PROPERTY_TEMPLATE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateUpdateFilesResponse { + public static final String JSON_PROPERTY_TEMPLATE = "template"; + @javax.annotation.Nonnull + private TemplateUpdateFilesResponseTemplate template; + + public TemplateUpdateFilesResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateUpdateFilesResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateUpdateFilesResponse.class); + } + + static public TemplateUpdateFilesResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateUpdateFilesResponse.class + ); + } + + public TemplateUpdateFilesResponse template(@javax.annotation.Nonnull TemplateUpdateFilesResponseTemplate template) { + this.template = template; + return this; + } + + /** + * Get template + * @return template + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TemplateUpdateFilesResponseTemplate getTemplate() { + return template; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplate(@javax.annotation.Nonnull TemplateUpdateFilesResponseTemplate template) { + this.template = template; + } + + + /** + * Return true if this TemplateUpdateFilesResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplate( - @javax.annotation.Nonnull TemplateUpdateFilesResponseTemplate template) { - this.template = template; + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateUpdateFilesResponse templateUpdateFilesResponse = (TemplateUpdateFilesResponse) o; + return Objects.equals(this.template, templateUpdateFilesResponse.template); + } + + @Override + public int hashCode() { + return Objects.hash(template); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateUpdateFilesResponse {\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (template != null) { + if (isFileTypeOrListOfFiles(template)) { + fileTypeFound = true; + } - /** Return true if this TemplateUpdateFilesResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (template.getClass().equals(java.io.File.class) || + template.getClass().equals(Integer.class) || + template.getClass().equals(String.class) || + template.getClass().isEnum()) { + map.put("template", template); + } else if (isListOfFile(template)) { + for(int i = 0; i< getListSize(template); i++) { + map.put("template[" + i + "]", getFromList(template, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); } - TemplateUpdateFilesResponse templateUpdateFilesResponse = (TemplateUpdateFilesResponse) o; - return Objects.equals(this.template, templateUpdateFilesResponse.template); } - - @Override - public int hashCode() { - return Objects.hash(template); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateUpdateFilesResponse {\n"); - sb.append(" template: ").append(toIndentedString(template)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (template != null) { - if (isFileTypeOrListOfFiles(template)) { - fileTypeFound = true; - } - - if (template.getClass().equals(java.io.File.class) - || template.getClass().equals(Integer.class) - || template.getClass().equals(String.class) - || template.getClass().isEnum()) { - map.put("template", template); - } else if (isListOfFile(template)) { - for (int i = 0; i < getListSize(template); i++) { - map.put("template[" + i + "]", getFromList(template, i)); - } - } else { - map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java index 26fa213ca..65643da3e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java @@ -10,225 +10,237 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** Contains template id */ + +import com.dropbox.sign.ApiException; +/** + * Contains template id + */ @JsonPropertyOrder({ - TemplateUpdateFilesResponseTemplate.JSON_PROPERTY_TEMPLATE_ID, - TemplateUpdateFilesResponseTemplate.JSON_PROPERTY_WARNINGS + TemplateUpdateFilesResponseTemplate.JSON_PROPERTY_TEMPLATE_ID, + TemplateUpdateFilesResponseTemplate.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class TemplateUpdateFilesResponseTemplate { - public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; - @javax.annotation.Nullable private String templateId; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @Deprecated @javax.annotation.Nullable private List warnings = null; - - public TemplateUpdateFilesResponseTemplate() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static TemplateUpdateFilesResponseTemplate init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateUpdateFilesResponseTemplate.class); - } - - public static TemplateUpdateFilesResponseTemplate init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - TemplateUpdateFilesResponseTemplate.class); - } - - public TemplateUpdateFilesResponseTemplate templateId( - @javax.annotation.Nullable String templateId) { - this.templateId = templateId; - return this; - } - - /** - * The id of the Template. - * - * @return templateId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTemplateId() { - return templateId; - } - - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplateId(@javax.annotation.Nullable String templateId) { - this.templateId = templateId; - } - - @Deprecated - public TemplateUpdateFilesResponseTemplate warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public TemplateUpdateFilesResponseTemplate addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + @javax.annotation.Nullable + private String templateId; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @Deprecated + @javax.annotation.Nullable + private List warnings = null; + + public TemplateUpdateFilesResponseTemplate() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateUpdateFilesResponseTemplate init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateUpdateFilesResponseTemplate.class); + } + + static public TemplateUpdateFilesResponseTemplate init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateUpdateFilesResponseTemplate.class + ); + } + + public TemplateUpdateFilesResponseTemplate templateId(@javax.annotation.Nullable String templateId) { + this.templateId = templateId; + return this; + } + + /** + * The id of the Template. + * @return templateId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(@javax.annotation.Nullable String templateId) { + this.templateId = templateId; + } + + + @Deprecated + public TemplateUpdateFilesResponseTemplate warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TemplateUpdateFilesResponseTemplate addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @Deprecated + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this TemplateUpdateFilesResponseTemplate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateUpdateFilesResponseTemplate templateUpdateFilesResponseTemplate = (TemplateUpdateFilesResponseTemplate) o; + return Objects.equals(this.templateId, templateUpdateFilesResponseTemplate.templateId) && + Objects.equals(this.warnings, templateUpdateFilesResponseTemplate.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(templateId, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateUpdateFilesResponseTemplate {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateId != null) { + if (isFileTypeOrListOfFiles(templateId)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @Deprecated - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this TemplateUpdateFilesResponseTemplate object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (templateId.getClass().equals(java.io.File.class) || + templateId.getClass().equals(Integer.class) || + templateId.getClass().equals(String.class) || + templateId.getClass().isEnum()) { + map.put("template_id", templateId); + } else if (isListOfFile(templateId)) { + for(int i = 0; i< getListSize(templateId); i++) { + map.put("template_id[" + i + "]", getFromList(templateId, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); } - TemplateUpdateFilesResponseTemplate templateUpdateFilesResponseTemplate = - (TemplateUpdateFilesResponseTemplate) o; - return Objects.equals(this.templateId, templateUpdateFilesResponseTemplate.templateId) - && Objects.equals(this.warnings, templateUpdateFilesResponseTemplate.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(templateId, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateUpdateFilesResponseTemplate {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { - fileTypeFound = true; - } - - if (templateId.getClass().equals(java.io.File.class) - || templateId.getClass().equals(Integer.class) - || templateId.getClass().equals(String.class) - || templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for (int i = 0; i < getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); - } - } else { - map.put( - "template_id", - JSON.getDefault().getMapper().writeValueAsString(templateId)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java index d3bd9a81d..e9af55410 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java @@ -10,2232 +10,2135 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubAttachment; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubEditorOptions; +import com.dropbox.sign.model.SubFieldOptions; +import com.dropbox.sign.model.SubFormFieldGroup; +import com.dropbox.sign.model.SubFormFieldRule; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.model.SubSigningOptions; +import com.dropbox.sign.model.SubUnclaimedDraftSigner; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** */ + +import com.dropbox.sign.ApiException; +/** + * + */ @JsonPropertyOrder({ - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FILES, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FILE_URLS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_CCS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_DECLINE, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_REASSIGN, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ATTACHMENTS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CUSTOM_FIELDS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_EDITOR_OPTIONS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FIELD_OPTIONS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORCE_SIGNER_PAGE, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_RULES, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_HOLD_REQUEST, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_MESSAGE, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_METADATA, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_REQUESTING_REDIRECT_URL, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SHOW_PREVIEW, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SIGNERS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SIGNING_OPTIONS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SKIP_ME_NOW, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SUBJECT, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_TEST_MODE, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_TYPE, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_USE_TEXT_TAGS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FILES, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FILE_URLS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_CCS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_DECLINE, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_REASSIGN, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ATTACHMENTS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CUSTOM_FIELDS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_EDITOR_OPTIONS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FIELD_OPTIONS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORCE_SIGNER_PAGE, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_RULES, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_HOLD_REQUEST, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_MESSAGE, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_METADATA, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_REQUESTING_REDIRECT_URL, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SHOW_PREVIEW, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SIGNERS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SIGNING_OPTIONS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SKIP_ME_NOW, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SUBJECT, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_TEST_MODE, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_TYPE, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_USE_TEXT_TAGS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class UnclaimedDraftCreateEmbeddedRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nonnull private String clientId; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nonnull + private String clientId; - public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; - @javax.annotation.Nonnull private String requesterEmailAddress; + public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; + @javax.annotation.Nonnull + private String requesterEmailAddress; - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; - public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; - @javax.annotation.Nullable private Boolean allowCcs = true; + public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; + @javax.annotation.Nullable + private Boolean allowCcs = true; - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; - public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; - @javax.annotation.Nullable private Boolean allowFormView = false; + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @javax.annotation.Nullable + private Boolean allowFormView = false; - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - @javax.annotation.Nullable private Boolean allowReassign = false; + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + @javax.annotation.Nullable + private Boolean allowReassign = false; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + @javax.annotation.Nullable + private List attachments = null; + + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + @javax.annotation.Nullable + private List ccEmailAddresses = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - @javax.annotation.Nullable private List attachments = null; + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; + @javax.annotation.Nullable + private SubEditorOptions editorOptions; - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - @javax.annotation.Nullable private List ccEmailAddresses = null; + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + @javax.annotation.Nullable + private SubFieldOptions fieldOptions; - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; + public static final String JSON_PROPERTY_FORCE_SIGNER_PAGE = "force_signer_page"; + @javax.annotation.Nullable + private Boolean forceSignerPage = false; - public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; - @javax.annotation.Nullable private SubEditorOptions editorOptions; + public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; + @javax.annotation.Nullable + private Boolean forceSubjectMessage = false; - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - @javax.annotation.Nullable private SubFieldOptions fieldOptions; + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + @javax.annotation.Nullable + private List formFieldGroups = null; - public static final String JSON_PROPERTY_FORCE_SIGNER_PAGE = "force_signer_page"; - @javax.annotation.Nullable private Boolean forceSignerPage = false; + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + @javax.annotation.Nullable + private List formFieldRules = null; - public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; - @javax.annotation.Nullable private Boolean forceSubjectMessage = false; + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + @javax.annotation.Nullable + private List formFieldsPerDocument = null; - public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - @javax.annotation.Nullable private List formFieldGroups = null; + public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; + @javax.annotation.Nullable + private Boolean hideTextTags = false; - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - @javax.annotation.Nullable private List formFieldRules = null; + public static final String JSON_PROPERTY_HOLD_REQUEST = "hold_request"; + @javax.annotation.Nullable + private Boolean holdRequest = false; - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + public static final String JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING = "is_for_embedded_signing"; + @javax.annotation.Nullable + private Boolean isForEmbeddedSigning = false; - @javax.annotation.Nullable private List formFieldsPerDocument = null; + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; - public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; - @javax.annotation.Nullable private Boolean hideTextTags = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; - public static final String JSON_PROPERTY_HOLD_REQUEST = "hold_request"; - @javax.annotation.Nullable private Boolean holdRequest = false; + public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; + @javax.annotation.Nullable + private String requestingRedirectUrl; - public static final String JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING = "is_for_embedded_signing"; - @javax.annotation.Nullable private Boolean isForEmbeddedSigning = false; + public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; + @javax.annotation.Nullable + private Boolean showPreview; - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; + public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; + @javax.annotation.Nullable + private Boolean showProgressStepper = true; - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nullable + private List signers = null; - public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; - @javax.annotation.Nullable private String requestingRedirectUrl; + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + @javax.annotation.Nullable + private SubSigningOptions signingOptions; - public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; - @javax.annotation.Nullable private Boolean showPreview; + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; - public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; - @javax.annotation.Nullable private Boolean showProgressStepper = true; + public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; + @javax.annotation.Nullable + private Boolean skipMeNow = false; - public static final String JSON_PROPERTY_SIGNERS = "signers"; - @javax.annotation.Nullable private List signers = null; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - @javax.annotation.Nullable private SubSigningOptions signingOptions; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; + /** + * The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. + */ + public enum TypeEnum { + SEND_DOCUMENT(String.valueOf("send_document")), + + REQUEST_SIGNATURE(String.valueOf("request_signature")); - public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; - @javax.annotation.Nullable private Boolean skipMeNow = false; + private String value; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - /** - * The type of the draft. By default this is `request_signature`, but you can set it - * to `send_document` if you want to self sign a document and download it. - */ - public enum TypeEnum { - SEND_DOCUMENT(String.valueOf("send_document")), - - REQUEST_SIGNATURE(String.valueOf("request_signature")); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nullable private TypeEnum type = TypeEnum.REQUEST_SIGNATURE; - - public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; - @javax.annotation.Nullable private Boolean usePreexistingFields = false; - - public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; - @javax.annotation.Nullable private Boolean useTextTags = false; - - public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = - "populate_auto_fill_fields"; - @javax.annotation.Nullable private Boolean populateAutoFillFields = false; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public UnclaimedDraftCreateEmbeddedRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static UnclaimedDraftCreateEmbeddedRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateEmbeddedRequest.class); - } - - public static UnclaimedDraftCreateEmbeddedRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - UnclaimedDraftCreateEmbeddedRequest.class); - } - - public UnclaimedDraftCreateEmbeddedRequest clientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Client id of the app used to create the draft. Used to apply the branding and callback url - * defined for the app. - * - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientId() { - return clientId; + TypeEnum(String value) { + this.value = value; } - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; + @JsonValue + public String getValue() { + return value; } - public UnclaimedDraftCreateEmbeddedRequest requesterEmailAddress( - @javax.annotation.Nonnull String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - return this; - } - - /** - * The email address of the user that should be designated as the requester of this draft, if - * the draft type is `request_signature`. - * - * @return requesterEmailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRequesterEmailAddress() { - return requesterEmailAddress; - } - - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRequesterEmailAddress(@javax.annotation.Nonnull String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - } - - public UnclaimedDraftCreateEmbeddedRequest files(@javax.annotation.Nullable List files) { - this.files = files; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - - /** - * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } - - public UnclaimedDraftCreateEmbeddedRequest fileUrls( - @javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; + @Override + public String toString() { + return String.valueOf(value); } - public UnclaimedDraftCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; } - this.fileUrls.add(fileUrlsItem); - return this; - } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private TypeEnum type = TypeEnum.REQUEST_SIGNATURE; + + public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; + @javax.annotation.Nullable + private Boolean usePreexistingFields = false; + + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + @javax.annotation.Nullable + private Boolean useTextTags = false; + + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = "populate_auto_fill_fields"; + @javax.annotation.Nullable + private Boolean populateAutoFillFields = false; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public UnclaimedDraftCreateEmbeddedRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public UnclaimedDraftCreateEmbeddedRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateEmbeddedRequest.class); + } + + static public UnclaimedDraftCreateEmbeddedRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + UnclaimedDraftCreateEmbeddedRequest.class + ); + } + + public UnclaimedDraftCreateEmbeddedRequest clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public UnclaimedDraftCreateEmbeddedRequest requesterEmailAddress(@javax.annotation.Nonnull String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + return this; + } + + /** + * The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. + * @return requesterEmailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRequesterEmailAddress() { + return requesterEmailAddress; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequesterEmailAddress(@javax.annotation.Nonnull String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + } + + + public UnclaimedDraftCreateEmbeddedRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public UnclaimedDraftCreateEmbeddedRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - * This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } + public UnclaimedDraftCreateEmbeddedRequest allowCcs(@javax.annotation.Nullable Boolean allowCcs) { + this.allowCcs = allowCcs; + return this; + } + + /** + * This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. + * @return allowCcs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowCcs() { + return allowCcs; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowCcs(@javax.annotation.Nullable Boolean allowCcs) { + this.allowCcs = allowCcs; + } + + + public UnclaimedDraftCreateEmbeddedRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public UnclaimedDraftCreateEmbeddedRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. + * @return allowFormView + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + public UnclaimedDraftCreateEmbeddedRequest allowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } + + /** + * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + * @return allowReassign + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowReassign() { + return allowReassign; + } - public UnclaimedDraftCreateEmbeddedRequest allowCcs( - @javax.annotation.Nullable Boolean allowCcs) { - this.allowCcs = allowCcs; - return this; - } - /** - * This allows the requester to specify whether the user is allowed to provide email addresses - * to CC when claiming the draft. - * - * @return allowCcs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowCcs() { - return allowCcs; + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + } + + + public UnclaimedDraftCreateEmbeddedRequest attachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * A list describing the attachments + * @return attachments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + } + + + public UnclaimedDraftCreateEmbeddedRequest ccEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } + + /** + * The email addresses that should be CCed. + * @return ccEmailAddresses + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } + + + public UnclaimedDraftCreateEmbeddedRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } - @JsonProperty(JSON_PROPERTY_ALLOW_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowCcs(@javax.annotation.Nullable Boolean allowCcs) { - this.allowCcs = allowCcs; - } - public UnclaimedDraftCreateEmbeddedRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } + public UnclaimedDraftCreateEmbeddedRequest editorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + return this; + } + + /** + * Get editorOptions + * @return editorOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubEditorOptions getEditorOptions() { + return editorOptions; + } + + + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + } + + + public UnclaimedDraftCreateEmbeddedRequest fieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * @return fieldOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } + + + public UnclaimedDraftCreateEmbeddedRequest forceSignerPage(@javax.annotation.Nullable Boolean forceSignerPage) { + this.forceSignerPage = forceSignerPage; + return this; + } + + /** + * Provide users the ability to review/edit the signers. + * @return forceSignerPage + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getForceSignerPage() { + return forceSignerPage; + } + + + @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSignerPage(@javax.annotation.Nullable Boolean forceSignerPage) { + this.forceSignerPage = forceSignerPage; + } + + + public UnclaimedDraftCreateEmbeddedRequest forceSubjectMessage(@javax.annotation.Nullable Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + return this; + } + + /** + * Provide users the ability to review/edit the subject and message. + * @return forceSubjectMessage + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getForceSubjectMessage() { + return forceSubjectMessage; + } - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; - } - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; + @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSubjectMessage(@javax.annotation.Nullable Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + } + + + public UnclaimedDraftCreateEmbeddedRequest formFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); + } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } + + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * @return formFieldGroups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldGroups() { + return formFieldGroups; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + + public UnclaimedDraftCreateEmbeddedRequest formFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); } + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * @return formFieldRules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldRules() { + return formFieldRules; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + + public UnclaimedDraftCreateEmbeddedRequest formFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; + } + + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * @return formFieldsPerDocument + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } - public UnclaimedDraftCreateEmbeddedRequest allowFormView( - @javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - return this; - } - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to - * `false`. - * - * @return allowFormView - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowFormView() { - return allowFormView; - } + public UnclaimedDraftCreateEmbeddedRequest hideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; + } + + /** + * Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. + * @return hideTextTags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHideTextTags() { + return hideTextTags; + } + + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + } + + + public UnclaimedDraftCreateEmbeddedRequest holdRequest(@javax.annotation.Nullable Boolean holdRequest) { + this.holdRequest = holdRequest; + return this; + } + + /** + * The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. + * @return holdRequest + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHoldRequest() { + return holdRequest; + } + + + @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHoldRequest(@javax.annotation.Nullable Boolean holdRequest) { + this.holdRequest = holdRequest; + } + + + public UnclaimedDraftCreateEmbeddedRequest isForEmbeddedSigning(@javax.annotation.Nullable Boolean isForEmbeddedSigning) { + this.isForEmbeddedSigning = isForEmbeddedSigning; + return this; + } + + /** + * The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. + * @return isForEmbeddedSigning + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsForEmbeddedSigning() { + return isForEmbeddedSigning; + } + + + @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsForEmbeddedSigning(@javax.annotation.Nullable Boolean isForEmbeddedSigning) { + this.isForEmbeddedSigning = isForEmbeddedSigning; + } + + + public UnclaimedDraftCreateEmbeddedRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - } + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public UnclaimedDraftCreateEmbeddedRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } - public UnclaimedDraftCreateEmbeddedRequest allowReassign( - @javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - return this; - } + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public UnclaimedDraftCreateEmbeddedRequest requestingRedirectUrl(@javax.annotation.Nullable String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully request a signature. + * @return requestingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRequestingRedirectUrl() { + return requestingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestingRedirectUrl(@javax.annotation.Nullable String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + } + + + public UnclaimedDraftCreateEmbeddedRequest showPreview(@javax.annotation.Nullable Boolean showPreview) { + this.showPreview = showPreview; + return this; + } + + /** + * This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. + * @return showPreview + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getShowPreview() { + return showPreview; + } + + + @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowPreview(@javax.annotation.Nullable Boolean showPreview) { + this.showPreview = showPreview; + } + + + public UnclaimedDraftCreateEmbeddedRequest showProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + return this; + } + + /** + * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. + * @return showProgressStepper + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getShowProgressStepper() { + return showProgressStepper; + } + + + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + } + + + public UnclaimedDraftCreateEmbeddedRequest signers(@javax.annotation.Nullable List signers) { + this.signers = signers; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest addSignersItem(SubUnclaimedDraftSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } - /** - * Allows signers to reassign their signature requests to other signers if set to - * `true`. Defaults to `false`. **NOTE:** Only available for Premium plan - * and higher. - * - * @return allowReassign - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowReassign() { - return allowReassign; - } + /** + * Add Signers to your Unclaimed Draft Signature Request. + * @return signers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(@javax.annotation.Nullable List signers) { + this.signers = signers; + } + + + public UnclaimedDraftCreateEmbeddedRequest signingOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - } + /** + * Get signingOptions + * @return signingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public UnclaimedDraftCreateEmbeddedRequest signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } - public UnclaimedDraftCreateEmbeddedRequest attachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; - return this; - } + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public UnclaimedDraftCreateEmbeddedRequest skipMeNow(@javax.annotation.Nullable Boolean skipMeNow) { + this.skipMeNow = skipMeNow; + return this; + } - public UnclaimedDraftCreateEmbeddedRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); + /** + * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. + * @return skipMeNow + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSkipMeNow() { + return skipMeNow; + } + + + @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipMeNow(@javax.annotation.Nullable Boolean skipMeNow) { + this.skipMeNow = skipMeNow; + } + + + public UnclaimedDraftCreateEmbeddedRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public UnclaimedDraftCreateEmbeddedRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public UnclaimedDraftCreateEmbeddedRequest type(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + } + + + public UnclaimedDraftCreateEmbeddedRequest usePreexistingFields(@javax.annotation.Nullable Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + return this; + } + + /** + * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. + * @return usePreexistingFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUsePreexistingFields() { + return usePreexistingFields; + } + + + @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsePreexistingFields(@javax.annotation.Nullable Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + } + + + public UnclaimedDraftCreateEmbeddedRequest useTextTags(@javax.annotation.Nullable Boolean useTextTags) { + this.useTextTags = useTextTags; + return this; + } + + /** + * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. + * @return useTextTags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseTextTags() { + return useTextTags; + } + + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(@javax.annotation.Nullable Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + + public UnclaimedDraftCreateEmbeddedRequest populateAutoFillFields(@javax.annotation.Nullable Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + return this; + } + + /** + * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + * @return populateAutoFillFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(@javax.annotation.Nullable Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + + public UnclaimedDraftCreateEmbeddedRequest expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this UnclaimedDraftCreateEmbeddedRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest = (UnclaimedDraftCreateEmbeddedRequest) o; + return Objects.equals(this.clientId, unclaimedDraftCreateEmbeddedRequest.clientId) && + Objects.equals(this.requesterEmailAddress, unclaimedDraftCreateEmbeddedRequest.requesterEmailAddress) && + Objects.equals(this.files, unclaimedDraftCreateEmbeddedRequest.files) && + Objects.equals(this.fileUrls, unclaimedDraftCreateEmbeddedRequest.fileUrls) && + Objects.equals(this.allowCcs, unclaimedDraftCreateEmbeddedRequest.allowCcs) && + Objects.equals(this.allowDecline, unclaimedDraftCreateEmbeddedRequest.allowDecline) && + Objects.equals(this.allowFormView, unclaimedDraftCreateEmbeddedRequest.allowFormView) && + Objects.equals(this.allowReassign, unclaimedDraftCreateEmbeddedRequest.allowReassign) && + Objects.equals(this.attachments, unclaimedDraftCreateEmbeddedRequest.attachments) && + Objects.equals(this.ccEmailAddresses, unclaimedDraftCreateEmbeddedRequest.ccEmailAddresses) && + Objects.equals(this.customFields, unclaimedDraftCreateEmbeddedRequest.customFields) && + Objects.equals(this.editorOptions, unclaimedDraftCreateEmbeddedRequest.editorOptions) && + Objects.equals(this.fieldOptions, unclaimedDraftCreateEmbeddedRequest.fieldOptions) && + Objects.equals(this.forceSignerPage, unclaimedDraftCreateEmbeddedRequest.forceSignerPage) && + Objects.equals(this.forceSubjectMessage, unclaimedDraftCreateEmbeddedRequest.forceSubjectMessage) && + Objects.equals(this.formFieldGroups, unclaimedDraftCreateEmbeddedRequest.formFieldGroups) && + Objects.equals(this.formFieldRules, unclaimedDraftCreateEmbeddedRequest.formFieldRules) && + Objects.equals(this.formFieldsPerDocument, unclaimedDraftCreateEmbeddedRequest.formFieldsPerDocument) && + Objects.equals(this.hideTextTags, unclaimedDraftCreateEmbeddedRequest.hideTextTags) && + Objects.equals(this.holdRequest, unclaimedDraftCreateEmbeddedRequest.holdRequest) && + Objects.equals(this.isForEmbeddedSigning, unclaimedDraftCreateEmbeddedRequest.isForEmbeddedSigning) && + Objects.equals(this.message, unclaimedDraftCreateEmbeddedRequest.message) && + Objects.equals(this.metadata, unclaimedDraftCreateEmbeddedRequest.metadata) && + Objects.equals(this.requestingRedirectUrl, unclaimedDraftCreateEmbeddedRequest.requestingRedirectUrl) && + Objects.equals(this.showPreview, unclaimedDraftCreateEmbeddedRequest.showPreview) && + Objects.equals(this.showProgressStepper, unclaimedDraftCreateEmbeddedRequest.showProgressStepper) && + Objects.equals(this.signers, unclaimedDraftCreateEmbeddedRequest.signers) && + Objects.equals(this.signingOptions, unclaimedDraftCreateEmbeddedRequest.signingOptions) && + Objects.equals(this.signingRedirectUrl, unclaimedDraftCreateEmbeddedRequest.signingRedirectUrl) && + Objects.equals(this.skipMeNow, unclaimedDraftCreateEmbeddedRequest.skipMeNow) && + Objects.equals(this.subject, unclaimedDraftCreateEmbeddedRequest.subject) && + Objects.equals(this.testMode, unclaimedDraftCreateEmbeddedRequest.testMode) && + Objects.equals(this.type, unclaimedDraftCreateEmbeddedRequest.type) && + Objects.equals(this.usePreexistingFields, unclaimedDraftCreateEmbeddedRequest.usePreexistingFields) && + Objects.equals(this.useTextTags, unclaimedDraftCreateEmbeddedRequest.useTextTags) && + Objects.equals(this.populateAutoFillFields, unclaimedDraftCreateEmbeddedRequest.populateAutoFillFields) && + Objects.equals(this.expiresAt, unclaimedDraftCreateEmbeddedRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, requesterEmailAddress, files, fileUrls, allowCcs, allowDecline, allowFormView, allowReassign, attachments, ccEmailAddresses, customFields, editorOptions, fieldOptions, forceSignerPage, forceSubjectMessage, formFieldGroups, formFieldRules, formFieldsPerDocument, hideTextTags, holdRequest, isForEmbeddedSigning, message, metadata, requestingRedirectUrl, showPreview, showProgressStepper, signers, signingOptions, signingRedirectUrl, skipMeNow, subject, testMode, type, usePreexistingFields, useTextTags, populateAutoFillFields, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnclaimedDraftCreateEmbeddedRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" requesterEmailAddress: ").append(toIndentedString(requesterEmailAddress)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" allowCcs: ").append(toIndentedString(allowCcs)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" forceSignerPage: ").append(toIndentedString(forceSignerPage)).append("\n"); + sb.append(" forceSubjectMessage: ").append(toIndentedString(forceSubjectMessage)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" holdRequest: ").append(toIndentedString(holdRequest)).append("\n"); + sb.append(" isForEmbeddedSigning: ").append(toIndentedString(isForEmbeddedSigning)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" requestingRedirectUrl: ").append(toIndentedString(requestingRedirectUrl)).append("\n"); + sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); + sb.append(" showProgressStepper: ").append(toIndentedString(showProgressStepper)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" skipMeNow: ").append(toIndentedString(skipMeNow)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" usePreexistingFields: ").append(toIndentedString(usePreexistingFields)).append("\n"); + sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * - * @return attachments - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAttachments() { - return attachments; - } - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(@javax.annotation.Nullable List attachments) { - this.attachments = attachments; - } - - public UnclaimedDraftCreateEmbeddedRequest ccEmailAddresses( - @javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - public UnclaimedDraftCreateEmbeddedRequest addCcEmailAddressesItem( - String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } } - this.ccEmailAddresses.add(ccEmailAddressesItem); - return this; - } - - /** - * The email addresses that should be CCed. - * - * @return ccEmailAddresses - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } - - public UnclaimedDraftCreateEmbeddedRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addCustomFieldsItem( - SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); } - this.customFields.add(customFieldsItem); - return this; } - - /** - * When used together with merge fields, `custom_fields` allows users to add - * pre-filled data to their signature requests. Pre-filled data can be used with - * \"send-once\" signature requests by adding merge fields with - * `form_fields_per_document` or [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values - * back with `custom_fields` together in one API call. For using pre-filled on - * repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or - * by calling - * [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and - * then passing `custom_fields` on subsequent signature requests referencing that - * template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public UnclaimedDraftCreateEmbeddedRequest editorOptions( - @javax.annotation.Nullable SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - return this; - } - - /** - * Get editorOptions - * - * @return editorOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubEditorOptions getEditorOptions() { - return editorOptions; - } - - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - } - - public UnclaimedDraftCreateEmbeddedRequest fieldOptions( - @javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * - * @return fieldOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - public UnclaimedDraftCreateEmbeddedRequest forceSignerPage( - @javax.annotation.Nullable Boolean forceSignerPage) { - this.forceSignerPage = forceSignerPage; - return this; - } - - /** - * Provide users the ability to review/edit the signers. - * - * @return forceSignerPage - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_PAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getForceSignerPage() { - return forceSignerPage; - } - - @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_PAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSignerPage(@javax.annotation.Nullable Boolean forceSignerPage) { - this.forceSignerPage = forceSignerPage; - } - - public UnclaimedDraftCreateEmbeddedRequest forceSubjectMessage( - @javax.annotation.Nullable Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - return this; - } - - /** - * Provide users the ability to review/edit the subject and message. - * - * @return forceSubjectMessage - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getForceSubjectMessage() { - return forceSubjectMessage; - } - - @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSubjectMessage(@javax.annotation.Nullable Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - } - - public UnclaimedDraftCreateEmbeddedRequest formFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addFormFieldGroupsItem( - SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); + if (requesterEmailAddress != null) { + if (isFileTypeOrListOfFiles(requesterEmailAddress)) { + fileTypeFound = true; } - this.formFieldGroups.add(formFieldGroupsItem); - return this; - } - - /** - * Group information for fields defined in `form_fields_per_document`. String-indexed - * JSON array with `group_label` and `requirement` keys. - * `form_fields_per_document` must contain fields referencing a group defined in - * `form_field_groups`. - * - * @return formFieldGroups - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldGroups() { - return formFieldGroups; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - public UnclaimedDraftCreateEmbeddedRequest formFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addFormFieldRulesItem( - SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); + if (requesterEmailAddress.getClass().equals(java.io.File.class) || + requesterEmailAddress.getClass().equals(Integer.class) || + requesterEmailAddress.getClass().equals(String.class) || + requesterEmailAddress.getClass().isEnum()) { + map.put("requester_email_address", requesterEmailAddress); + } else if (isListOfFile(requesterEmailAddress)) { + for(int i = 0; i< getListSize(requesterEmailAddress); i++) { + map.put("requester_email_address[" + i + "]", getFromList(requesterEmailAddress, i)); + } } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * - * @return formFieldRules - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldRules() { - return formFieldRules; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - public UnclaimedDraftCreateEmbeddedRequest formFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addFormFieldsPerDocumentItem( - SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); + else { + map.put("requester_email_address", JSON.getDefault().getMapper().writeValueAsString(requesterEmailAddress)); } - this.formFieldsPerDocument.add(formFieldsPerDocumentItem); - return this; - } - - /** - * The fields that should appear on the document, expressed as an array of objects. (For more - * details you can read about it here: [Using Form Fields per - * Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, - * **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and - * optional parameters. Check out the list of [additional - * parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text - * Field use `SubFormFieldsPerDocumentText` * Dropdown Field use - * `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use - * `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use - * `SubFormFieldsPerDocumentCheckbox` * Radio Field use - * `SubFormFieldsPerDocumentRadio` * Signature Field use - * `SubFormFieldsPerDocumentSignature` * Date Signed Field use - * `SubFormFieldsPerDocumentDateSigned` * Initials Field use - * `SubFormFieldsPerDocumentInitials` * Text Merge Field use - * `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use - * `SubFormFieldsPerDocumentCheckboxMerge` - * - * @return formFieldsPerDocument - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; } - - public UnclaimedDraftCreateEmbeddedRequest hideTextTags( - @javax.annotation.Nullable Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - return this; - } - - /** - * Send with a value of `true` if you wish to enable automatic Text Tag removal. - * Defaults to `false`. When using Text Tags it is preferred that you set this to - * `false` and hide your tags with white text or something similar because the - * automatic removal system can cause unwanted clipping. See the [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more - * details. - * - * @return hideTextTags - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHideTextTags() { - return hideTextTags; - } - - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - } - - public UnclaimedDraftCreateEmbeddedRequest holdRequest( - @javax.annotation.Nullable Boolean holdRequest) { - this.holdRequest = holdRequest; - return this; - } - - /** - * The request from this draft will not automatically send to signers post-claim if set to - * `true`. Requester must - * [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when - * ready to send. Defaults to `false`. - * - * @return holdRequest - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHoldRequest() { - return holdRequest; - } - - @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHoldRequest(@javax.annotation.Nullable Boolean holdRequest) { - this.holdRequest = holdRequest; - } - - public UnclaimedDraftCreateEmbeddedRequest isForEmbeddedSigning( - @javax.annotation.Nullable Boolean isForEmbeddedSigning) { - this.isForEmbeddedSigning = isForEmbeddedSigning; - return this; - } - - /** - * The request created from this draft will also be signable in embedded mode if set to - * `true`. Defaults to `false`. - * - * @return isForEmbeddedSigning - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsForEmbeddedSigning() { - return isForEmbeddedSigning; - } - - @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsForEmbeddedSigning(@javax.annotation.Nullable Boolean isForEmbeddedSigning) { - this.isForEmbeddedSigning = isForEmbeddedSigning; - } - - public UnclaimedDraftCreateEmbeddedRequest message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public UnclaimedDraftCreateEmbeddedRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public UnclaimedDraftCreateEmbeddedRequest requestingRedirectUrl( - @javax.annotation.Nullable String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully request a signature. - * - * @return requestingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRequestingRedirectUrl() { - return requestingRedirectUrl; - } - - @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequestingRedirectUrl(@javax.annotation.Nullable String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - } - - public UnclaimedDraftCreateEmbeddedRequest showPreview( - @javax.annotation.Nullable Boolean showPreview) { - this.showPreview = showPreview; - return this; - } - - /** - * This allows the requester to enable the editor/preview experience. - - * `show_preview=true`: Allows requesters to enable the editor/preview - * experience. - `show_preview=false`: Allows requesters to disable the - * editor/preview experience. - * - * @return showPreview - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getShowPreview() { - return showPreview; - } - - @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowPreview(@javax.annotation.Nullable Boolean showPreview) { - this.showPreview = showPreview; - } - - public UnclaimedDraftCreateEmbeddedRequest showProgressStepper( - @javax.annotation.Nullable Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - return this; - } - - /** - * When only one step remains in the signature request process and this parameter is set to - * `false` then the progress stepper will be hidden. - * - * @return showProgressStepper - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getShowProgressStepper() { - return showProgressStepper; - } - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - } - - public UnclaimedDraftCreateEmbeddedRequest signers( - @javax.annotation.Nullable List signers) { - this.signers = signers; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addSignersItem(SubUnclaimedDraftSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); } - this.signers.add(signersItem); - return this; } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } - /** - * Add Signers to your Unclaimed Draft Signature Request. - * - * @return signers - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSigners() { - return signers; + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } } + if (allowCcs != null) { + if (isFileTypeOrListOfFiles(allowCcs)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners(@javax.annotation.Nullable List signers) { - this.signers = signers; + if (allowCcs.getClass().equals(java.io.File.class) || + allowCcs.getClass().equals(Integer.class) || + allowCcs.getClass().equals(String.class) || + allowCcs.getClass().isEnum()) { + map.put("allow_ccs", allowCcs); + } else if (isListOfFile(allowCcs)) { + for(int i = 0; i< getListSize(allowCcs); i++) { + map.put("allow_ccs[" + i + "]", getFromList(allowCcs, i)); + } + } + else { + map.put("allow_ccs", JSON.getDefault().getMapper().writeValueAsString(allowCcs)); + } } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedRequest signingOptions( - @javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } - /** - * Get signingOptions - * - * @return signingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubSigningOptions getSigningOptions() { - return signingOptions; + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; + if (allowReassign.getClass().equals(java.io.File.class) || + allowReassign.getClass().equals(Integer.class) || + allowReassign.getClass().equals(String.class) || + allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for(int i = 0; i< getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } + else { + map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedRequest signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + } } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } - /** - * The URL you want signers redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; + if (ccEmailAddresses.getClass().equals(java.io.File.class) || + ccEmailAddresses.getClass().equals(Integer.class) || + ccEmailAddresses.getClass().equals(String.class) || + ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for(int i = 0; i< getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } + else { + map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (editorOptions != null) { + if (isFileTypeOrListOfFiles(editorOptions)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedRequest skipMeNow( - @javax.annotation.Nullable Boolean skipMeNow) { - this.skipMeNow = skipMeNow; - return this; + if (editorOptions.getClass().equals(java.io.File.class) || + editorOptions.getClass().equals(Integer.class) || + editorOptions.getClass().equals(String.class) || + editorOptions.getClass().isEnum()) { + map.put("editor_options", editorOptions); + } else if (isListOfFile(editorOptions)) { + for(int i = 0; i< getListSize(editorOptions); i++) { + map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); + } + } + else { + map.put("editor_options", JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + } } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } - /** - * Disables the \"Me (Now)\" option for the person preparing the document. Does not - * work with type `send_document`. Defaults to `false`. - * - * @return skipMeNow - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getSkipMeNow() { - return skipMeNow; + if (fieldOptions.getClass().equals(java.io.File.class) || + fieldOptions.getClass().equals(Integer.class) || + fieldOptions.getClass().equals(String.class) || + fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for(int i = 0; i< getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } + else { + map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } } + if (forceSignerPage != null) { + if (isFileTypeOrListOfFiles(forceSignerPage)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSkipMeNow(@javax.annotation.Nullable Boolean skipMeNow) { - this.skipMeNow = skipMeNow; + if (forceSignerPage.getClass().equals(java.io.File.class) || + forceSignerPage.getClass().equals(Integer.class) || + forceSignerPage.getClass().equals(String.class) || + forceSignerPage.getClass().isEnum()) { + map.put("force_signer_page", forceSignerPage); + } else if (isListOfFile(forceSignerPage)) { + for(int i = 0; i< getListSize(forceSignerPage); i++) { + map.put("force_signer_page[" + i + "]", getFromList(forceSignerPage, i)); + } + } + else { + map.put("force_signer_page", JSON.getDefault().getMapper().writeValueAsString(forceSignerPage)); + } } + if (forceSubjectMessage != null) { + if (isFileTypeOrListOfFiles(forceSubjectMessage)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedRequest subject(@javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (forceSubjectMessage.getClass().equals(java.io.File.class) || + forceSubjectMessage.getClass().equals(Integer.class) || + forceSubjectMessage.getClass().equals(String.class) || + forceSubjectMessage.getClass().isEnum()) { + map.put("force_subject_message", forceSubjectMessage); + } else if (isListOfFile(forceSubjectMessage)) { + for(int i = 0; i< getListSize(forceSubjectMessage); i++) { + map.put("force_subject_message[" + i + "]", getFromList(forceSubjectMessage, i)); + } + } + else { + map.put("force_subject_message", JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); + } } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (formFieldGroups.getClass().equals(java.io.File.class) || + formFieldGroups.getClass().equals(Integer.class) || + formFieldGroups.getClass().equals(String.class) || + formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for(int i = 0; i< getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } + else { + map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (formFieldRules.getClass().equals(java.io.File.class) || + formFieldRules.getClass().equals(Integer.class) || + formFieldRules.getClass().equals(String.class) || + formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for(int i = 0; i< getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } + else { + map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedRequest testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (formFieldsPerDocument.getClass().equals(java.io.File.class) || + formFieldsPerDocument.getClass().equals(Integer.class) || + formFieldsPerDocument.getClass().equals(String.class) || + formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { + map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); + } + } + else { + map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); + } } + if (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request created from this draft will not be legally - * binding if set to `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (hideTextTags.getClass().equals(java.io.File.class) || + hideTextTags.getClass().equals(Integer.class) || + hideTextTags.getClass().equals(String.class) || + hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for(int i = 0; i< getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } + else { + map.put("hide_text_tags", JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } } + if (holdRequest != null) { + if (isFileTypeOrListOfFiles(holdRequest)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (holdRequest.getClass().equals(java.io.File.class) || + holdRequest.getClass().equals(Integer.class) || + holdRequest.getClass().equals(String.class) || + holdRequest.getClass().isEnum()) { + map.put("hold_request", holdRequest); + } else if (isListOfFile(holdRequest)) { + for(int i = 0; i< getListSize(holdRequest); i++) { + map.put("hold_request[" + i + "]", getFromList(holdRequest, i)); + } + } + else { + map.put("hold_request", JSON.getDefault().getMapper().writeValueAsString(holdRequest)); + } } + if (isForEmbeddedSigning != null) { + if (isFileTypeOrListOfFiles(isForEmbeddedSigning)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedRequest type(@javax.annotation.Nullable TypeEnum type) { - this.type = type; - return this; + if (isForEmbeddedSigning.getClass().equals(java.io.File.class) || + isForEmbeddedSigning.getClass().equals(Integer.class) || + isForEmbeddedSigning.getClass().equals(String.class) || + isForEmbeddedSigning.getClass().isEnum()) { + map.put("is_for_embedded_signing", isForEmbeddedSigning); + } else if (isListOfFile(isForEmbeddedSigning)) { + for(int i = 0; i< getListSize(isForEmbeddedSigning); i++) { + map.put("is_for_embedded_signing[" + i + "]", getFromList(isForEmbeddedSigning, i)); + } + } + else { + map.put("is_for_embedded_signing", JSON.getDefault().getMapper().writeValueAsString(isForEmbeddedSigning)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - /** - * The type of the draft. By default this is `request_signature`, but you can set it - * to `send_document` if you want to self sign a document and download it. - * - * @return type - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TypeEnum getType() { - return type; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(@javax.annotation.Nullable TypeEnum type) { - this.type = type; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (requestingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedRequest usePreexistingFields( - @javax.annotation.Nullable Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; - return this; + if (requestingRedirectUrl.getClass().equals(java.io.File.class) || + requestingRedirectUrl.getClass().equals(Integer.class) || + requestingRedirectUrl.getClass().equals(String.class) || + requestingRedirectUrl.getClass().isEnum()) { + map.put("requesting_redirect_url", requestingRedirectUrl); + } else if (isListOfFile(requestingRedirectUrl)) { + for(int i = 0; i< getListSize(requestingRedirectUrl); i++) { + map.put("requesting_redirect_url[" + i + "]", getFromList(requestingRedirectUrl, i)); + } + } + else { + map.put("requesting_redirect_url", JSON.getDefault().getMapper().writeValueAsString(requestingRedirectUrl)); + } } + if (showPreview != null) { + if (isFileTypeOrListOfFiles(showPreview)) { + fileTypeFound = true; + } - /** - * Set `use_text_tags` to `true` to enable [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your - * document (defaults to disabled, or `false`). Alternatively, if your PDF contains - * pre-defined fields, enable the detection of these fields by setting the - * `use_preexisting_fields` to `true` (defaults to disabled, or - * `false`). Currently we only support use of either `use_text_tags` or - * `use_preexisting_fields` parameter, not both. - * - * @return usePreexistingFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getUsePreexistingFields() { - return usePreexistingFields; + if (showPreview.getClass().equals(java.io.File.class) || + showPreview.getClass().equals(Integer.class) || + showPreview.getClass().equals(String.class) || + showPreview.getClass().isEnum()) { + map.put("show_preview", showPreview); + } else if (isListOfFile(showPreview)) { + for(int i = 0; i< getListSize(showPreview); i++) { + map.put("show_preview[" + i + "]", getFromList(showPreview, i)); + } + } + else { + map.put("show_preview", JSON.getDefault().getMapper().writeValueAsString(showPreview)); + } } + if (showProgressStepper != null) { + if (isFileTypeOrListOfFiles(showProgressStepper)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsePreexistingFields(@javax.annotation.Nullable Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; + if (showProgressStepper.getClass().equals(java.io.File.class) || + showProgressStepper.getClass().equals(Integer.class) || + showProgressStepper.getClass().equals(String.class) || + showProgressStepper.getClass().isEnum()) { + map.put("show_progress_stepper", showProgressStepper); + } else if (isListOfFile(showProgressStepper)) { + for(int i = 0; i< getListSize(showProgressStepper); i++) { + map.put("show_progress_stepper[" + i + "]", getFromList(showProgressStepper, i)); + } + } + else { + map.put("show_progress_stepper", JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + } } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedRequest useTextTags( - @javax.annotation.Nullable Boolean useTextTags) { - this.useTextTags = useTextTags; - return this; + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } - /** - * Set `use_text_tags` to `true` to enable [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your - * document (defaults to disabled, or `false`). Alternatively, if your PDF contains - * pre-defined fields, enable the detection of these fields by setting the - * `use_preexisting_fields` to `true` (defaults to disabled, or - * `false`). Currently we only support use of either `use_text_tags` or - * `use_preexisting_fields` parameter, not both. - * - * @return useTextTags - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getUseTextTags() { - return useTextTags; + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUseTextTags(@javax.annotation.Nullable Boolean useTextTags) { - this.useTextTags = useTextTags; + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } } + if (skipMeNow != null) { + if (isFileTypeOrListOfFiles(skipMeNow)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedRequest populateAutoFillFields( - @javax.annotation.Nullable Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; - return this; + if (skipMeNow.getClass().equals(java.io.File.class) || + skipMeNow.getClass().equals(Integer.class) || + skipMeNow.getClass().equals(String.class) || + skipMeNow.getClass().isEnum()) { + map.put("skip_me_now", skipMeNow); + } else if (isListOfFile(skipMeNow)) { + for(int i = 0; i< getListSize(skipMeNow); i++) { + map.put("skip_me_now[" + i + "]", getFromList(skipMeNow, i)); + } + } + else { + map.put("skip_me_now", JSON.getDefault().getMapper().writeValueAsString(skipMeNow)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - /** - * Controls whether [auto fill - * fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can - * automatically populate a signer's information during signing. **NOTE:** Keep your - * signer's information safe by ensuring that the _signer on your signature request is the - * intended party_ before using this feature. - * - * @return populateAutoFillFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPopulateAutoFillFields() { - return populateAutoFillFields; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPopulateAutoFillFields( - @javax.annotation.Nullable Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedRequest expiresAt( - @javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (usePreexistingFields != null) { + if (isFileTypeOrListOfFiles(usePreexistingFields)) { + fileTypeFound = true; + } - /** - * When the signature request will expire. Unsigned signatures will be moved to the expired - * status, and no longer signable. See [Signature Request Expiration - * Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. - * **NOTE:** This does not correspond to the **expires_at** returned in the response. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; + if (usePreexistingFields.getClass().equals(java.io.File.class) || + usePreexistingFields.getClass().equals(Integer.class) || + usePreexistingFields.getClass().equals(String.class) || + usePreexistingFields.getClass().isEnum()) { + map.put("use_preexisting_fields", usePreexistingFields); + } else if (isListOfFile(usePreexistingFields)) { + for(int i = 0; i< getListSize(usePreexistingFields); i++) { + map.put("use_preexisting_fields[" + i + "]", getFromList(usePreexistingFields, i)); + } + } + else { + map.put("use_preexisting_fields", JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); + } } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; + if (useTextTags.getClass().equals(java.io.File.class) || + useTextTags.getClass().equals(Integer.class) || + useTextTags.getClass().equals(String.class) || + useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for(int i = 0; i< getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } + else { + map.put("use_text_tags", JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } - /** Return true if this UnclaimedDraftCreateEmbeddedRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest = - (UnclaimedDraftCreateEmbeddedRequest) o; - return Objects.equals(this.clientId, unclaimedDraftCreateEmbeddedRequest.clientId) - && Objects.equals( - this.requesterEmailAddress, - unclaimedDraftCreateEmbeddedRequest.requesterEmailAddress) - && Objects.equals(this.files, unclaimedDraftCreateEmbeddedRequest.files) - && Objects.equals(this.fileUrls, unclaimedDraftCreateEmbeddedRequest.fileUrls) - && Objects.equals(this.allowCcs, unclaimedDraftCreateEmbeddedRequest.allowCcs) - && Objects.equals( - this.allowDecline, unclaimedDraftCreateEmbeddedRequest.allowDecline) - && Objects.equals( - this.allowFormView, unclaimedDraftCreateEmbeddedRequest.allowFormView) - && Objects.equals( - this.allowReassign, unclaimedDraftCreateEmbeddedRequest.allowReassign) - && Objects.equals(this.attachments, unclaimedDraftCreateEmbeddedRequest.attachments) - && Objects.equals( - this.ccEmailAddresses, unclaimedDraftCreateEmbeddedRequest.ccEmailAddresses) - && Objects.equals( - this.customFields, unclaimedDraftCreateEmbeddedRequest.customFields) - && Objects.equals( - this.editorOptions, unclaimedDraftCreateEmbeddedRequest.editorOptions) - && Objects.equals( - this.fieldOptions, unclaimedDraftCreateEmbeddedRequest.fieldOptions) - && Objects.equals( - this.forceSignerPage, unclaimedDraftCreateEmbeddedRequest.forceSignerPage) - && Objects.equals( - this.forceSubjectMessage, - unclaimedDraftCreateEmbeddedRequest.forceSubjectMessage) - && Objects.equals( - this.formFieldGroups, unclaimedDraftCreateEmbeddedRequest.formFieldGroups) - && Objects.equals( - this.formFieldRules, unclaimedDraftCreateEmbeddedRequest.formFieldRules) - && Objects.equals( - this.formFieldsPerDocument, - unclaimedDraftCreateEmbeddedRequest.formFieldsPerDocument) - && Objects.equals( - this.hideTextTags, unclaimedDraftCreateEmbeddedRequest.hideTextTags) - && Objects.equals(this.holdRequest, unclaimedDraftCreateEmbeddedRequest.holdRequest) - && Objects.equals( - this.isForEmbeddedSigning, - unclaimedDraftCreateEmbeddedRequest.isForEmbeddedSigning) - && Objects.equals(this.message, unclaimedDraftCreateEmbeddedRequest.message) - && Objects.equals(this.metadata, unclaimedDraftCreateEmbeddedRequest.metadata) - && Objects.equals( - this.requestingRedirectUrl, - unclaimedDraftCreateEmbeddedRequest.requestingRedirectUrl) - && Objects.equals(this.showPreview, unclaimedDraftCreateEmbeddedRequest.showPreview) - && Objects.equals( - this.showProgressStepper, - unclaimedDraftCreateEmbeddedRequest.showProgressStepper) - && Objects.equals(this.signers, unclaimedDraftCreateEmbeddedRequest.signers) - && Objects.equals( - this.signingOptions, unclaimedDraftCreateEmbeddedRequest.signingOptions) - && Objects.equals( - this.signingRedirectUrl, - unclaimedDraftCreateEmbeddedRequest.signingRedirectUrl) - && Objects.equals(this.skipMeNow, unclaimedDraftCreateEmbeddedRequest.skipMeNow) - && Objects.equals(this.subject, unclaimedDraftCreateEmbeddedRequest.subject) - && Objects.equals(this.testMode, unclaimedDraftCreateEmbeddedRequest.testMode) - && Objects.equals(this.type, unclaimedDraftCreateEmbeddedRequest.type) - && Objects.equals( - this.usePreexistingFields, - unclaimedDraftCreateEmbeddedRequest.usePreexistingFields) - && Objects.equals(this.useTextTags, unclaimedDraftCreateEmbeddedRequest.useTextTags) - && Objects.equals( - this.populateAutoFillFields, - unclaimedDraftCreateEmbeddedRequest.populateAutoFillFields) - && Objects.equals(this.expiresAt, unclaimedDraftCreateEmbeddedRequest.expiresAt); + if (populateAutoFillFields.getClass().equals(java.io.File.class) || + populateAutoFillFields.getClass().equals(Integer.class) || + populateAutoFillFields.getClass().equals(String.class) || + populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for(int i = 0; i< getListSize(populateAutoFillFields); i++) { + map.put("populate_auto_fill_fields[" + i + "]", getFromList(populateAutoFillFields, i)); + } + } + else { + map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - clientId, - requesterEmailAddress, - files, - fileUrls, - allowCcs, - allowDecline, - allowFormView, - allowReassign, - attachments, - ccEmailAddresses, - customFields, - editorOptions, - fieldOptions, - forceSignerPage, - forceSubjectMessage, - formFieldGroups, - formFieldRules, - formFieldsPerDocument, - hideTextTags, - holdRequest, - isForEmbeddedSigning, - message, - metadata, - requestingRedirectUrl, - showPreview, - showProgressStepper, - signers, - signingOptions, - signingRedirectUrl, - skipMeNow, - subject, - testMode, - type, - usePreexistingFields, - useTextTags, - populateAutoFillFields, - expiresAt); + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UnclaimedDraftCreateEmbeddedRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" requesterEmailAddress: ") - .append(toIndentedString(requesterEmailAddress)) - .append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" allowCcs: ").append(toIndentedString(allowCcs)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" forceSignerPage: ").append(toIndentedString(forceSignerPage)).append("\n"); - sb.append(" forceSubjectMessage: ") - .append(toIndentedString(forceSubjectMessage)) - .append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" formFieldsPerDocument: ") - .append(toIndentedString(formFieldsPerDocument)) - .append("\n"); - sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); - sb.append(" holdRequest: ").append(toIndentedString(holdRequest)).append("\n"); - sb.append(" isForEmbeddedSigning: ") - .append(toIndentedString(isForEmbeddedSigning)) - .append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" requestingRedirectUrl: ") - .append(toIndentedString(requestingRedirectUrl)) - .append("\n"); - sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); - sb.append(" showProgressStepper: ") - .append(toIndentedString(showProgressStepper)) - .append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" skipMeNow: ").append(toIndentedString(skipMeNow)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" usePreexistingFields: ") - .append(toIndentedString(usePreexistingFields)) - .append("\n"); - sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); - sb.append(" populateAutoFillFields: ") - .append(toIndentedString(populateAutoFillFields)) - .append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (requesterEmailAddress != null) { - if (isFileTypeOrListOfFiles(requesterEmailAddress)) { - fileTypeFound = true; - } - - if (requesterEmailAddress.getClass().equals(java.io.File.class) - || requesterEmailAddress.getClass().equals(Integer.class) - || requesterEmailAddress.getClass().equals(String.class) - || requesterEmailAddress.getClass().isEnum()) { - map.put("requester_email_address", requesterEmailAddress); - } else if (isListOfFile(requesterEmailAddress)) { - for (int i = 0; i < getListSize(requesterEmailAddress); i++) { - map.put( - "requester_email_address[" + i + "]", - getFromList(requesterEmailAddress, i)); - } - } else { - map.put( - "requester_email_address", - JSON.getDefault() - .getMapper() - .writeValueAsString(requesterEmailAddress)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (allowCcs != null) { - if (isFileTypeOrListOfFiles(allowCcs)) { - fileTypeFound = true; - } - - if (allowCcs.getClass().equals(java.io.File.class) - || allowCcs.getClass().equals(Integer.class) - || allowCcs.getClass().equals(String.class) - || allowCcs.getClass().isEnum()) { - map.put("allow_ccs", allowCcs); - } else if (isListOfFile(allowCcs)) { - for (int i = 0; i < getListSize(allowCcs); i++) { - map.put("allow_ccs[" + i + "]", getFromList(allowCcs, i)); - } - } else { - map.put( - "allow_ccs", - JSON.getDefault().getMapper().writeValueAsString(allowCcs)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (allowFormView != null) { - if (isFileTypeOrListOfFiles(allowFormView)) { - fileTypeFound = true; - } - - if (allowFormView.getClass().equals(java.io.File.class) - || allowFormView.getClass().equals(Integer.class) - || allowFormView.getClass().equals(String.class) - || allowFormView.getClass().isEnum()) { - map.put("allow_form_view", allowFormView); - } else if (isListOfFile(allowFormView)) { - for (int i = 0; i < getListSize(allowFormView); i++) { - map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); - } - } else { - map.put( - "allow_form_view", - JSON.getDefault().getMapper().writeValueAsString(allowFormView)); - } - } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - - if (allowReassign.getClass().equals(java.io.File.class) - || allowReassign.getClass().equals(Integer.class) - || allowReassign.getClass().equals(String.class) - || allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for (int i = 0; i < getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } else { - map.put( - "allow_reassign", - JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } - } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - - if (attachments.getClass().equals(java.io.File.class) - || attachments.getClass().equals(Integer.class) - || attachments.getClass().equals(String.class) - || attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for (int i = 0; i < getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } else { - map.put( - "attachments", - JSON.getDefault().getMapper().writeValueAsString(attachments)); - } - } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - - if (ccEmailAddresses.getClass().equals(java.io.File.class) - || ccEmailAddresses.getClass().equals(Integer.class) - || ccEmailAddresses.getClass().equals(String.class) - || ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for (int i = 0; i < getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } else { - map.put( - "cc_email_addresses", - JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (editorOptions != null) { - if (isFileTypeOrListOfFiles(editorOptions)) { - fileTypeFound = true; - } - - if (editorOptions.getClass().equals(java.io.File.class) - || editorOptions.getClass().equals(Integer.class) - || editorOptions.getClass().equals(String.class) - || editorOptions.getClass().isEnum()) { - map.put("editor_options", editorOptions); - } else if (isListOfFile(editorOptions)) { - for (int i = 0; i < getListSize(editorOptions); i++) { - map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); - } - } else { - map.put( - "editor_options", - JSON.getDefault().getMapper().writeValueAsString(editorOptions)); - } - } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - - if (fieldOptions.getClass().equals(java.io.File.class) - || fieldOptions.getClass().equals(Integer.class) - || fieldOptions.getClass().equals(String.class) - || fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for (int i = 0; i < getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } else { - map.put( - "field_options", - JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } - } - if (forceSignerPage != null) { - if (isFileTypeOrListOfFiles(forceSignerPage)) { - fileTypeFound = true; - } - - if (forceSignerPage.getClass().equals(java.io.File.class) - || forceSignerPage.getClass().equals(Integer.class) - || forceSignerPage.getClass().equals(String.class) - || forceSignerPage.getClass().isEnum()) { - map.put("force_signer_page", forceSignerPage); - } else if (isListOfFile(forceSignerPage)) { - for (int i = 0; i < getListSize(forceSignerPage); i++) { - map.put("force_signer_page[" + i + "]", getFromList(forceSignerPage, i)); - } - } else { - map.put( - "force_signer_page", - JSON.getDefault().getMapper().writeValueAsString(forceSignerPage)); - } - } - if (forceSubjectMessage != null) { - if (isFileTypeOrListOfFiles(forceSubjectMessage)) { - fileTypeFound = true; - } - - if (forceSubjectMessage.getClass().equals(java.io.File.class) - || forceSubjectMessage.getClass().equals(Integer.class) - || forceSubjectMessage.getClass().equals(String.class) - || forceSubjectMessage.getClass().isEnum()) { - map.put("force_subject_message", forceSubjectMessage); - } else if (isListOfFile(forceSubjectMessage)) { - for (int i = 0; i < getListSize(forceSubjectMessage); i++) { - map.put( - "force_subject_message[" + i + "]", - getFromList(forceSubjectMessage, i)); - } - } else { - map.put( - "force_subject_message", - JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); - } - } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - - if (formFieldGroups.getClass().equals(java.io.File.class) - || formFieldGroups.getClass().equals(Integer.class) - || formFieldGroups.getClass().equals(String.class) - || formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for (int i = 0; i < getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } else { - map.put( - "form_field_groups", - JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } - } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - - if (formFieldRules.getClass().equals(java.io.File.class) - || formFieldRules.getClass().equals(Integer.class) - || formFieldRules.getClass().equals(String.class) - || formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for (int i = 0; i < getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } else { - map.put( - "form_field_rules", - JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } - } - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - - if (formFieldsPerDocument.getClass().equals(java.io.File.class) - || formFieldsPerDocument.getClass().equals(Integer.class) - || formFieldsPerDocument.getClass().equals(String.class) - || formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { - map.put( - "form_fields_per_document[" + i + "]", - getFromList(formFieldsPerDocument, i)); - } - } else { - map.put( - "form_fields_per_document", - JSON.getDefault() - .getMapper() - .writeValueAsString(formFieldsPerDocument)); - } - } - if (hideTextTags != null) { - if (isFileTypeOrListOfFiles(hideTextTags)) { - fileTypeFound = true; - } - - if (hideTextTags.getClass().equals(java.io.File.class) - || hideTextTags.getClass().equals(Integer.class) - || hideTextTags.getClass().equals(String.class) - || hideTextTags.getClass().isEnum()) { - map.put("hide_text_tags", hideTextTags); - } else if (isListOfFile(hideTextTags)) { - for (int i = 0; i < getListSize(hideTextTags); i++) { - map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); - } - } else { - map.put( - "hide_text_tags", - JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); - } - } - if (holdRequest != null) { - if (isFileTypeOrListOfFiles(holdRequest)) { - fileTypeFound = true; - } - - if (holdRequest.getClass().equals(java.io.File.class) - || holdRequest.getClass().equals(Integer.class) - || holdRequest.getClass().equals(String.class) - || holdRequest.getClass().isEnum()) { - map.put("hold_request", holdRequest); - } else if (isListOfFile(holdRequest)) { - for (int i = 0; i < getListSize(holdRequest); i++) { - map.put("hold_request[" + i + "]", getFromList(holdRequest, i)); - } - } else { - map.put( - "hold_request", - JSON.getDefault().getMapper().writeValueAsString(holdRequest)); - } - } - if (isForEmbeddedSigning != null) { - if (isFileTypeOrListOfFiles(isForEmbeddedSigning)) { - fileTypeFound = true; - } - - if (isForEmbeddedSigning.getClass().equals(java.io.File.class) - || isForEmbeddedSigning.getClass().equals(Integer.class) - || isForEmbeddedSigning.getClass().equals(String.class) - || isForEmbeddedSigning.getClass().isEnum()) { - map.put("is_for_embedded_signing", isForEmbeddedSigning); - } else if (isListOfFile(isForEmbeddedSigning)) { - for (int i = 0; i < getListSize(isForEmbeddedSigning); i++) { - map.put( - "is_for_embedded_signing[" + i + "]", - getFromList(isForEmbeddedSigning, i)); - } - } else { - map.put( - "is_for_embedded_signing", - JSON.getDefault().getMapper().writeValueAsString(isForEmbeddedSigning)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (requestingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { - fileTypeFound = true; - } - - if (requestingRedirectUrl.getClass().equals(java.io.File.class) - || requestingRedirectUrl.getClass().equals(Integer.class) - || requestingRedirectUrl.getClass().equals(String.class) - || requestingRedirectUrl.getClass().isEnum()) { - map.put("requesting_redirect_url", requestingRedirectUrl); - } else if (isListOfFile(requestingRedirectUrl)) { - for (int i = 0; i < getListSize(requestingRedirectUrl); i++) { - map.put( - "requesting_redirect_url[" + i + "]", - getFromList(requestingRedirectUrl, i)); - } - } else { - map.put( - "requesting_redirect_url", - JSON.getDefault() - .getMapper() - .writeValueAsString(requestingRedirectUrl)); - } - } - if (showPreview != null) { - if (isFileTypeOrListOfFiles(showPreview)) { - fileTypeFound = true; - } - - if (showPreview.getClass().equals(java.io.File.class) - || showPreview.getClass().equals(Integer.class) - || showPreview.getClass().equals(String.class) - || showPreview.getClass().isEnum()) { - map.put("show_preview", showPreview); - } else if (isListOfFile(showPreview)) { - for (int i = 0; i < getListSize(showPreview); i++) { - map.put("show_preview[" + i + "]", getFromList(showPreview, i)); - } - } else { - map.put( - "show_preview", - JSON.getDefault().getMapper().writeValueAsString(showPreview)); - } - } - if (showProgressStepper != null) { - if (isFileTypeOrListOfFiles(showProgressStepper)) { - fileTypeFound = true; - } - - if (showProgressStepper.getClass().equals(java.io.File.class) - || showProgressStepper.getClass().equals(Integer.class) - || showProgressStepper.getClass().equals(String.class) - || showProgressStepper.getClass().isEnum()) { - map.put("show_progress_stepper", showProgressStepper); - } else if (isListOfFile(showProgressStepper)) { - for (int i = 0; i < getListSize(showProgressStepper); i++) { - map.put( - "show_progress_stepper[" + i + "]", - getFromList(showProgressStepper, i)); - } - } else { - map.put( - "show_progress_stepper", - JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - - if (signingOptions.getClass().equals(java.io.File.class) - || signingOptions.getClass().equals(Integer.class) - || signingOptions.getClass().equals(String.class) - || signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for (int i = 0; i < getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } else { - map.put( - "signing_options", - JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (skipMeNow != null) { - if (isFileTypeOrListOfFiles(skipMeNow)) { - fileTypeFound = true; - } - - if (skipMeNow.getClass().equals(java.io.File.class) - || skipMeNow.getClass().equals(Integer.class) - || skipMeNow.getClass().equals(String.class) - || skipMeNow.getClass().isEnum()) { - map.put("skip_me_now", skipMeNow); - } else if (isListOfFile(skipMeNow)) { - for (int i = 0; i < getListSize(skipMeNow); i++) { - map.put("skip_me_now[" + i + "]", getFromList(skipMeNow, i)); - } - } else { - map.put( - "skip_me_now", - JSON.getDefault().getMapper().writeValueAsString(skipMeNow)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (usePreexistingFields != null) { - if (isFileTypeOrListOfFiles(usePreexistingFields)) { - fileTypeFound = true; - } - - if (usePreexistingFields.getClass().equals(java.io.File.class) - || usePreexistingFields.getClass().equals(Integer.class) - || usePreexistingFields.getClass().equals(String.class) - || usePreexistingFields.getClass().isEnum()) { - map.put("use_preexisting_fields", usePreexistingFields); - } else if (isListOfFile(usePreexistingFields)) { - for (int i = 0; i < getListSize(usePreexistingFields); i++) { - map.put( - "use_preexisting_fields[" + i + "]", - getFromList(usePreexistingFields, i)); - } - } else { - map.put( - "use_preexisting_fields", - JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); - } - } - if (useTextTags != null) { - if (isFileTypeOrListOfFiles(useTextTags)) { - fileTypeFound = true; - } - - if (useTextTags.getClass().equals(java.io.File.class) - || useTextTags.getClass().equals(Integer.class) - || useTextTags.getClass().equals(String.class) - || useTextTags.getClass().isEnum()) { - map.put("use_text_tags", useTextTags); - } else if (isListOfFile(useTextTags)) { - for (int i = 0; i < getListSize(useTextTags); i++) { - map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); - } - } else { - map.put( - "use_text_tags", - JSON.getDefault().getMapper().writeValueAsString(useTextTags)); - } - } - if (populateAutoFillFields != null) { - if (isFileTypeOrListOfFiles(populateAutoFillFields)) { - fileTypeFound = true; - } - - if (populateAutoFillFields.getClass().equals(java.io.File.class) - || populateAutoFillFields.getClass().equals(Integer.class) - || populateAutoFillFields.getClass().equals(String.class) - || populateAutoFillFields.getClass().isEnum()) { - map.put("populate_auto_fill_fields", populateAutoFillFields); - } else if (isListOfFile(populateAutoFillFields)) { - for (int i = 0; i < getListSize(populateAutoFillFields); i++) { - map.put( - "populate_auto_fill_fields[" + i + "]", - getFromList(populateAutoFillFields, i)); - } - } else { - map.put( - "populate_auto_fill_fields", - JSON.getDefault() - .getMapper() - .writeValueAsString(populateAutoFillFields)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java index 94848f92d..906164fb0 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java @@ -10,1789 +10,1716 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubCC; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubEditorOptions; +import com.dropbox.sign.model.SubFieldOptions; +import com.dropbox.sign.model.SubSigningOptions; +import com.dropbox.sign.model.SubUnclaimedDraftTemplateSigner; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** UnclaimedDraftCreateEmbeddedWithTemplateRequest */ + +import com.dropbox.sign.ApiException; +/** + * UnclaimedDraftCreateEmbeddedWithTemplateRequest + */ @JsonPropertyOrder({ - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_REASSIGN, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_EDITOR_OPTIONS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FIELD_OPTIONS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILES, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILE_URLS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FORCE_SIGNER_ROLES, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_HOLD_REQUEST, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_PREVIEW_ONLY, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_REQUESTING_REDIRECT_URL, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SHOW_PREVIEW, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNERS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SKIP_ME_NOW, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_CCS + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_REASSIGN, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_EDITOR_OPTIONS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FIELD_OPTIONS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILES, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILE_URLS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FORCE_SIGNER_ROLES, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_HOLD_REQUEST, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_PREVIEW_ONLY, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_REQUESTING_REDIRECT_URL, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SHOW_PREVIEW, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNERS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SKIP_ME_NOW, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_CCS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nonnull private String clientId; - - public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; - @javax.annotation.Nonnull private String requesterEmailAddress; - - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - @javax.annotation.Nonnull private List templateIds = new ArrayList<>(); - - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; - - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - @javax.annotation.Nullable private Boolean allowReassign = false; - - public static final String JSON_PROPERTY_CCS = "ccs"; - @javax.annotation.Nullable private List ccs = null; - - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; - @javax.annotation.Nullable private SubEditorOptions editorOptions; - - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - @javax.annotation.Nullable private SubFieldOptions fieldOptions; - - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; - - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; - - public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; - @javax.annotation.Nullable private Boolean forceSignerRoles = false; - - public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; - @javax.annotation.Nullable private Boolean forceSubjectMessage = false; - - public static final String JSON_PROPERTY_HOLD_REQUEST = "hold_request"; - @javax.annotation.Nullable private Boolean holdRequest = false; - - public static final String JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING = "is_for_embedded_signing"; - @javax.annotation.Nullable private Boolean isForEmbeddedSigning = false; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_PREVIEW_ONLY = "preview_only"; - @javax.annotation.Nullable private Boolean previewOnly = false; - - public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; - @javax.annotation.Nullable private String requestingRedirectUrl; - - public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; - @javax.annotation.Nullable private Boolean showPreview = false; - - public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; - @javax.annotation.Nullable private Boolean showProgressStepper = true; - - public static final String JSON_PROPERTY_SIGNERS = "signers"; - @javax.annotation.Nullable private List signers = null; - - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - @javax.annotation.Nullable private SubSigningOptions signingOptions; - - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; - - public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; - @javax.annotation.Nullable private Boolean skipMeNow = false; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nonnull + private String clientId; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; + public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; + @javax.annotation.Nonnull + private String requesterEmailAddress; - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + @javax.annotation.Nonnull + private List templateIds = new ArrayList<>(); - public static final String JSON_PROPERTY_TITLE = "title"; - @javax.annotation.Nullable private String title; + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; - public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = - "populate_auto_fill_fields"; - @javax.annotation.Nullable private Boolean populateAutoFillFields = false; + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + @javax.annotation.Nullable + private Boolean allowReassign = false; - public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; - @javax.annotation.Nullable private Boolean allowCcs = false; + public static final String JSON_PROPERTY_CCS = "ccs"; + @javax.annotation.Nullable + private List ccs = null; - public UnclaimedDraftCreateEmbeddedWithTemplateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static UnclaimedDraftCreateEmbeddedWithTemplateRequest init(String jsonData) - throws Exception { - return new ObjectMapper() - .readValue(jsonData, UnclaimedDraftCreateEmbeddedWithTemplateRequest.class); - } - - public static UnclaimedDraftCreateEmbeddedWithTemplateRequest init(HashMap data) - throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - UnclaimedDraftCreateEmbeddedWithTemplateRequest.class); - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest clientId( - @javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Client id of the app used to create the draft. Used to apply the branding and callback url - * defined for the app. - * - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest requesterEmailAddress( - @javax.annotation.Nonnull String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - return this; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; + @javax.annotation.Nullable + private SubEditorOptions editorOptions; + + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + @javax.annotation.Nullable + private SubFieldOptions fieldOptions; + + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; + + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; + + public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; + @javax.annotation.Nullable + private Boolean forceSignerRoles = false; + + public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; + @javax.annotation.Nullable + private Boolean forceSubjectMessage = false; + + public static final String JSON_PROPERTY_HOLD_REQUEST = "hold_request"; + @javax.annotation.Nullable + private Boolean holdRequest = false; + + public static final String JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING = "is_for_embedded_signing"; + @javax.annotation.Nullable + private Boolean isForEmbeddedSigning = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_PREVIEW_ONLY = "preview_only"; + @javax.annotation.Nullable + private Boolean previewOnly = false; + + public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; + @javax.annotation.Nullable + private String requestingRedirectUrl; + + public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; + @javax.annotation.Nullable + private Boolean showPreview = false; + + public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; + @javax.annotation.Nullable + private Boolean showProgressStepper = true; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nullable + private List signers = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + @javax.annotation.Nullable + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; + @javax.annotation.Nullable + private Boolean skipMeNow = false; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + @javax.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = "populate_auto_fill_fields"; + @javax.annotation.Nullable + private Boolean populateAutoFillFields = false; + + public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; + @javax.annotation.Nullable + private Boolean allowCcs = false; + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public UnclaimedDraftCreateEmbeddedWithTemplateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateEmbeddedWithTemplateRequest.class); + } + + static public UnclaimedDraftCreateEmbeddedWithTemplateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + UnclaimedDraftCreateEmbeddedWithTemplateRequest.class + ); + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest requesterEmailAddress(@javax.annotation.Nonnull String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + return this; + } + + /** + * The email address of the user that should be designated as the requester of this draft. + * @return requesterEmailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRequesterEmailAddress() { + return requesterEmailAddress; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequesterEmailAddress(@javax.annotation.Nonnull String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest templateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + return this; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. + * @return templateIds + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTemplateIds() { + return templateIds; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { + this.templateIds = templateIds; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } + + /** + * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. + * @return allowReassign + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowReassign() { + return allowReassign; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { + this.allowReassign = allowReassign; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest ccs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + return this; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); } - - /** - * The email address of the user that should be designated as the requester of this draft. - * - * @return requesterEmailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRequesterEmailAddress() { - return requesterEmailAddress; + this.ccs.add(ccsItem); + return this; + } + + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * @return ccs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcs() { + return ccs; + } + + + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(@javax.annotation.Nullable List ccs) { + this.ccs = ccs; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } - - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRequesterEmailAddress(@javax.annotation.Nonnull String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array defining values and options for custom fields. Required when a custom field exists in the Template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest editorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + return this; + } + + /** + * Get editorOptions + * @return editorOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubEditorOptions getEditorOptions() { + return editorOptions; + } + + + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest fieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * @return fieldOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest templateIds( - @javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - return this; + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSignerRoles(@javax.annotation.Nullable Boolean forceSignerRoles) { + this.forceSignerRoles = forceSignerRoles; + return this; + } + + /** + * Provide users the ability to review/edit the template signer roles. + * @return forceSignerRoles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getForceSignerRoles() { + return forceSignerRoles; + } + + + @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSignerRoles(@javax.annotation.Nullable Boolean forceSignerRoles) { + this.forceSignerRoles = forceSignerRoles; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest addTemplateIdsItem( - String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); - } - this.templateIds.add(templateIdsItem); - return this; - } - /** - * Use `template_ids` to create a SignatureRequest from one or more templates, in the - * order in which the templates will be used. - * - * @return templateIds - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getTemplateIds() { - return templateIds; - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSubjectMessage(@javax.annotation.Nullable Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + return this; + } + + /** + * Provide users the ability to review/edit the template subject and message. + * @return forceSubjectMessage + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getForceSubjectMessage() { + return forceSubjectMessage; + } + + + @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSubjectMessage(@javax.annotation.Nullable Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest holdRequest(@javax.annotation.Nullable Boolean holdRequest) { + this.holdRequest = holdRequest; + return this; + } + + /** + * The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. + * @return holdRequest + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHoldRequest() { + return holdRequest; + } + + + @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHoldRequest(@javax.annotation.Nullable Boolean holdRequest) { + this.holdRequest = holdRequest; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest isForEmbeddedSigning(@javax.annotation.Nullable Boolean isForEmbeddedSigning) { + this.isForEmbeddedSigning = isForEmbeddedSigning; + return this; + } + + /** + * The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. + * @return isForEmbeddedSigning + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateIds(@javax.annotation.Nonnull List templateIds) { - this.templateIds = templateIds; - } + public Boolean getIsForEmbeddedSigning() { + return isForEmbeddedSigning; + } + + + @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsForEmbeddedSigning(@javax.annotation.Nullable Boolean isForEmbeddedSigning) { + this.isForEmbeddedSigning = isForEmbeddedSigning; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; - } + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest previewOnly(@javax.annotation.Nullable Boolean previewOnly) { + this.previewOnly = previewOnly; + return this; + } - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - } + /** + * This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set). + * @return previewOnly + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPreviewOnly() { + return previewOnly; + } + + + @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviewOnly(@javax.annotation.Nullable Boolean previewOnly) { + this.previewOnly = previewOnly; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest requestingRedirectUrl(@javax.annotation.Nullable String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully request a signature. + * @return requestingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRequestingRedirectUrl() { + return requestingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestingRedirectUrl(@javax.annotation.Nullable String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest showPreview(@javax.annotation.Nullable Boolean showPreview) { + this.showPreview = showPreview; + return this; + } + + /** + * This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. + * @return showPreview + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getShowPreview() { + return showPreview; + } + + + @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowPreview(@javax.annotation.Nullable Boolean showPreview) { + this.showPreview = showPreview; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest showProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + return this; + } + + /** + * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. + * @return showProgressStepper + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowReassign( - @javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - return this; - } + public Boolean getShowProgressStepper() { + return showProgressStepper; + } + + + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest signers(@javax.annotation.Nullable List signers) { + this.signers = signers; + return this; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest addSignersItem(SubUnclaimedDraftTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } - /** - * Allows signers to reassign their signature requests to other signers if set to - * `true`. Defaults to `false`. **NOTE:** Only available for Premium plan - * and higher. - * - * @return allowReassign - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowReassign() { - return allowReassign; - } + /** + * Add Signers to your Templated-based Signature Request. + * @return signers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(@javax.annotation.Nullable List signers) { + this.signers = signers; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(@javax.annotation.Nullable Boolean allowReassign) { - this.allowReassign = allowReassign; - } + /** + * Get signingOptions + * @return signingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest ccs( - @javax.annotation.Nullable List ccs) { - this.ccs = ccs; - return this; - } + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest skipMeNow(@javax.annotation.Nullable Boolean skipMeNow) { + this.skipMeNow = skipMeNow; + return this; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { - if (this.ccs == null) { - this.ccs = new ArrayList<>(); + /** + * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. + * @return skipMeNow + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSkipMeNow() { + return skipMeNow; + } + + + @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipMeNow(@javax.annotation.Nullable Boolean skipMeNow) { + this.skipMeNow = skipMeNow; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * @return title + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest populateAutoFillFields(@javax.annotation.Nullable Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + return this; + } + + /** + * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. + * @return populateAutoFillFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(@javax.annotation.Nullable Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowCcs(@javax.annotation.Nullable Boolean allowCcs) { + this.allowCcs = allowCcs; + return this; + } + + /** + * This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. + * @return allowCcs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowCcs() { + return allowCcs; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowCcs(@javax.annotation.Nullable Boolean allowCcs) { + this.allowCcs = allowCcs; + } + + + /** + * Return true if this UnclaimedDraftCreateEmbeddedWithTemplateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest = (UnclaimedDraftCreateEmbeddedWithTemplateRequest) o; + return Objects.equals(this.clientId, unclaimedDraftCreateEmbeddedWithTemplateRequest.clientId) && + Objects.equals(this.requesterEmailAddress, unclaimedDraftCreateEmbeddedWithTemplateRequest.requesterEmailAddress) && + Objects.equals(this.templateIds, unclaimedDraftCreateEmbeddedWithTemplateRequest.templateIds) && + Objects.equals(this.allowDecline, unclaimedDraftCreateEmbeddedWithTemplateRequest.allowDecline) && + Objects.equals(this.allowReassign, unclaimedDraftCreateEmbeddedWithTemplateRequest.allowReassign) && + Objects.equals(this.ccs, unclaimedDraftCreateEmbeddedWithTemplateRequest.ccs) && + Objects.equals(this.customFields, unclaimedDraftCreateEmbeddedWithTemplateRequest.customFields) && + Objects.equals(this.editorOptions, unclaimedDraftCreateEmbeddedWithTemplateRequest.editorOptions) && + Objects.equals(this.fieldOptions, unclaimedDraftCreateEmbeddedWithTemplateRequest.fieldOptions) && + Objects.equals(this.files, unclaimedDraftCreateEmbeddedWithTemplateRequest.files) && + Objects.equals(this.fileUrls, unclaimedDraftCreateEmbeddedWithTemplateRequest.fileUrls) && + Objects.equals(this.forceSignerRoles, unclaimedDraftCreateEmbeddedWithTemplateRequest.forceSignerRoles) && + Objects.equals(this.forceSubjectMessage, unclaimedDraftCreateEmbeddedWithTemplateRequest.forceSubjectMessage) && + Objects.equals(this.holdRequest, unclaimedDraftCreateEmbeddedWithTemplateRequest.holdRequest) && + Objects.equals(this.isForEmbeddedSigning, unclaimedDraftCreateEmbeddedWithTemplateRequest.isForEmbeddedSigning) && + Objects.equals(this.message, unclaimedDraftCreateEmbeddedWithTemplateRequest.message) && + Objects.equals(this.metadata, unclaimedDraftCreateEmbeddedWithTemplateRequest.metadata) && + Objects.equals(this.previewOnly, unclaimedDraftCreateEmbeddedWithTemplateRequest.previewOnly) && + Objects.equals(this.requestingRedirectUrl, unclaimedDraftCreateEmbeddedWithTemplateRequest.requestingRedirectUrl) && + Objects.equals(this.showPreview, unclaimedDraftCreateEmbeddedWithTemplateRequest.showPreview) && + Objects.equals(this.showProgressStepper, unclaimedDraftCreateEmbeddedWithTemplateRequest.showProgressStepper) && + Objects.equals(this.signers, unclaimedDraftCreateEmbeddedWithTemplateRequest.signers) && + Objects.equals(this.signingOptions, unclaimedDraftCreateEmbeddedWithTemplateRequest.signingOptions) && + Objects.equals(this.signingRedirectUrl, unclaimedDraftCreateEmbeddedWithTemplateRequest.signingRedirectUrl) && + Objects.equals(this.skipMeNow, unclaimedDraftCreateEmbeddedWithTemplateRequest.skipMeNow) && + Objects.equals(this.subject, unclaimedDraftCreateEmbeddedWithTemplateRequest.subject) && + Objects.equals(this.testMode, unclaimedDraftCreateEmbeddedWithTemplateRequest.testMode) && + Objects.equals(this.title, unclaimedDraftCreateEmbeddedWithTemplateRequest.title) && + Objects.equals(this.populateAutoFillFields, unclaimedDraftCreateEmbeddedWithTemplateRequest.populateAutoFillFields) && + Objects.equals(this.allowCcs, unclaimedDraftCreateEmbeddedWithTemplateRequest.allowCcs); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, requesterEmailAddress, templateIds, allowDecline, allowReassign, ccs, customFields, editorOptions, fieldOptions, files, fileUrls, forceSignerRoles, forceSubjectMessage, holdRequest, isForEmbeddedSigning, message, metadata, previewOnly, requestingRedirectUrl, showPreview, showProgressStepper, signers, signingOptions, signingRedirectUrl, skipMeNow, subject, testMode, title, populateAutoFillFields, allowCcs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnclaimedDraftCreateEmbeddedWithTemplateRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" requesterEmailAddress: ").append(toIndentedString(requesterEmailAddress)).append("\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" forceSignerRoles: ").append(toIndentedString(forceSignerRoles)).append("\n"); + sb.append(" forceSubjectMessage: ").append(toIndentedString(forceSubjectMessage)).append("\n"); + sb.append(" holdRequest: ").append(toIndentedString(holdRequest)).append("\n"); + sb.append(" isForEmbeddedSigning: ").append(toIndentedString(isForEmbeddedSigning)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" previewOnly: ").append(toIndentedString(previewOnly)).append("\n"); + sb.append(" requestingRedirectUrl: ").append(toIndentedString(requestingRedirectUrl)).append("\n"); + sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); + sb.append(" showProgressStepper: ").append(toIndentedString(showProgressStepper)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" skipMeNow: ").append(toIndentedString(skipMeNow)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); + sb.append(" allowCcs: ").append(toIndentedString(allowCcs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; } - this.ccs.add(ccsItem); - return this; - } - - /** - * Add CC email recipients. Required when a CC role exists for the Template. - * - * @return ccs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcs() { - return ccs; - } - - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcs(@javax.annotation.Nullable List ccs) { - this.ccs = ccs; - } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCustomFieldsItem( - SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } } - this.customFields.add(customFieldsItem); - return this; - } - - /** - * An array defining values and options for custom fields. Required when a custom field exists - * in the Template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest editorOptions( - @javax.annotation.Nullable SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - return this; - } - - /** - * Get editorOptions - * - * @return editorOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubEditorOptions getEditorOptions() { - return editorOptions; - } - - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest fieldOptions( - @javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * - * @return fieldOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest files( - @javax.annotation.Nullable List files) { - this.files = files; - return this; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); } - this.files.add(filesItem); - return this; - } - - /** - * Use `files[]` to append additional files to the signature request being created - * from the template. Dropbox Sign will parse the files for [text - * tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature - * request. Text tags for signers not on the template(s) will be ignored. **files** or - * **file_urls[]** is required, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest fileUrls( - @javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + if (requesterEmailAddress != null) { + if (isFileTypeOrListOfFiles(requesterEmailAddress)) { + fileTypeFound = true; } - this.fileUrls.add(fileUrlsItem); - return this; - } - - /** - * Use file_urls[] to append additional files to the signature request being created from the - * template. Dropbox Sign will download the file, then parse it for [text - * tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature - * request. Text tags for signers not on the template(s) will be ignored. **files** or - * **file_urls[]** is required, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; - } - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSignerRoles( - @javax.annotation.Nullable Boolean forceSignerRoles) { - this.forceSignerRoles = forceSignerRoles; - return this; - } - - /** - * Provide users the ability to review/edit the template signer roles. - * - * @return forceSignerRoles - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getForceSignerRoles() { - return forceSignerRoles; - } - - @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSignerRoles(@javax.annotation.Nullable Boolean forceSignerRoles) { - this.forceSignerRoles = forceSignerRoles; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSubjectMessage( - @javax.annotation.Nullable Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - return this; - } - - /** - * Provide users the ability to review/edit the template subject and message. - * - * @return forceSubjectMessage - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getForceSubjectMessage() { - return forceSubjectMessage; - } - - @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSubjectMessage(@javax.annotation.Nullable Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest holdRequest( - @javax.annotation.Nullable Boolean holdRequest) { - this.holdRequest = holdRequest; - return this; - } - - /** - * The request from this draft will not automatically send to signers post-claim if set to 1. - * Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request - * from hold when ready to send. Defaults to `false`. - * - * @return holdRequest - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHoldRequest() { - return holdRequest; - } - @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHoldRequest(@javax.annotation.Nullable Boolean holdRequest) { - this.holdRequest = holdRequest; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest isForEmbeddedSigning( - @javax.annotation.Nullable Boolean isForEmbeddedSigning) { - this.isForEmbeddedSigning = isForEmbeddedSigning; - return this; - } - - /** - * The request created from this draft will also be signable in embedded mode if set to - * `true`. Defaults to `false`. - * - * @return isForEmbeddedSigning - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsForEmbeddedSigning() { - return isForEmbeddedSigning; - } - - @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsForEmbeddedSigning(@javax.annotation.Nullable Boolean isForEmbeddedSigning) { - this.isForEmbeddedSigning = isForEmbeddedSigning; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest message( - @javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest putMetadataItem( - String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (requesterEmailAddress.getClass().equals(java.io.File.class) || + requesterEmailAddress.getClass().equals(Integer.class) || + requesterEmailAddress.getClass().equals(String.class) || + requesterEmailAddress.getClass().isEnum()) { + map.put("requester_email_address", requesterEmailAddress); + } else if (isListOfFile(requesterEmailAddress)) { + for(int i = 0; i< getListSize(requesterEmailAddress); i++) { + map.put("requester_email_address[" + i + "]", getFromList(requesterEmailAddress, i)); + } } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest previewOnly( - @javax.annotation.Nullable Boolean previewOnly) { - this.previewOnly = previewOnly; - return this; - } - - /** - * This allows the requester to enable the preview experience (i.e. does not allow the - * requester's end user to add any additional fields via the editor). - - * `preview_only=true`: Allows requesters to enable the preview only experience. - * - `preview_only=false`: Allows requesters to disable the preview only - * experience. **NOTE:** This parameter overwrites `show_preview=1` (if set). - * - * @return previewOnly - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPreviewOnly() { - return previewOnly; - } - - @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPreviewOnly(@javax.annotation.Nullable Boolean previewOnly) { - this.previewOnly = previewOnly; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest requestingRedirectUrl( - @javax.annotation.Nullable String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully request a signature. - * - * @return requestingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRequestingRedirectUrl() { - return requestingRedirectUrl; - } - - @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequestingRedirectUrl(@javax.annotation.Nullable String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest showPreview( - @javax.annotation.Nullable Boolean showPreview) { - this.showPreview = showPreview; - return this; - } - - /** - * This allows the requester to enable the editor/preview experience. - - * `show_preview=true`: Allows requesters to enable the editor/preview - * experience. - `show_preview=false`: Allows requesters to disable the - * editor/preview experience. - * - * @return showPreview - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getShowPreview() { - return showPreview; - } - - @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowPreview(@javax.annotation.Nullable Boolean showPreview) { - this.showPreview = showPreview; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest showProgressStepper( - @javax.annotation.Nullable Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - return this; - } - - /** - * When only one step remains in the signature request process and this parameter is set to - * `false` then the progress stepper will be hidden. - * - * @return showProgressStepper - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getShowProgressStepper() { - return showProgressStepper; - } - - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest signers( - @javax.annotation.Nullable List signers) { - this.signers = signers; - return this; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest addSignersItem( - SubUnclaimedDraftTemplateSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + else { + map.put("requester_email_address", JSON.getDefault().getMapper().writeValueAsString(requesterEmailAddress)); } - this.signers.add(signersItem); - return this; } + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } - /** - * Add Signers to your Templated-based Signature Request. - * - * @return signers - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSigners() { - return signers; + if (templateIds.getClass().equals(java.io.File.class) || + templateIds.getClass().equals(Integer.class) || + templateIds.getClass().equals(String.class) || + templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for(int i = 0; i< getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } + else { + map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners( - @javax.annotation.Nullable List signers) { - this.signers = signers; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingOptions( - @javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; + if (allowReassign.getClass().equals(java.io.File.class) || + allowReassign.getClass().equals(Integer.class) || + allowReassign.getClass().equals(String.class) || + allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for(int i = 0; i< getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } + else { + map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } - /** - * Get signingOptions - * - * @return signingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubSigningOptions getSigningOptions() { - return signingOptions; + if (ccs.getClass().equals(java.io.File.class) || + ccs.getClass().equals(Integer.class) || + ccs.getClass().equals(String.class) || + ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for(int i = 0; i< getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } + else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (editorOptions != null) { + if (isFileTypeOrListOfFiles(editorOptions)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; + if (editorOptions.getClass().equals(java.io.File.class) || + editorOptions.getClass().equals(Integer.class) || + editorOptions.getClass().equals(String.class) || + editorOptions.getClass().isEnum()) { + map.put("editor_options", editorOptions); + } else if (isListOfFile(editorOptions)) { + for(int i = 0; i< getListSize(editorOptions); i++) { + map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); + } + } + else { + map.put("editor_options", JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + } } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } - /** - * The URL you want signers redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; + if (fieldOptions.getClass().equals(java.io.File.class) || + fieldOptions.getClass().equals(Integer.class) || + fieldOptions.getClass().equals(String.class) || + fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for(int i = 0; i< getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } + else { + map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest skipMeNow( - @javax.annotation.Nullable Boolean skipMeNow) { - this.skipMeNow = skipMeNow; - return this; + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } } + if (forceSignerRoles != null) { + if (isFileTypeOrListOfFiles(forceSignerRoles)) { + fileTypeFound = true; + } - /** - * Disables the \"Me (Now)\" option for the person preparing the document. Does not - * work with type `send_document`. Defaults to `false`. - * - * @return skipMeNow - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getSkipMeNow() { - return skipMeNow; + if (forceSignerRoles.getClass().equals(java.io.File.class) || + forceSignerRoles.getClass().equals(Integer.class) || + forceSignerRoles.getClass().equals(String.class) || + forceSignerRoles.getClass().isEnum()) { + map.put("force_signer_roles", forceSignerRoles); + } else if (isListOfFile(forceSignerRoles)) { + for(int i = 0; i< getListSize(forceSignerRoles); i++) { + map.put("force_signer_roles[" + i + "]", getFromList(forceSignerRoles, i)); + } + } + else { + map.put("force_signer_roles", JSON.getDefault().getMapper().writeValueAsString(forceSignerRoles)); + } } + if (forceSubjectMessage != null) { + if (isFileTypeOrListOfFiles(forceSubjectMessage)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSkipMeNow(@javax.annotation.Nullable Boolean skipMeNow) { - this.skipMeNow = skipMeNow; + if (forceSubjectMessage.getClass().equals(java.io.File.class) || + forceSubjectMessage.getClass().equals(Integer.class) || + forceSubjectMessage.getClass().equals(String.class) || + forceSubjectMessage.getClass().isEnum()) { + map.put("force_subject_message", forceSubjectMessage); + } else if (isListOfFile(forceSubjectMessage)) { + for(int i = 0; i< getListSize(forceSubjectMessage); i++) { + map.put("force_subject_message[" + i + "]", getFromList(forceSubjectMessage, i)); + } + } + else { + map.put("force_subject_message", JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); + } } + if (holdRequest != null) { + if (isFileTypeOrListOfFiles(holdRequest)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest subject( - @javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (holdRequest.getClass().equals(java.io.File.class) || + holdRequest.getClass().equals(Integer.class) || + holdRequest.getClass().equals(String.class) || + holdRequest.getClass().isEnum()) { + map.put("hold_request", holdRequest); + } else if (isListOfFile(holdRequest)) { + for(int i = 0; i< getListSize(holdRequest); i++) { + map.put("hold_request[" + i + "]", getFromList(holdRequest, i)); + } + } + else { + map.put("hold_request", JSON.getDefault().getMapper().writeValueAsString(holdRequest)); + } } + if (isForEmbeddedSigning != null) { + if (isFileTypeOrListOfFiles(isForEmbeddedSigning)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (isForEmbeddedSigning.getClass().equals(java.io.File.class) || + isForEmbeddedSigning.getClass().equals(Integer.class) || + isForEmbeddedSigning.getClass().equals(String.class) || + isForEmbeddedSigning.getClass().isEnum()) { + map.put("is_for_embedded_signing", isForEmbeddedSigning); + } else if (isListOfFile(isForEmbeddedSigning)) { + for(int i = 0; i< getListSize(isForEmbeddedSigning); i++) { + map.put("is_for_embedded_signing[" + i + "]", getFromList(isForEmbeddedSigning, i)); + } + } + else { + map.put("is_for_embedded_signing", JSON.getDefault().getMapper().writeValueAsString(isForEmbeddedSigning)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (previewOnly != null) { + if (isFileTypeOrListOfFiles(previewOnly)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request created from this draft will not be legally - * binding if set to `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (previewOnly.getClass().equals(java.io.File.class) || + previewOnly.getClass().equals(Integer.class) || + previewOnly.getClass().equals(String.class) || + previewOnly.getClass().isEnum()) { + map.put("preview_only", previewOnly); + } else if (isListOfFile(previewOnly)) { + for(int i = 0; i< getListSize(previewOnly); i++) { + map.put("preview_only[" + i + "]", getFromList(previewOnly, i)); + } + } + else { + map.put("preview_only", JSON.getDefault().getMapper().writeValueAsString(previewOnly)); + } } + if (requestingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (requestingRedirectUrl.getClass().equals(java.io.File.class) || + requestingRedirectUrl.getClass().equals(Integer.class) || + requestingRedirectUrl.getClass().equals(String.class) || + requestingRedirectUrl.getClass().isEnum()) { + map.put("requesting_redirect_url", requestingRedirectUrl); + } else if (isListOfFile(requestingRedirectUrl)) { + for(int i = 0; i< getListSize(requestingRedirectUrl); i++) { + map.put("requesting_redirect_url[" + i + "]", getFromList(requestingRedirectUrl, i)); + } + } + else { + map.put("requesting_redirect_url", JSON.getDefault().getMapper().writeValueAsString(requestingRedirectUrl)); + } } + if (showPreview != null) { + if (isFileTypeOrListOfFiles(showPreview)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest title( - @javax.annotation.Nullable String title) { - this.title = title; - return this; + if (showPreview.getClass().equals(java.io.File.class) || + showPreview.getClass().equals(Integer.class) || + showPreview.getClass().equals(String.class) || + showPreview.getClass().isEnum()) { + map.put("show_preview", showPreview); + } else if (isListOfFile(showPreview)) { + for(int i = 0; i< getListSize(showPreview); i++) { + map.put("show_preview[" + i + "]", getFromList(showPreview, i)); + } + } + else { + map.put("show_preview", JSON.getDefault().getMapper().writeValueAsString(showPreview)); + } } + if (showProgressStepper != null) { + if (isFileTypeOrListOfFiles(showProgressStepper)) { + fileTypeFound = true; + } - /** - * The title you want to assign to the SignatureRequest. - * - * @return title - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTitle() { - return title; + if (showProgressStepper.getClass().equals(java.io.File.class) || + showProgressStepper.getClass().equals(Integer.class) || + showProgressStepper.getClass().equals(String.class) || + showProgressStepper.getClass().isEnum()) { + map.put("show_progress_stepper", showProgressStepper); + } else if (isListOfFile(showProgressStepper)) { + for(int i = 0; i< getListSize(showProgressStepper); i++) { + map.put("show_progress_stepper[" + i + "]", getFromList(showProgressStepper, i)); + } + } + else { + map.put("show_progress_stepper", JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + } } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(@javax.annotation.Nullable String title) { - this.title = title; + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest populateAutoFillFields( - @javax.annotation.Nullable Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; - return this; + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - /** - * Controls whether [auto fill - * fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can - * automatically populate a signer's information during signing. **NOTE:** Keep your - * signer's information safe by ensuring that the _signer on your signature request is the - * intended party_ before using this feature. - * - * @return populateAutoFillFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPopulateAutoFillFields() { - return populateAutoFillFields; + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } } + if (skipMeNow != null) { + if (isFileTypeOrListOfFiles(skipMeNow)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPopulateAutoFillFields( - @javax.annotation.Nullable Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; + if (skipMeNow.getClass().equals(java.io.File.class) || + skipMeNow.getClass().equals(Integer.class) || + skipMeNow.getClass().equals(String.class) || + skipMeNow.getClass().isEnum()) { + map.put("skip_me_now", skipMeNow); + } else if (isListOfFile(skipMeNow)) { + for(int i = 0; i< getListSize(skipMeNow); i++) { + map.put("skip_me_now[" + i + "]", getFromList(skipMeNow, i)); + } + } + else { + map.put("skip_me_now", JSON.getDefault().getMapper().writeValueAsString(skipMeNow)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowCcs( - @javax.annotation.Nullable Boolean allowCcs) { - this.allowCcs = allowCcs; - return this; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - /** - * This allows the requester to specify whether the user is allowed to provide email addresses - * to CC when claiming the draft. - * - * @return allowCcs - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowCcs() { - return allowCcs; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_ALLOW_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowCcs(@javax.annotation.Nullable Boolean allowCcs) { - this.allowCcs = allowCcs; + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } - /** Return true if this UnclaimedDraftCreateEmbeddedWithTemplateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UnclaimedDraftCreateEmbeddedWithTemplateRequest - unclaimedDraftCreateEmbeddedWithTemplateRequest = - (UnclaimedDraftCreateEmbeddedWithTemplateRequest) o; - return Objects.equals( - this.clientId, unclaimedDraftCreateEmbeddedWithTemplateRequest.clientId) - && Objects.equals( - this.requesterEmailAddress, - unclaimedDraftCreateEmbeddedWithTemplateRequest.requesterEmailAddress) - && Objects.equals( - this.templateIds, - unclaimedDraftCreateEmbeddedWithTemplateRequest.templateIds) - && Objects.equals( - this.allowDecline, - unclaimedDraftCreateEmbeddedWithTemplateRequest.allowDecline) - && Objects.equals( - this.allowReassign, - unclaimedDraftCreateEmbeddedWithTemplateRequest.allowReassign) - && Objects.equals(this.ccs, unclaimedDraftCreateEmbeddedWithTemplateRequest.ccs) - && Objects.equals( - this.customFields, - unclaimedDraftCreateEmbeddedWithTemplateRequest.customFields) - && Objects.equals( - this.editorOptions, - unclaimedDraftCreateEmbeddedWithTemplateRequest.editorOptions) - && Objects.equals( - this.fieldOptions, - unclaimedDraftCreateEmbeddedWithTemplateRequest.fieldOptions) - && Objects.equals(this.files, unclaimedDraftCreateEmbeddedWithTemplateRequest.files) - && Objects.equals( - this.fileUrls, unclaimedDraftCreateEmbeddedWithTemplateRequest.fileUrls) - && Objects.equals( - this.forceSignerRoles, - unclaimedDraftCreateEmbeddedWithTemplateRequest.forceSignerRoles) - && Objects.equals( - this.forceSubjectMessage, - unclaimedDraftCreateEmbeddedWithTemplateRequest.forceSubjectMessage) - && Objects.equals( - this.holdRequest, - unclaimedDraftCreateEmbeddedWithTemplateRequest.holdRequest) - && Objects.equals( - this.isForEmbeddedSigning, - unclaimedDraftCreateEmbeddedWithTemplateRequest.isForEmbeddedSigning) - && Objects.equals( - this.message, unclaimedDraftCreateEmbeddedWithTemplateRequest.message) - && Objects.equals( - this.metadata, unclaimedDraftCreateEmbeddedWithTemplateRequest.metadata) - && Objects.equals( - this.previewOnly, - unclaimedDraftCreateEmbeddedWithTemplateRequest.previewOnly) - && Objects.equals( - this.requestingRedirectUrl, - unclaimedDraftCreateEmbeddedWithTemplateRequest.requestingRedirectUrl) - && Objects.equals( - this.showPreview, - unclaimedDraftCreateEmbeddedWithTemplateRequest.showPreview) - && Objects.equals( - this.showProgressStepper, - unclaimedDraftCreateEmbeddedWithTemplateRequest.showProgressStepper) - && Objects.equals( - this.signers, unclaimedDraftCreateEmbeddedWithTemplateRequest.signers) - && Objects.equals( - this.signingOptions, - unclaimedDraftCreateEmbeddedWithTemplateRequest.signingOptions) - && Objects.equals( - this.signingRedirectUrl, - unclaimedDraftCreateEmbeddedWithTemplateRequest.signingRedirectUrl) - && Objects.equals( - this.skipMeNow, unclaimedDraftCreateEmbeddedWithTemplateRequest.skipMeNow) - && Objects.equals( - this.subject, unclaimedDraftCreateEmbeddedWithTemplateRequest.subject) - && Objects.equals( - this.testMode, unclaimedDraftCreateEmbeddedWithTemplateRequest.testMode) - && Objects.equals(this.title, unclaimedDraftCreateEmbeddedWithTemplateRequest.title) - && Objects.equals( - this.populateAutoFillFields, - unclaimedDraftCreateEmbeddedWithTemplateRequest.populateAutoFillFields) - && Objects.equals( - this.allowCcs, unclaimedDraftCreateEmbeddedWithTemplateRequest.allowCcs); + if (populateAutoFillFields.getClass().equals(java.io.File.class) || + populateAutoFillFields.getClass().equals(Integer.class) || + populateAutoFillFields.getClass().equals(String.class) || + populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for(int i = 0; i< getListSize(populateAutoFillFields); i++) { + map.put("populate_auto_fill_fields[" + i + "]", getFromList(populateAutoFillFields, i)); + } + } + else { + map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); + } } + if (allowCcs != null) { + if (isFileTypeOrListOfFiles(allowCcs)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - clientId, - requesterEmailAddress, - templateIds, - allowDecline, - allowReassign, - ccs, - customFields, - editorOptions, - fieldOptions, - files, - fileUrls, - forceSignerRoles, - forceSubjectMessage, - holdRequest, - isForEmbeddedSigning, - message, - metadata, - previewOnly, - requestingRedirectUrl, - showPreview, - showProgressStepper, - signers, - signingOptions, - signingRedirectUrl, - skipMeNow, - subject, - testMode, - title, - populateAutoFillFields, - allowCcs); + if (allowCcs.getClass().equals(java.io.File.class) || + allowCcs.getClass().equals(Integer.class) || + allowCcs.getClass().equals(String.class) || + allowCcs.getClass().isEnum()) { + map.put("allow_ccs", allowCcs); + } else if (isListOfFile(allowCcs)) { + for(int i = 0; i< getListSize(allowCcs); i++) { + map.put("allow_ccs[" + i + "]", getFromList(allowCcs, i)); + } + } + else { + map.put("allow_ccs", JSON.getDefault().getMapper().writeValueAsString(allowCcs)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UnclaimedDraftCreateEmbeddedWithTemplateRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" requesterEmailAddress: ") - .append(toIndentedString(requesterEmailAddress)) - .append("\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" forceSignerRoles: ").append(toIndentedString(forceSignerRoles)).append("\n"); - sb.append(" forceSubjectMessage: ") - .append(toIndentedString(forceSubjectMessage)) - .append("\n"); - sb.append(" holdRequest: ").append(toIndentedString(holdRequest)).append("\n"); - sb.append(" isForEmbeddedSigning: ") - .append(toIndentedString(isForEmbeddedSigning)) - .append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" previewOnly: ").append(toIndentedString(previewOnly)).append("\n"); - sb.append(" requestingRedirectUrl: ") - .append(toIndentedString(requestingRedirectUrl)) - .append("\n"); - sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); - sb.append(" showProgressStepper: ") - .append(toIndentedString(showProgressStepper)) - .append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" skipMeNow: ").append(toIndentedString(skipMeNow)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" populateAutoFillFields: ") - .append(toIndentedString(populateAutoFillFields)) - .append("\n"); - sb.append(" allowCcs: ").append(toIndentedString(allowCcs)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (requesterEmailAddress != null) { - if (isFileTypeOrListOfFiles(requesterEmailAddress)) { - fileTypeFound = true; - } - - if (requesterEmailAddress.getClass().equals(java.io.File.class) - || requesterEmailAddress.getClass().equals(Integer.class) - || requesterEmailAddress.getClass().equals(String.class) - || requesterEmailAddress.getClass().isEnum()) { - map.put("requester_email_address", requesterEmailAddress); - } else if (isListOfFile(requesterEmailAddress)) { - for (int i = 0; i < getListSize(requesterEmailAddress); i++) { - map.put( - "requester_email_address[" + i + "]", - getFromList(requesterEmailAddress, i)); - } - } else { - map.put( - "requester_email_address", - JSON.getDefault() - .getMapper() - .writeValueAsString(requesterEmailAddress)); - } - } - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } - - if (templateIds.getClass().equals(java.io.File.class) - || templateIds.getClass().equals(Integer.class) - || templateIds.getClass().equals(String.class) - || templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for (int i = 0; i < getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } else { - map.put( - "template_ids", - JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - - if (allowReassign.getClass().equals(java.io.File.class) - || allowReassign.getClass().equals(Integer.class) - || allowReassign.getClass().equals(String.class) - || allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for (int i = 0; i < getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } else { - map.put( - "allow_reassign", - JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } - } - if (ccs != null) { - if (isFileTypeOrListOfFiles(ccs)) { - fileTypeFound = true; - } - - if (ccs.getClass().equals(java.io.File.class) - || ccs.getClass().equals(Integer.class) - || ccs.getClass().equals(String.class) - || ccs.getClass().isEnum()) { - map.put("ccs", ccs); - } else if (isListOfFile(ccs)) { - for (int i = 0; i < getListSize(ccs); i++) { - map.put("ccs[" + i + "]", getFromList(ccs, i)); - } - } else { - map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (editorOptions != null) { - if (isFileTypeOrListOfFiles(editorOptions)) { - fileTypeFound = true; - } - - if (editorOptions.getClass().equals(java.io.File.class) - || editorOptions.getClass().equals(Integer.class) - || editorOptions.getClass().equals(String.class) - || editorOptions.getClass().isEnum()) { - map.put("editor_options", editorOptions); - } else if (isListOfFile(editorOptions)) { - for (int i = 0; i < getListSize(editorOptions); i++) { - map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); - } - } else { - map.put( - "editor_options", - JSON.getDefault().getMapper().writeValueAsString(editorOptions)); - } - } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - - if (fieldOptions.getClass().equals(java.io.File.class) - || fieldOptions.getClass().equals(Integer.class) - || fieldOptions.getClass().equals(String.class) - || fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for (int i = 0; i < getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } else { - map.put( - "field_options", - JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (forceSignerRoles != null) { - if (isFileTypeOrListOfFiles(forceSignerRoles)) { - fileTypeFound = true; - } - - if (forceSignerRoles.getClass().equals(java.io.File.class) - || forceSignerRoles.getClass().equals(Integer.class) - || forceSignerRoles.getClass().equals(String.class) - || forceSignerRoles.getClass().isEnum()) { - map.put("force_signer_roles", forceSignerRoles); - } else if (isListOfFile(forceSignerRoles)) { - for (int i = 0; i < getListSize(forceSignerRoles); i++) { - map.put("force_signer_roles[" + i + "]", getFromList(forceSignerRoles, i)); - } - } else { - map.put( - "force_signer_roles", - JSON.getDefault().getMapper().writeValueAsString(forceSignerRoles)); - } - } - if (forceSubjectMessage != null) { - if (isFileTypeOrListOfFiles(forceSubjectMessage)) { - fileTypeFound = true; - } - - if (forceSubjectMessage.getClass().equals(java.io.File.class) - || forceSubjectMessage.getClass().equals(Integer.class) - || forceSubjectMessage.getClass().equals(String.class) - || forceSubjectMessage.getClass().isEnum()) { - map.put("force_subject_message", forceSubjectMessage); - } else if (isListOfFile(forceSubjectMessage)) { - for (int i = 0; i < getListSize(forceSubjectMessage); i++) { - map.put( - "force_subject_message[" + i + "]", - getFromList(forceSubjectMessage, i)); - } - } else { - map.put( - "force_subject_message", - JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); - } - } - if (holdRequest != null) { - if (isFileTypeOrListOfFiles(holdRequest)) { - fileTypeFound = true; - } - - if (holdRequest.getClass().equals(java.io.File.class) - || holdRequest.getClass().equals(Integer.class) - || holdRequest.getClass().equals(String.class) - || holdRequest.getClass().isEnum()) { - map.put("hold_request", holdRequest); - } else if (isListOfFile(holdRequest)) { - for (int i = 0; i < getListSize(holdRequest); i++) { - map.put("hold_request[" + i + "]", getFromList(holdRequest, i)); - } - } else { - map.put( - "hold_request", - JSON.getDefault().getMapper().writeValueAsString(holdRequest)); - } - } - if (isForEmbeddedSigning != null) { - if (isFileTypeOrListOfFiles(isForEmbeddedSigning)) { - fileTypeFound = true; - } - - if (isForEmbeddedSigning.getClass().equals(java.io.File.class) - || isForEmbeddedSigning.getClass().equals(Integer.class) - || isForEmbeddedSigning.getClass().equals(String.class) - || isForEmbeddedSigning.getClass().isEnum()) { - map.put("is_for_embedded_signing", isForEmbeddedSigning); - } else if (isListOfFile(isForEmbeddedSigning)) { - for (int i = 0; i < getListSize(isForEmbeddedSigning); i++) { - map.put( - "is_for_embedded_signing[" + i + "]", - getFromList(isForEmbeddedSigning, i)); - } - } else { - map.put( - "is_for_embedded_signing", - JSON.getDefault().getMapper().writeValueAsString(isForEmbeddedSigning)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (previewOnly != null) { - if (isFileTypeOrListOfFiles(previewOnly)) { - fileTypeFound = true; - } - - if (previewOnly.getClass().equals(java.io.File.class) - || previewOnly.getClass().equals(Integer.class) - || previewOnly.getClass().equals(String.class) - || previewOnly.getClass().isEnum()) { - map.put("preview_only", previewOnly); - } else if (isListOfFile(previewOnly)) { - for (int i = 0; i < getListSize(previewOnly); i++) { - map.put("preview_only[" + i + "]", getFromList(previewOnly, i)); - } - } else { - map.put( - "preview_only", - JSON.getDefault().getMapper().writeValueAsString(previewOnly)); - } - } - if (requestingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { - fileTypeFound = true; - } - - if (requestingRedirectUrl.getClass().equals(java.io.File.class) - || requestingRedirectUrl.getClass().equals(Integer.class) - || requestingRedirectUrl.getClass().equals(String.class) - || requestingRedirectUrl.getClass().isEnum()) { - map.put("requesting_redirect_url", requestingRedirectUrl); - } else if (isListOfFile(requestingRedirectUrl)) { - for (int i = 0; i < getListSize(requestingRedirectUrl); i++) { - map.put( - "requesting_redirect_url[" + i + "]", - getFromList(requestingRedirectUrl, i)); - } - } else { - map.put( - "requesting_redirect_url", - JSON.getDefault() - .getMapper() - .writeValueAsString(requestingRedirectUrl)); - } - } - if (showPreview != null) { - if (isFileTypeOrListOfFiles(showPreview)) { - fileTypeFound = true; - } - - if (showPreview.getClass().equals(java.io.File.class) - || showPreview.getClass().equals(Integer.class) - || showPreview.getClass().equals(String.class) - || showPreview.getClass().isEnum()) { - map.put("show_preview", showPreview); - } else if (isListOfFile(showPreview)) { - for (int i = 0; i < getListSize(showPreview); i++) { - map.put("show_preview[" + i + "]", getFromList(showPreview, i)); - } - } else { - map.put( - "show_preview", - JSON.getDefault().getMapper().writeValueAsString(showPreview)); - } - } - if (showProgressStepper != null) { - if (isFileTypeOrListOfFiles(showProgressStepper)) { - fileTypeFound = true; - } - - if (showProgressStepper.getClass().equals(java.io.File.class) - || showProgressStepper.getClass().equals(Integer.class) - || showProgressStepper.getClass().equals(String.class) - || showProgressStepper.getClass().isEnum()) { - map.put("show_progress_stepper", showProgressStepper); - } else if (isListOfFile(showProgressStepper)) { - for (int i = 0; i < getListSize(showProgressStepper); i++) { - map.put( - "show_progress_stepper[" + i + "]", - getFromList(showProgressStepper, i)); - } - } else { - map.put( - "show_progress_stepper", - JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - - if (signingOptions.getClass().equals(java.io.File.class) - || signingOptions.getClass().equals(Integer.class) - || signingOptions.getClass().equals(String.class) - || signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for (int i = 0; i < getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } else { - map.put( - "signing_options", - JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (skipMeNow != null) { - if (isFileTypeOrListOfFiles(skipMeNow)) { - fileTypeFound = true; - } - - if (skipMeNow.getClass().equals(java.io.File.class) - || skipMeNow.getClass().equals(Integer.class) - || skipMeNow.getClass().equals(String.class) - || skipMeNow.getClass().isEnum()) { - map.put("skip_me_now", skipMeNow); - } else if (isListOfFile(skipMeNow)) { - for (int i = 0; i < getListSize(skipMeNow); i++) { - map.put("skip_me_now[" + i + "]", getFromList(skipMeNow, i)); - } - } else { - map.put( - "skip_me_now", - JSON.getDefault().getMapper().writeValueAsString(skipMeNow)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - - if (title.getClass().equals(java.io.File.class) - || title.getClass().equals(Integer.class) - || title.getClass().equals(String.class) - || title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for (int i = 0; i < getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } - } - if (populateAutoFillFields != null) { - if (isFileTypeOrListOfFiles(populateAutoFillFields)) { - fileTypeFound = true; - } - - if (populateAutoFillFields.getClass().equals(java.io.File.class) - || populateAutoFillFields.getClass().equals(Integer.class) - || populateAutoFillFields.getClass().equals(String.class) - || populateAutoFillFields.getClass().isEnum()) { - map.put("populate_auto_fill_fields", populateAutoFillFields); - } else if (isListOfFile(populateAutoFillFields)) { - for (int i = 0; i < getListSize(populateAutoFillFields); i++) { - map.put( - "populate_auto_fill_fields[" + i + "]", - getFromList(populateAutoFillFields, i)); - } - } else { - map.put( - "populate_auto_fill_fields", - JSON.getDefault() - .getMapper() - .writeValueAsString(populateAutoFillFields)); - } - } - if (allowCcs != null) { - if (isFileTypeOrListOfFiles(allowCcs)) { - fileTypeFound = true; - } - - if (allowCcs.getClass().equals(java.io.File.class) - || allowCcs.getClass().equals(Integer.class) - || allowCcs.getClass().equals(String.class) - || allowCcs.getClass().isEnum()) { - map.put("allow_ccs", allowCcs); - } else if (isListOfFile(allowCcs)) { - for (int i = 0; i < getListSize(allowCcs); i++) { - map.put("allow_ccs[" + i + "]", getFromList(allowCcs, i)); - } - } else { - map.put( - "allow_ccs", - JSON.getDefault().getMapper().writeValueAsString(allowCcs)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java index cf104bb0f..5aee1a0ac 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java @@ -10,1557 +10,1522 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubAttachment; +import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.model.SubFieldOptions; +import com.dropbox.sign.model.SubFormFieldGroup; +import com.dropbox.sign.model.SubFormFieldRule; +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.model.SubSigningOptions; +import com.dropbox.sign.model.SubUnclaimedDraftSigner; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + -/** */ +import com.dropbox.sign.ApiException; +/** + * + */ @JsonPropertyOrder({ - UnclaimedDraftCreateRequest.JSON_PROPERTY_TYPE, - UnclaimedDraftCreateRequest.JSON_PROPERTY_FILES, - UnclaimedDraftCreateRequest.JSON_PROPERTY_FILE_URLS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_ALLOW_DECLINE, - UnclaimedDraftCreateRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, - UnclaimedDraftCreateRequest.JSON_PROPERTY_ATTACHMENTS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - UnclaimedDraftCreateRequest.JSON_PROPERTY_CLIENT_ID, - UnclaimedDraftCreateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_FIELD_OPTIONS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_FORM_FIELD_RULES, - UnclaimedDraftCreateRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - UnclaimedDraftCreateRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_MESSAGE, - UnclaimedDraftCreateRequest.JSON_PROPERTY_METADATA, - UnclaimedDraftCreateRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, - UnclaimedDraftCreateRequest.JSON_PROPERTY_SIGNERS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_SIGNING_OPTIONS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - UnclaimedDraftCreateRequest.JSON_PROPERTY_SUBJECT, - UnclaimedDraftCreateRequest.JSON_PROPERTY_TEST_MODE, - UnclaimedDraftCreateRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_USE_TEXT_TAGS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_EXPIRES_AT + UnclaimedDraftCreateRequest.JSON_PROPERTY_TYPE, + UnclaimedDraftCreateRequest.JSON_PROPERTY_FILES, + UnclaimedDraftCreateRequest.JSON_PROPERTY_FILE_URLS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_ALLOW_DECLINE, + UnclaimedDraftCreateRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, + UnclaimedDraftCreateRequest.JSON_PROPERTY_ATTACHMENTS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + UnclaimedDraftCreateRequest.JSON_PROPERTY_CLIENT_ID, + UnclaimedDraftCreateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_FIELD_OPTIONS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_FORM_FIELD_RULES, + UnclaimedDraftCreateRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + UnclaimedDraftCreateRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_MESSAGE, + UnclaimedDraftCreateRequest.JSON_PROPERTY_METADATA, + UnclaimedDraftCreateRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, + UnclaimedDraftCreateRequest.JSON_PROPERTY_SIGNERS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + UnclaimedDraftCreateRequest.JSON_PROPERTY_SUBJECT, + UnclaimedDraftCreateRequest.JSON_PROPERTY_TEST_MODE, + UnclaimedDraftCreateRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_USE_TEXT_TAGS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_EXPIRES_AT }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class UnclaimedDraftCreateRequest { - /** - * The type of unclaimed draft to create. Use `send_document` to create a claimable - * file, and `request_signature` for a claimable signature request. If the type is - * `request_signature` then signers name and email_address are not optional. - */ - public enum TypeEnum { - SEND_DOCUMENT(String.valueOf("send_document")), - - REQUEST_SIGNATURE(String.valueOf("request_signature")); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_TYPE = "type"; - @javax.annotation.Nonnull private TypeEnum type; - - public static final String JSON_PROPERTY_FILES = "files"; - @javax.annotation.Nullable private List files = null; - - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - @javax.annotation.Nullable private List fileUrls = null; - - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - @javax.annotation.Nullable private Boolean allowDecline = false; - - public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; - @javax.annotation.Nullable private Boolean allowFormView = false; - - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - @javax.annotation.Nullable private List attachments = null; + /** + * The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. + */ + public enum TypeEnum { + SEND_DOCUMENT(String.valueOf("send_document")), + + REQUEST_SIGNATURE(String.valueOf("request_signature")); - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - @javax.annotation.Nullable private List ccEmailAddresses = null; + private String value; - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nullable private String clientId; - - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - @javax.annotation.Nullable private List customFields = null; - - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - @javax.annotation.Nullable private SubFieldOptions fieldOptions; - - public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - @javax.annotation.Nullable private List formFieldGroups = null; - - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - @javax.annotation.Nullable private List formFieldRules = null; - - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - - @javax.annotation.Nullable private List formFieldsPerDocument = null; - - public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; - @javax.annotation.Nullable private Boolean hideTextTags = false; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - @javax.annotation.Nullable private String message; - - public static final String JSON_PROPERTY_METADATA = "metadata"; - @javax.annotation.Nullable private Map metadata = null; - - public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; - @javax.annotation.Nullable private Boolean showProgressStepper = true; - - public static final String JSON_PROPERTY_SIGNERS = "signers"; - @javax.annotation.Nullable private List signers = null; - - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - @javax.annotation.Nullable private SubSigningOptions signingOptions; - - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - @javax.annotation.Nullable private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; - @javax.annotation.Nullable private Boolean usePreexistingFields = false; - - public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; - @javax.annotation.Nullable private Boolean useTextTags = false; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public UnclaimedDraftCreateRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static UnclaimedDraftCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateRequest.class); - } - - public static UnclaimedDraftCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - UnclaimedDraftCreateRequest.class); - } - - public UnclaimedDraftCreateRequest type(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - return this; + TypeEnum(String value) { + this.value = value; } - /** - * The type of unclaimed draft to create. Use `send_document` to create a claimable - * file, and `request_signature` for a claimable signature request. If the type is - * `request_signature` then signers name and email_address are not optional. - * - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TypeEnum getType() { - return type; + @JsonValue + public String getValue() { + return value; } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull TypeEnum type) { - this.type = type; - } - - public UnclaimedDraftCreateRequest files(@javax.annotation.Nullable List files) { - this.files = files; - return this; + @Override + public String toString() { + return String.valueOf(value); } - public UnclaimedDraftCreateRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; } - this.files.add(filesItem); - return this; + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } + } - /** - * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint - * requires either **files** or **file_urls[]**, but not both. - * - * @return files - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private TypeEnum type; - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@javax.annotation.Nullable List files) { - this.files = files; - } + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = null; - public UnclaimedDraftCreateRequest fileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - return this; - } + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + @javax.annotation.Nullable + private List fileUrls = null; - public UnclaimedDraftCreateRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); - } - this.fileUrls.add(fileUrlsItem); - return this; - } + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + @javax.annotation.Nullable + private Boolean allowDecline = false; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @javax.annotation.Nullable + private Boolean allowFormView = false; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + @javax.annotation.Nullable + private List attachments = null; + + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + @javax.annotation.Nullable + private List ccEmailAddresses = null; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nullable + private String clientId; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @javax.annotation.Nullable + private List customFields = null; + + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + @javax.annotation.Nullable + private SubFieldOptions fieldOptions; + + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + @javax.annotation.Nullable + private List formFieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + @javax.annotation.Nullable + private List formFieldRules = null; + + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + @javax.annotation.Nullable + private List formFieldsPerDocument = null; + + public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; + @javax.annotation.Nullable + private Boolean hideTextTags = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private Map metadata = null; + + public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; + @javax.annotation.Nullable + private Boolean showProgressStepper = true; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + @javax.annotation.Nullable + private List signers = null; + + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + @javax.annotation.Nullable + private SubSigningOptions signingOptions; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @javax.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; + @javax.annotation.Nullable + private Boolean usePreexistingFields = false; + + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + @javax.annotation.Nullable + private Boolean useTextTags = false; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public UnclaimedDraftCreateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public UnclaimedDraftCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateRequest.class); + } + + static public UnclaimedDraftCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + UnclaimedDraftCreateRequest.class + ); + } + + public UnclaimedDraftCreateRequest type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public UnclaimedDraftCreateRequest files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public UnclaimedDraftCreateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + public UnclaimedDraftCreateRequest fileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public UnclaimedDraftCreateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } + + /** + * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. + * @return fileUrls + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFileUrls() { + return fileUrls; + } + + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(@javax.annotation.Nullable List fileUrls) { + this.fileUrls = fileUrls; + } + + + public UnclaimedDraftCreateRequest allowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + + /** + * Allows signers to decline to sign a document if `true`. Defaults to `false`. + * @return allowDecline + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowDecline() { + return allowDecline; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { + this.allowDecline = allowDecline; + } + + + public UnclaimedDraftCreateRequest allowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. + * @return allowFormView + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + public UnclaimedDraftCreateRequest attachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + return this; + } - /** - * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. - * This endpoint requires either **files** or **file_urls[]**, but not both. - * - * @return fileUrls - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFileUrls() { - return fileUrls; + public UnclaimedDraftCreateRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * A list describing the attachments + * @return attachments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(@javax.annotation.Nullable List attachments) { + this.attachments = attachments; + } + + + public UnclaimedDraftCreateRequest ccEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; + } + + public UnclaimedDraftCreateRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } + + /** + * The email addresses that should be CCed. + * @return ccEmailAddresses + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } + + + public UnclaimedDraftCreateRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public UnclaimedDraftCreateRequest customFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + return this; + } + + public UnclaimedDraftCreateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + * @return customFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCustomFields() { + return customFields; + } + + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(@javax.annotation.Nullable List customFields) { + this.customFields = customFields; + } - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(@javax.annotation.Nullable List fileUrls) { - this.fileUrls = fileUrls; - } - - public UnclaimedDraftCreateRequest allowDecline( - @javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - /** - * Allows signers to decline to sign a document if `true`. Defaults to - * `false`. - * - * @return allowDecline - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowDecline() { - return allowDecline; - } + public UnclaimedDraftCreateRequest fieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; + } + + /** + * Get fieldOptions + * @return fieldOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubFieldOptions getFieldOptions() { + return fieldOptions; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + } + + + public UnclaimedDraftCreateRequest formFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; + } - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(@javax.annotation.Nullable Boolean allowDecline) { - this.allowDecline = allowDecline; - } + public UnclaimedDraftCreateRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); + } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } + + /** + * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. + * @return formFieldGroups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldGroups() { + return formFieldGroups; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(@javax.annotation.Nullable List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + + public UnclaimedDraftCreateRequest formFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } + + public UnclaimedDraftCreateRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); + } + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * @return formFieldRules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFormFieldRules() { + return formFieldRules; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(@javax.annotation.Nullable List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + + public UnclaimedDraftCreateRequest formFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public UnclaimedDraftCreateRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; + } + + /** + * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + * @return formFieldsPerDocument + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UnclaimedDraftCreateRequest allowFormView( - @javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - return this; + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(@javax.annotation.Nullable List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + + public UnclaimedDraftCreateRequest hideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; + } + + /** + * Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. + * @return hideTextTags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHideTextTags() { + return hideTextTags; + } + + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + } + + + public UnclaimedDraftCreateRequest message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public UnclaimedDraftCreateRequest metadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + return this; + } + + public UnclaimedDraftCreateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } - - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to - * `false`. - * - * @return allowFormView - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAllowFormView() { - return allowFormView; + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable Map metadata) { + this.metadata = metadata; + } + + + public UnclaimedDraftCreateRequest showProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + return this; + } + + /** + * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. + * @return showProgressStepper + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getShowProgressStepper() { + return showProgressStepper; + } + + + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + } + + + public UnclaimedDraftCreateRequest signers(@javax.annotation.Nullable List signers) { + this.signers = signers; + return this; + } + + public UnclaimedDraftCreateRequest addSignersItem(SubUnclaimedDraftSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Unclaimed Draft Signature Request. + * @return signers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSigners() { + return signers; + } + + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(@javax.annotation.Nullable List signers) { + this.signers = signers; + } + - @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowFormView(@javax.annotation.Nullable Boolean allowFormView) { - this.allowFormView = allowFormView; - } + public UnclaimedDraftCreateRequest signingOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * @return signingOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + + public UnclaimedDraftCreateRequest signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } - public UnclaimedDraftCreateRequest attachments( - @javax.annotation.Nullable List attachments) { - this.attachments = attachments; - return this; - } + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public UnclaimedDraftCreateRequest subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } - public UnclaimedDraftCreateRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); + /** + * The subject in the email that will be sent to the signers. + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public UnclaimedDraftCreateRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + public UnclaimedDraftCreateRequest usePreexistingFields(@javax.annotation.Nullable Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + return this; + } + + /** + * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. + * @return usePreexistingFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUsePreexistingFields() { + return usePreexistingFields; + } + + + @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsePreexistingFields(@javax.annotation.Nullable Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + } + + + public UnclaimedDraftCreateRequest useTextTags(@javax.annotation.Nullable Boolean useTextTags) { + this.useTextTags = useTextTags; + return this; + } + + /** + * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. + * @return useTextTags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseTextTags() { + return useTextTags; + } + + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(@javax.annotation.Nullable Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + + public UnclaimedDraftCreateRequest expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + /** + * Return true if this UnclaimedDraftCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnclaimedDraftCreateRequest unclaimedDraftCreateRequest = (UnclaimedDraftCreateRequest) o; + return Objects.equals(this.type, unclaimedDraftCreateRequest.type) && + Objects.equals(this.files, unclaimedDraftCreateRequest.files) && + Objects.equals(this.fileUrls, unclaimedDraftCreateRequest.fileUrls) && + Objects.equals(this.allowDecline, unclaimedDraftCreateRequest.allowDecline) && + Objects.equals(this.allowFormView, unclaimedDraftCreateRequest.allowFormView) && + Objects.equals(this.attachments, unclaimedDraftCreateRequest.attachments) && + Objects.equals(this.ccEmailAddresses, unclaimedDraftCreateRequest.ccEmailAddresses) && + Objects.equals(this.clientId, unclaimedDraftCreateRequest.clientId) && + Objects.equals(this.customFields, unclaimedDraftCreateRequest.customFields) && + Objects.equals(this.fieldOptions, unclaimedDraftCreateRequest.fieldOptions) && + Objects.equals(this.formFieldGroups, unclaimedDraftCreateRequest.formFieldGroups) && + Objects.equals(this.formFieldRules, unclaimedDraftCreateRequest.formFieldRules) && + Objects.equals(this.formFieldsPerDocument, unclaimedDraftCreateRequest.formFieldsPerDocument) && + Objects.equals(this.hideTextTags, unclaimedDraftCreateRequest.hideTextTags) && + Objects.equals(this.message, unclaimedDraftCreateRequest.message) && + Objects.equals(this.metadata, unclaimedDraftCreateRequest.metadata) && + Objects.equals(this.showProgressStepper, unclaimedDraftCreateRequest.showProgressStepper) && + Objects.equals(this.signers, unclaimedDraftCreateRequest.signers) && + Objects.equals(this.signingOptions, unclaimedDraftCreateRequest.signingOptions) && + Objects.equals(this.signingRedirectUrl, unclaimedDraftCreateRequest.signingRedirectUrl) && + Objects.equals(this.subject, unclaimedDraftCreateRequest.subject) && + Objects.equals(this.testMode, unclaimedDraftCreateRequest.testMode) && + Objects.equals(this.usePreexistingFields, unclaimedDraftCreateRequest.usePreexistingFields) && + Objects.equals(this.useTextTags, unclaimedDraftCreateRequest.useTextTags) && + Objects.equals(this.expiresAt, unclaimedDraftCreateRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(type, files, fileUrls, allowDecline, allowFormView, attachments, ccEmailAddresses, clientId, customFields, fieldOptions, formFieldGroups, formFieldRules, formFieldsPerDocument, hideTextTags, message, metadata, showProgressStepper, signers, signingOptions, signingRedirectUrl, subject, testMode, usePreexistingFields, useTextTags, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnclaimedDraftCreateRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" showProgressStepper: ").append(toIndentedString(showProgressStepper)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" usePreexistingFields: ").append(toIndentedString(usePreexistingFields)).append("\n"); + sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; } - this.attachments.add(attachmentsItem); - return this; - } - /** - * A list describing the attachments - * - * @return attachments - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAttachments() { - return attachments; - } - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(@javax.annotation.Nullable List attachments) { - this.attachments = attachments; - } - - public UnclaimedDraftCreateRequest ccEmailAddresses( - @javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public UnclaimedDraftCreateRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); + if (type.getClass().equals(java.io.File.class) || + type.getClass().equals(Integer.class) || + type.getClass().equals(String.class) || + type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for(int i = 0; i< getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } } - this.ccEmailAddresses.add(ccEmailAddressesItem); - return this; - } - - /** - * The email addresses that should be CCed. - * - * @return ccEmailAddresses - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(@javax.annotation.Nullable List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } - - public UnclaimedDraftCreateRequest clientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Client id of the app used to create the draft. Used to apply the branding and callback url - * defined for the app. - * - * @return clientId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(@javax.annotation.Nullable String clientId) { - this.clientId = clientId; - } - - public UnclaimedDraftCreateRequest customFields( - @javax.annotation.Nullable List customFields) { - this.customFields = customFields; - return this; - } - - public UnclaimedDraftCreateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); } - this.customFields.add(customFieldsItem); - return this; - } - - /** - * When used together with merge fields, `custom_fields` allows users to add - * pre-filled data to their signature requests. Pre-filled data can be used with - * \"send-once\" signature requests by adding merge fields with - * `form_fields_per_document` or [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values - * back with `custom_fields` together in one API call. For using pre-filled on - * repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or - * by calling - * [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and - * then passing `custom_fields` on subsequent signature requests referencing that - * template. - * - * @return customFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getCustomFields() { - return customFields; - } - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@javax.annotation.Nullable List customFields) { - this.customFields = customFields; - } - - public UnclaimedDraftCreateRequest fieldOptions( - @javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * - * @return fieldOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(@javax.annotation.Nullable SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - public UnclaimedDraftCreateRequest formFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; } - - public UnclaimedDraftCreateRequest addFormFieldGroupsItem( - SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; } - this.formFieldGroups.add(formFieldGroupsItem); - return this; - } - - /** - * Group information for fields defined in `form_fields_per_document`. String-indexed - * JSON array with `group_label` and `requirement` keys. - * `form_fields_per_document` must contain fields referencing a group defined in - * `form_field_groups`. - * - * @return formFieldGroups - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldGroups() { - return formFieldGroups; - } - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups( - @javax.annotation.Nullable List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - public UnclaimedDraftCreateRequest formFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - - public UnclaimedDraftCreateRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); + if (files.getClass().equals(java.io.File.class) || + files.getClass().equals(Integer.class) || + files.getClass().equals(String.class) || + files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for(int i = 0; i< getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * - * @return formFieldRules - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldRules() { - return formFieldRules; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules( - @javax.annotation.Nullable List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - public UnclaimedDraftCreateRequest formFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; - } - - public UnclaimedDraftCreateRequest addFormFieldsPerDocumentItem( - SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); + else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); } - this.formFieldsPerDocument.add(formFieldsPerDocumentItem); - return this; } - - /** - * The fields that should appear on the document, expressed as an array of objects. (For more - * details you can read about it here: [Using Form Fields per - * Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, - * **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and - * optional parameters. Check out the list of [additional - * parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text - * Field use `SubFormFieldsPerDocumentText` * Dropdown Field use - * `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use - * `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use - * `SubFormFieldsPerDocumentCheckbox` * Radio Field use - * `SubFormFieldsPerDocumentRadio` * Signature Field use - * `SubFormFieldsPerDocumentSignature` * Date Signed Field use - * `SubFormFieldsPerDocumentDateSigned` * Initials Field use - * `SubFormFieldsPerDocumentInitials` * Text Merge Field use - * `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use - * `SubFormFieldsPerDocumentCheckboxMerge` - * - * @return formFieldsPerDocument - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldsPerDocument( - @javax.annotation.Nullable List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } - - public UnclaimedDraftCreateRequest hideTextTags( - @javax.annotation.Nullable Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - return this; - } - - /** - * Send with a value of `true` if you wish to enable automatic Text Tag removal. - * Defaults to `false`. When using Text Tags it is preferred that you set this to - * `false` and hide your tags with white text or something similar because the - * automatic removal system can cause unwanted clipping. See the [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more - * details. - * - * @return hideTextTags - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHideTextTags() { - return hideTextTags; - } - - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHideTextTags(@javax.annotation.Nullable Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - } - - public UnclaimedDraftCreateRequest message(@javax.annotation.Nullable String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * - * @return message - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(@javax.annotation.Nullable String message) { - this.message = message; - } - - public UnclaimedDraftCreateRequest metadata( - @javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - return this; - } - - public UnclaimedDraftCreateRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; } - this.metadata.put(key, metadataItem); - return this; - } - - /** - * Key-value data that should be attached to the signature request. This metadata is included in - * all API responses and events involving the signature request. For example, use the metadata - * field to store a signer's order number for look up when receiving events for the - * signature request. Each request can include up to 10 metadata keys (or 50 nested metadata - * keys), with key names up to 40 characters long and values up to 1000 characters long. - * - * @return metadata - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public Map getMetadata() { - return metadata; - } - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@javax.annotation.Nullable Map metadata) { - this.metadata = metadata; - } - public UnclaimedDraftCreateRequest showProgressStepper( - @javax.annotation.Nullable Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - return this; - } - - /** - * When only one step remains in the signature request process and this parameter is set to - * `false` then the progress stepper will be hidden. - * - * @return showProgressStepper - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getShowProgressStepper() { - return showProgressStepper; - } - - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - } - - public UnclaimedDraftCreateRequest signers( - @javax.annotation.Nullable List signers) { - this.signers = signers; - return this; - } - - public UnclaimedDraftCreateRequest addSignersItem(SubUnclaimedDraftSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + if (fileUrls.getClass().equals(java.io.File.class) || + fileUrls.getClass().equals(Integer.class) || + fileUrls.getClass().equals(String.class) || + fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for(int i = 0; i< getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } + else { + map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Unclaimed Draft Signature Request. - * - * @return signers - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSigners() { - return signers; - } - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners(@javax.annotation.Nullable List signers) { - this.signers = signers; - } - - public UnclaimedDraftCreateRequest signingOptions( - @javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } - /** - * Get signingOptions - * - * @return signingOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubSigningOptions getSigningOptions() { - return signingOptions; + if (allowDecline.getClass().equals(java.io.File.class) || + allowDecline.getClass().equals(Integer.class) || + allowDecline.getClass().equals(String.class) || + allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for(int i = 0; i< getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } + else { + map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(@javax.annotation.Nullable SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateRequest signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; + if (attachments.getClass().equals(java.io.File.class) || + attachments.getClass().equals(Integer.class) || + attachments.getClass().equals(String.class) || + attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for(int i = 0; i< getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } + else { + map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + } } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } - /** - * The URL you want signers redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; + if (ccEmailAddresses.getClass().equals(java.io.File.class) || + ccEmailAddresses.getClass().equals(Integer.class) || + ccEmailAddresses.getClass().equals(String.class) || + ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for(int i = 0; i< getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } + else { + map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateRequest subject(@javax.annotation.Nullable String subject) { - this.subject = subject; - return this; + if (customFields.getClass().equals(java.io.File.class) || + customFields.getClass().equals(Integer.class) || + customFields.getClass().equals(String.class) || + customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for(int i = 0; i< getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } + else { + map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + } } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } - /** - * The subject in the email that will be sent to the signers. - * - * @return subject - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSubject() { - return subject; + if (fieldOptions.getClass().equals(java.io.File.class) || + fieldOptions.getClass().equals(Integer.class) || + fieldOptions.getClass().equals(String.class) || + fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for(int i = 0; i< getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } + else { + map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(@javax.annotation.Nullable String subject) { - this.subject = subject; + if (formFieldGroups.getClass().equals(java.io.File.class) || + formFieldGroups.getClass().equals(Integer.class) || + formFieldGroups.getClass().equals(String.class) || + formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for(int i = 0; i< getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } + else { + map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateRequest testMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (formFieldRules.getClass().equals(java.io.File.class) || + formFieldRules.getClass().equals(Integer.class) || + formFieldRules.getClass().equals(String.class) || + formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for(int i = 0; i< getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } + else { + map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request created from this draft will not be legally - * binding if set to `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (formFieldsPerDocument.getClass().equals(java.io.File.class) || + formFieldsPerDocument.getClass().equals(Integer.class) || + formFieldsPerDocument.getClass().equals(String.class) || + formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { + map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); + } + } + else { + map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); + } } + if (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (hideTextTags.getClass().equals(java.io.File.class) || + hideTextTags.getClass().equals(Integer.class) || + hideTextTags.getClass().equals(String.class) || + hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for(int i = 0; i< getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } + else { + map.put("hide_text_tags", JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateRequest usePreexistingFields( - @javax.annotation.Nullable Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; - return this; + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } - /** - * Set `use_text_tags` to `true` to enable [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your - * document (defaults to disabled, or `false`). Alternatively, if your PDF contains - * pre-defined fields, enable the detection of these fields by setting the - * `use_preexisting_fields` to `true` (defaults to disabled, or - * `false`). Currently we only support use of either `use_text_tags` or - * `use_preexisting_fields` parameter, not both. - * - * @return usePreexistingFields - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getUsePreexistingFields() { - return usePreexistingFields; + if (metadata.getClass().equals(java.io.File.class) || + metadata.getClass().equals(Integer.class) || + metadata.getClass().equals(String.class) || + metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for(int i = 0; i< getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } + else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } } + if (showProgressStepper != null) { + if (isFileTypeOrListOfFiles(showProgressStepper)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsePreexistingFields(@javax.annotation.Nullable Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; + if (showProgressStepper.getClass().equals(java.io.File.class) || + showProgressStepper.getClass().equals(Integer.class) || + showProgressStepper.getClass().equals(String.class) || + showProgressStepper.getClass().isEnum()) { + map.put("show_progress_stepper", showProgressStepper); + } else if (isListOfFile(showProgressStepper)) { + for(int i = 0; i< getListSize(showProgressStepper); i++) { + map.put("show_progress_stepper[" + i + "]", getFromList(showProgressStepper, i)); + } + } + else { + map.put("show_progress_stepper", JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + } } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateRequest useTextTags(@javax.annotation.Nullable Boolean useTextTags) { - this.useTextTags = useTextTags; - return this; + if (signers.getClass().equals(java.io.File.class) || + signers.getClass().equals(Integer.class) || + signers.getClass().equals(String.class) || + signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for(int i = 0; i< getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } + else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } - /** - * Set `use_text_tags` to `true` to enable [Text - * Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your - * document (defaults to disabled, or `false`). Alternatively, if your PDF contains - * pre-defined fields, enable the detection of these fields by setting the - * `use_preexisting_fields` to `true` (defaults to disabled, or - * `false`). Currently we only support use of either `use_text_tags` or - * `use_preexisting_fields` parameter, not both. - * - * @return useTextTags - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getUseTextTags() { - return useTextTags; + if (signingOptions.getClass().equals(java.io.File.class) || + signingOptions.getClass().equals(Integer.class) || + signingOptions.getClass().equals(String.class) || + signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for(int i = 0; i< getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } + else { + map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUseTextTags(@javax.annotation.Nullable Boolean useTextTags) { - this.useTextTags = useTextTags; + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } - public UnclaimedDraftCreateRequest expiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - /** - * When the signature request will expire. Unsigned signatures will be moved to the expired - * status, and no longer signable. See [Signature Request Expiration - * Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. - * **NOTE:** This does not correspond to the **expires_at** returned in the response. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } + if (usePreexistingFields != null) { + if (isFileTypeOrListOfFiles(usePreexistingFields)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; + if (usePreexistingFields.getClass().equals(java.io.File.class) || + usePreexistingFields.getClass().equals(Integer.class) || + usePreexistingFields.getClass().equals(String.class) || + usePreexistingFields.getClass().isEnum()) { + map.put("use_preexisting_fields", usePreexistingFields); + } else if (isListOfFile(usePreexistingFields)) { + for(int i = 0; i< getListSize(usePreexistingFields); i++) { + map.put("use_preexisting_fields[" + i + "]", getFromList(usePreexistingFields, i)); + } + } + else { + map.put("use_preexisting_fields", JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); + } } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } - /** Return true if this UnclaimedDraftCreateRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UnclaimedDraftCreateRequest unclaimedDraftCreateRequest = (UnclaimedDraftCreateRequest) o; - return Objects.equals(this.type, unclaimedDraftCreateRequest.type) - && Objects.equals(this.files, unclaimedDraftCreateRequest.files) - && Objects.equals(this.fileUrls, unclaimedDraftCreateRequest.fileUrls) - && Objects.equals(this.allowDecline, unclaimedDraftCreateRequest.allowDecline) - && Objects.equals(this.allowFormView, unclaimedDraftCreateRequest.allowFormView) - && Objects.equals(this.attachments, unclaimedDraftCreateRequest.attachments) - && Objects.equals( - this.ccEmailAddresses, unclaimedDraftCreateRequest.ccEmailAddresses) - && Objects.equals(this.clientId, unclaimedDraftCreateRequest.clientId) - && Objects.equals(this.customFields, unclaimedDraftCreateRequest.customFields) - && Objects.equals(this.fieldOptions, unclaimedDraftCreateRequest.fieldOptions) - && Objects.equals(this.formFieldGroups, unclaimedDraftCreateRequest.formFieldGroups) - && Objects.equals(this.formFieldRules, unclaimedDraftCreateRequest.formFieldRules) - && Objects.equals( - this.formFieldsPerDocument, - unclaimedDraftCreateRequest.formFieldsPerDocument) - && Objects.equals(this.hideTextTags, unclaimedDraftCreateRequest.hideTextTags) - && Objects.equals(this.message, unclaimedDraftCreateRequest.message) - && Objects.equals(this.metadata, unclaimedDraftCreateRequest.metadata) - && Objects.equals( - this.showProgressStepper, unclaimedDraftCreateRequest.showProgressStepper) - && Objects.equals(this.signers, unclaimedDraftCreateRequest.signers) - && Objects.equals(this.signingOptions, unclaimedDraftCreateRequest.signingOptions) - && Objects.equals( - this.signingRedirectUrl, unclaimedDraftCreateRequest.signingRedirectUrl) - && Objects.equals(this.subject, unclaimedDraftCreateRequest.subject) - && Objects.equals(this.testMode, unclaimedDraftCreateRequest.testMode) - && Objects.equals( - this.usePreexistingFields, unclaimedDraftCreateRequest.usePreexistingFields) - && Objects.equals(this.useTextTags, unclaimedDraftCreateRequest.useTextTags) - && Objects.equals(this.expiresAt, unclaimedDraftCreateRequest.expiresAt); + if (useTextTags.getClass().equals(java.io.File.class) || + useTextTags.getClass().equals(Integer.class) || + useTextTags.getClass().equals(String.class) || + useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for(int i = 0; i< getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } + else { + map.put("use_text_tags", JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - type, - files, - fileUrls, - allowDecline, - allowFormView, - attachments, - ccEmailAddresses, - clientId, - customFields, - fieldOptions, - formFieldGroups, - formFieldRules, - formFieldsPerDocument, - hideTextTags, - message, - metadata, - showProgressStepper, - signers, - signingOptions, - signingRedirectUrl, - subject, - testMode, - usePreexistingFields, - useTextTags, - expiresAt); + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UnclaimedDraftCreateRequest {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" formFieldsPerDocument: ") - .append(toIndentedString(formFieldsPerDocument)) - .append("\n"); - sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" showProgressStepper: ") - .append(toIndentedString(showProgressStepper)) - .append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" usePreexistingFields: ") - .append(toIndentedString(usePreexistingFields)) - .append("\n"); - sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - - if (type.getClass().equals(java.io.File.class) - || type.getClass().equals(Integer.class) - || type.getClass().equals(String.class) - || type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for (int i = 0; i < getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - - if (files.getClass().equals(java.io.File.class) - || files.getClass().equals(Integer.class) - || files.getClass().equals(String.class) - || files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for (int i = 0; i < getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } - } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - - if (fileUrls.getClass().equals(java.io.File.class) - || fileUrls.getClass().equals(Integer.class) - || fileUrls.getClass().equals(String.class) - || fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for (int i = 0; i < getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } else { - map.put( - "file_urls", - JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } - } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - - if (allowDecline.getClass().equals(java.io.File.class) - || allowDecline.getClass().equals(Integer.class) - || allowDecline.getClass().equals(String.class) - || allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for (int i = 0; i < getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } else { - map.put( - "allow_decline", - JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } - } - if (allowFormView != null) { - if (isFileTypeOrListOfFiles(allowFormView)) { - fileTypeFound = true; - } - - if (allowFormView.getClass().equals(java.io.File.class) - || allowFormView.getClass().equals(Integer.class) - || allowFormView.getClass().equals(String.class) - || allowFormView.getClass().isEnum()) { - map.put("allow_form_view", allowFormView); - } else if (isListOfFile(allowFormView)) { - for (int i = 0; i < getListSize(allowFormView); i++) { - map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); - } - } else { - map.put( - "allow_form_view", - JSON.getDefault().getMapper().writeValueAsString(allowFormView)); - } - } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - - if (attachments.getClass().equals(java.io.File.class) - || attachments.getClass().equals(Integer.class) - || attachments.getClass().equals(String.class) - || attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for (int i = 0; i < getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } else { - map.put( - "attachments", - JSON.getDefault().getMapper().writeValueAsString(attachments)); - } - } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - - if (ccEmailAddresses.getClass().equals(java.io.File.class) - || ccEmailAddresses.getClass().equals(Integer.class) - || ccEmailAddresses.getClass().equals(String.class) - || ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for (int i = 0; i < getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } else { - map.put( - "cc_email_addresses", - JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } - } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - - if (customFields.getClass().equals(java.io.File.class) - || customFields.getClass().equals(Integer.class) - || customFields.getClass().equals(String.class) - || customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for (int i = 0; i < getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } else { - map.put( - "custom_fields", - JSON.getDefault().getMapper().writeValueAsString(customFields)); - } - } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - - if (fieldOptions.getClass().equals(java.io.File.class) - || fieldOptions.getClass().equals(Integer.class) - || fieldOptions.getClass().equals(String.class) - || fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for (int i = 0; i < getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } else { - map.put( - "field_options", - JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } - } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - - if (formFieldGroups.getClass().equals(java.io.File.class) - || formFieldGroups.getClass().equals(Integer.class) - || formFieldGroups.getClass().equals(String.class) - || formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for (int i = 0; i < getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } else { - map.put( - "form_field_groups", - JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } - } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - - if (formFieldRules.getClass().equals(java.io.File.class) - || formFieldRules.getClass().equals(Integer.class) - || formFieldRules.getClass().equals(String.class) - || formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for (int i = 0; i < getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } else { - map.put( - "form_field_rules", - JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } - } - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - - if (formFieldsPerDocument.getClass().equals(java.io.File.class) - || formFieldsPerDocument.getClass().equals(Integer.class) - || formFieldsPerDocument.getClass().equals(String.class) - || formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { - map.put( - "form_fields_per_document[" + i + "]", - getFromList(formFieldsPerDocument, i)); - } - } else { - map.put( - "form_fields_per_document", - JSON.getDefault() - .getMapper() - .writeValueAsString(formFieldsPerDocument)); - } - } - if (hideTextTags != null) { - if (isFileTypeOrListOfFiles(hideTextTags)) { - fileTypeFound = true; - } - - if (hideTextTags.getClass().equals(java.io.File.class) - || hideTextTags.getClass().equals(Integer.class) - || hideTextTags.getClass().equals(String.class) - || hideTextTags.getClass().isEnum()) { - map.put("hide_text_tags", hideTextTags); - } else if (isListOfFile(hideTextTags)) { - for (int i = 0; i < getListSize(hideTextTags); i++) { - map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); - } - } else { - map.put( - "hide_text_tags", - JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); - } - } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - - if (message.getClass().equals(java.io.File.class) - || message.getClass().equals(Integer.class) - || message.getClass().equals(String.class) - || message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for (int i = 0; i < getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } - } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - - if (metadata.getClass().equals(java.io.File.class) - || metadata.getClass().equals(Integer.class) - || metadata.getClass().equals(String.class) - || metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for (int i = 0; i < getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } - } - if (showProgressStepper != null) { - if (isFileTypeOrListOfFiles(showProgressStepper)) { - fileTypeFound = true; - } - - if (showProgressStepper.getClass().equals(java.io.File.class) - || showProgressStepper.getClass().equals(Integer.class) - || showProgressStepper.getClass().equals(String.class) - || showProgressStepper.getClass().isEnum()) { - map.put("show_progress_stepper", showProgressStepper); - } else if (isListOfFile(showProgressStepper)) { - for (int i = 0; i < getListSize(showProgressStepper); i++) { - map.put( - "show_progress_stepper[" + i + "]", - getFromList(showProgressStepper, i)); - } - } else { - map.put( - "show_progress_stepper", - JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); - } - } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - - if (signers.getClass().equals(java.io.File.class) - || signers.getClass().equals(Integer.class) - || signers.getClass().equals(String.class) - || signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for (int i = 0; i < getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } - } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - - if (signingOptions.getClass().equals(java.io.File.class) - || signingOptions.getClass().equals(Integer.class) - || signingOptions.getClass().equals(String.class) - || signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for (int i = 0; i < getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } else { - map.put( - "signing_options", - JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - - if (subject.getClass().equals(java.io.File.class) - || subject.getClass().equals(Integer.class) - || subject.getClass().equals(String.class) - || subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for (int i = 0; i < getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - if (usePreexistingFields != null) { - if (isFileTypeOrListOfFiles(usePreexistingFields)) { - fileTypeFound = true; - } - - if (usePreexistingFields.getClass().equals(java.io.File.class) - || usePreexistingFields.getClass().equals(Integer.class) - || usePreexistingFields.getClass().equals(String.class) - || usePreexistingFields.getClass().isEnum()) { - map.put("use_preexisting_fields", usePreexistingFields); - } else if (isListOfFile(usePreexistingFields)) { - for (int i = 0; i < getListSize(usePreexistingFields); i++) { - map.put( - "use_preexisting_fields[" + i + "]", - getFromList(usePreexistingFields, i)); - } - } else { - map.put( - "use_preexisting_fields", - JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); - } - } - if (useTextTags != null) { - if (isFileTypeOrListOfFiles(useTextTags)) { - fileTypeFound = true; - } - - if (useTextTags.getClass().equals(java.io.File.class) - || useTextTags.getClass().equals(Integer.class) - || useTextTags.getClass().equals(String.class) - || useTextTags.getClass().isEnum()) { - map.put("use_text_tags", useTextTags); - } else if (isListOfFile(useTextTags)) { - for (int i = 0; i < getListSize(useTextTags); i++) { - map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); - } - } else { - map.put( - "use_text_tags", - JSON.getDefault().getMapper().writeValueAsString(useTextTags)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java index f93c402e8..07db2641a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java @@ -10,222 +10,233 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.UnclaimedDraftResponse; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; -/** UnclaimedDraftCreateResponse */ + +import com.dropbox.sign.ApiException; +/** + * UnclaimedDraftCreateResponse + */ @JsonPropertyOrder({ - UnclaimedDraftCreateResponse.JSON_PROPERTY_UNCLAIMED_DRAFT, - UnclaimedDraftCreateResponse.JSON_PROPERTY_WARNINGS + UnclaimedDraftCreateResponse.JSON_PROPERTY_UNCLAIMED_DRAFT, + UnclaimedDraftCreateResponse.JSON_PROPERTY_WARNINGS }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class UnclaimedDraftCreateResponse { - public static final String JSON_PROPERTY_UNCLAIMED_DRAFT = "unclaimed_draft"; - @javax.annotation.Nonnull private UnclaimedDraftResponse unclaimedDraft; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @javax.annotation.Nullable private List warnings = null; - - public UnclaimedDraftCreateResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static UnclaimedDraftCreateResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateResponse.class); - } - - public static UnclaimedDraftCreateResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - UnclaimedDraftCreateResponse.class); - } - - public UnclaimedDraftCreateResponse unclaimedDraft( - @javax.annotation.Nonnull UnclaimedDraftResponse unclaimedDraft) { - this.unclaimedDraft = unclaimedDraft; - return this; - } - - /** - * Get unclaimedDraft - * - * @return unclaimedDraft - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public UnclaimedDraftResponse getUnclaimedDraft() { - return unclaimedDraft; - } - - @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setUnclaimedDraft(@javax.annotation.Nonnull UnclaimedDraftResponse unclaimedDraft) { - this.unclaimedDraft = unclaimedDraft; - } - - public UnclaimedDraftCreateResponse warnings( - @javax.annotation.Nullable List warnings) { - this.warnings = warnings; - return this; - } - - public UnclaimedDraftCreateResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_UNCLAIMED_DRAFT = "unclaimed_draft"; + @javax.annotation.Nonnull + private UnclaimedDraftResponse unclaimedDraft; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @javax.annotation.Nullable + private List warnings = null; + + public UnclaimedDraftCreateResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public UnclaimedDraftCreateResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateResponse.class); + } + + static public UnclaimedDraftCreateResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + UnclaimedDraftCreateResponse.class + ); + } + + public UnclaimedDraftCreateResponse unclaimedDraft(@javax.annotation.Nonnull UnclaimedDraftResponse unclaimedDraft) { + this.unclaimedDraft = unclaimedDraft; + return this; + } + + /** + * Get unclaimedDraft + * @return unclaimedDraft + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public UnclaimedDraftResponse getUnclaimedDraft() { + return unclaimedDraft; + } + + + @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUnclaimedDraft(@javax.annotation.Nonnull UnclaimedDraftResponse unclaimedDraft) { + this.unclaimedDraft = unclaimedDraft; + } + + + public UnclaimedDraftCreateResponse warnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public UnclaimedDraftCreateResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@javax.annotation.Nullable List warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this UnclaimedDraftCreateResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnclaimedDraftCreateResponse unclaimedDraftCreateResponse = (UnclaimedDraftCreateResponse) o; + return Objects.equals(this.unclaimedDraft, unclaimedDraftCreateResponse.unclaimedDraft) && + Objects.equals(this.warnings, unclaimedDraftCreateResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(unclaimedDraft, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnclaimedDraftCreateResponse {\n"); + sb.append(" unclaimedDraft: ").append(toIndentedString(unclaimedDraft)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (unclaimedDraft != null) { + if (isFileTypeOrListOfFiles(unclaimedDraft)) { + fileTypeFound = true; } - this.warnings.add(warningsItem); - return this; - } - /** - * A list of warnings. - * - * @return warnings - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWarnings() { - return warnings; - } - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(@javax.annotation.Nullable List warnings) { - this.warnings = warnings; - } - - /** Return true if this UnclaimedDraftCreateResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (unclaimedDraft.getClass().equals(java.io.File.class) || + unclaimedDraft.getClass().equals(Integer.class) || + unclaimedDraft.getClass().equals(String.class) || + unclaimedDraft.getClass().isEnum()) { + map.put("unclaimed_draft", unclaimedDraft); + } else if (isListOfFile(unclaimedDraft)) { + for(int i = 0; i< getListSize(unclaimedDraft); i++) { + map.put("unclaimed_draft[" + i + "]", getFromList(unclaimedDraft, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("unclaimed_draft", JSON.getDefault().getMapper().writeValueAsString(unclaimedDraft)); } - UnclaimedDraftCreateResponse unclaimedDraftCreateResponse = - (UnclaimedDraftCreateResponse) o; - return Objects.equals(this.unclaimedDraft, unclaimedDraftCreateResponse.unclaimedDraft) - && Objects.equals(this.warnings, unclaimedDraftCreateResponse.warnings); } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash(unclaimedDraft, warnings); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); + } + } + else { + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UnclaimedDraftCreateResponse {\n"); - sb.append(" unclaimedDraft: ").append(toIndentedString(unclaimedDraft)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (unclaimedDraft != null) { - if (isFileTypeOrListOfFiles(unclaimedDraft)) { - fileTypeFound = true; - } - - if (unclaimedDraft.getClass().equals(java.io.File.class) - || unclaimedDraft.getClass().equals(Integer.class) - || unclaimedDraft.getClass().equals(String.class) - || unclaimedDraft.getClass().isEnum()) { - map.put("unclaimed_draft", unclaimedDraft); - } else if (isListOfFile(unclaimedDraft)) { - for (int i = 0; i < getListSize(unclaimedDraft); i++) { - map.put("unclaimed_draft[" + i + "]", getFromList(unclaimedDraft, i)); - } - } else { - map.put( - "unclaimed_draft", - JSON.getDefault().getMapper().writeValueAsString(unclaimedDraft)); - } - } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; - } - - if (warnings.getClass().equals(java.io.File.class) - || warnings.getClass().equals(Integer.class) - || warnings.getClass().equals(String.class) - || warnings.getClass().isEnum()) { - map.put("warnings", warnings); - } else if (isListOfFile(warnings)) { - for (int i = 0; i < getListSize(warnings); i++) { - map.put("warnings[" + i + "]", getFromList(warnings, i)); - } - } else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java index adf4c94e6..f93b51612 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java @@ -10,555 +10,528 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.SubEditorOptions; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** UnclaimedDraftEditAndResendRequest */ + +import com.dropbox.sign.ApiException; +/** + * UnclaimedDraftEditAndResendRequest + */ @JsonPropertyOrder({ - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_CLIENT_ID, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_EDITOR_OPTIONS, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_REQUESTING_REDIRECT_URL, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_TEST_MODE + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_CLIENT_ID, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_EDITOR_OPTIONS, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_REQUESTING_REDIRECT_URL, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_TEST_MODE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class UnclaimedDraftEditAndResendRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - @javax.annotation.Nonnull private String clientId; - - public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; - @javax.annotation.Nullable private SubEditorOptions editorOptions; - - public static final String JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING = "is_for_embedded_signing"; - @javax.annotation.Nullable private Boolean isForEmbeddedSigning; - - public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; - @javax.annotation.Nullable private String requesterEmailAddress; - - public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; - @javax.annotation.Nullable private String requestingRedirectUrl; - - public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; - @javax.annotation.Nullable private Boolean showProgressStepper = true; - - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode = false; - - public UnclaimedDraftEditAndResendRequest() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static UnclaimedDraftEditAndResendRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, UnclaimedDraftEditAndResendRequest.class); - } - - public static UnclaimedDraftEditAndResendRequest init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), - UnclaimedDraftEditAndResendRequest.class); - } - - public UnclaimedDraftEditAndResendRequest clientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Client id of the app used to create the draft. Used to apply the branding and callback url - * defined for the app. - * - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientId() { - return clientId; - } - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(@javax.annotation.Nonnull String clientId) { - this.clientId = clientId; - } - - public UnclaimedDraftEditAndResendRequest editorOptions( - @javax.annotation.Nullable SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - return this; - } - - /** - * Get editorOptions - * - * @return editorOptions - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SubEditorOptions getEditorOptions() { - return editorOptions; - } - - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - } - - public UnclaimedDraftEditAndResendRequest isForEmbeddedSigning( - @javax.annotation.Nullable Boolean isForEmbeddedSigning) { - this.isForEmbeddedSigning = isForEmbeddedSigning; - return this; - } - - /** - * The request created from this draft will also be signable in embedded mode if set to - * `true`. - * - * @return isForEmbeddedSigning - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIsForEmbeddedSigning() { - return isForEmbeddedSigning; - } - - @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsForEmbeddedSigning(@javax.annotation.Nullable Boolean isForEmbeddedSigning) { - this.isForEmbeddedSigning = isForEmbeddedSigning; - } - - public UnclaimedDraftEditAndResendRequest requesterEmailAddress( - @javax.annotation.Nullable String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - return this; - } - - /** - * The email address of the user that should be designated as the requester of this draft. If - * not set, original requester's email address will be used. - * - * @return requesterEmailAddress - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRequesterEmailAddress() { - return requesterEmailAddress; - } - - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequesterEmailAddress(@javax.annotation.Nullable String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - } - - public UnclaimedDraftEditAndResendRequest requestingRedirectUrl( - @javax.annotation.Nullable String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully request a signature. - * - * @return requestingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRequestingRedirectUrl() { - return requestingRedirectUrl; - } - - @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequestingRedirectUrl(@javax.annotation.Nullable String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - } - - public UnclaimedDraftEditAndResendRequest showProgressStepper( - @javax.annotation.Nullable Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - return this; - } - - /** - * When only one step remains in the signature request process and this parameter is set to - * `false` then the progress stepper will be hidden. - * - * @return showProgressStepper - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getShowProgressStepper() { - return showProgressStepper; - } - - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - } + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + @javax.annotation.Nonnull + private String clientId; + + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; + @javax.annotation.Nullable + private SubEditorOptions editorOptions; + + public static final String JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING = "is_for_embedded_signing"; + @javax.annotation.Nullable + private Boolean isForEmbeddedSigning; + + public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; + @javax.annotation.Nullable + private String requesterEmailAddress; + + public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; + @javax.annotation.Nullable + private String requestingRedirectUrl; + + public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; + @javax.annotation.Nullable + private Boolean showProgressStepper = true; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode = false; + + public UnclaimedDraftEditAndResendRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public UnclaimedDraftEditAndResendRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, UnclaimedDraftEditAndResendRequest.class); + } + + static public UnclaimedDraftEditAndResendRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + UnclaimedDraftEditAndResendRequest.class + ); + } + + public UnclaimedDraftEditAndResendRequest clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public UnclaimedDraftEditAndResendRequest editorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + return this; + } + + /** + * Get editorOptions + * @return editorOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SubEditorOptions getEditorOptions() { + return editorOptions; + } + + + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditorOptions(@javax.annotation.Nullable SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + } + + + public UnclaimedDraftEditAndResendRequest isForEmbeddedSigning(@javax.annotation.Nullable Boolean isForEmbeddedSigning) { + this.isForEmbeddedSigning = isForEmbeddedSigning; + return this; + } + + /** + * The request created from this draft will also be signable in embedded mode if set to `true`. + * @return isForEmbeddedSigning + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsForEmbeddedSigning() { + return isForEmbeddedSigning; + } + + + @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsForEmbeddedSigning(@javax.annotation.Nullable Boolean isForEmbeddedSigning) { + this.isForEmbeddedSigning = isForEmbeddedSigning; + } + + + public UnclaimedDraftEditAndResendRequest requesterEmailAddress(@javax.annotation.Nullable String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + return this; + } + + /** + * The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used. + * @return requesterEmailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRequesterEmailAddress() { + return requesterEmailAddress; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequesterEmailAddress(@javax.annotation.Nullable String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + } + + + public UnclaimedDraftEditAndResendRequest requestingRedirectUrl(@javax.annotation.Nullable String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully request a signature. + * @return requestingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRequestingRedirectUrl() { + return requestingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestingRedirectUrl(@javax.annotation.Nullable String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + } + + + public UnclaimedDraftEditAndResendRequest showProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + return this; + } + + /** + * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. + * @return showProgressStepper + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getShowProgressStepper() { + return showProgressStepper; + } + + + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowProgressStepper(@javax.annotation.Nullable Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + } + + + public UnclaimedDraftEditAndResendRequest signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public UnclaimedDraftEditAndResendRequest testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + /** + * Return true if this UnclaimedDraftEditAndResendRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest = (UnclaimedDraftEditAndResendRequest) o; + return Objects.equals(this.clientId, unclaimedDraftEditAndResendRequest.clientId) && + Objects.equals(this.editorOptions, unclaimedDraftEditAndResendRequest.editorOptions) && + Objects.equals(this.isForEmbeddedSigning, unclaimedDraftEditAndResendRequest.isForEmbeddedSigning) && + Objects.equals(this.requesterEmailAddress, unclaimedDraftEditAndResendRequest.requesterEmailAddress) && + Objects.equals(this.requestingRedirectUrl, unclaimedDraftEditAndResendRequest.requestingRedirectUrl) && + Objects.equals(this.showProgressStepper, unclaimedDraftEditAndResendRequest.showProgressStepper) && + Objects.equals(this.signingRedirectUrl, unclaimedDraftEditAndResendRequest.signingRedirectUrl) && + Objects.equals(this.testMode, unclaimedDraftEditAndResendRequest.testMode); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, editorOptions, isForEmbeddedSigning, requesterEmailAddress, requestingRedirectUrl, showProgressStepper, signingRedirectUrl, testMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnclaimedDraftEditAndResendRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); + sb.append(" isForEmbeddedSigning: ").append(toIndentedString(isForEmbeddedSigning)).append("\n"); + sb.append(" requesterEmailAddress: ").append(toIndentedString(requesterEmailAddress)).append("\n"); + sb.append(" requestingRedirectUrl: ").append(toIndentedString(requestingRedirectUrl)).append("\n"); + sb.append(" showProgressStepper: ").append(toIndentedString(showProgressStepper)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } - public UnclaimedDraftEditAndResendRequest signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; + if (clientId.getClass().equals(java.io.File.class) || + clientId.getClass().equals(Integer.class) || + clientId.getClass().equals(String.class) || + clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for(int i = 0; i< getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } + else { + map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + } } + if (editorOptions != null) { + if (isFileTypeOrListOfFiles(editorOptions)) { + fileTypeFound = true; + } - /** - * The URL you want signers redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; + if (editorOptions.getClass().equals(java.io.File.class) || + editorOptions.getClass().equals(Integer.class) || + editorOptions.getClass().equals(String.class) || + editorOptions.getClass().isEnum()) { + map.put("editor_options", editorOptions); + } else if (isListOfFile(editorOptions)) { + for(int i = 0; i< getListSize(editorOptions); i++) { + map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); + } + } + else { + map.put("editor_options", JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + } } + if (isForEmbeddedSigning != null) { + if (isFileTypeOrListOfFiles(isForEmbeddedSigning)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; + if (isForEmbeddedSigning.getClass().equals(java.io.File.class) || + isForEmbeddedSigning.getClass().equals(Integer.class) || + isForEmbeddedSigning.getClass().equals(String.class) || + isForEmbeddedSigning.getClass().isEnum()) { + map.put("is_for_embedded_signing", isForEmbeddedSigning); + } else if (isListOfFile(isForEmbeddedSigning)) { + for(int i = 0; i< getListSize(isForEmbeddedSigning); i++) { + map.put("is_for_embedded_signing[" + i + "]", getFromList(isForEmbeddedSigning, i)); + } + } + else { + map.put("is_for_embedded_signing", JSON.getDefault().getMapper().writeValueAsString(isForEmbeddedSigning)); + } } + if (requesterEmailAddress != null) { + if (isFileTypeOrListOfFiles(requesterEmailAddress)) { + fileTypeFound = true; + } - public UnclaimedDraftEditAndResendRequest testMode( - @javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (requesterEmailAddress.getClass().equals(java.io.File.class) || + requesterEmailAddress.getClass().equals(Integer.class) || + requesterEmailAddress.getClass().equals(String.class) || + requesterEmailAddress.getClass().isEnum()) { + map.put("requester_email_address", requesterEmailAddress); + } else if (isListOfFile(requesterEmailAddress)) { + for(int i = 0; i< getListSize(requesterEmailAddress); i++) { + map.put("requester_email_address[" + i + "]", getFromList(requesterEmailAddress, i)); + } + } + else { + map.put("requester_email_address", JSON.getDefault().getMapper().writeValueAsString(requesterEmailAddress)); + } } + if (requestingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { + fileTypeFound = true; + } - /** - * Whether this is a test, the signature request created from this draft will not be legally - * binding if set to `true`. Defaults to `false`. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (requestingRedirectUrl.getClass().equals(java.io.File.class) || + requestingRedirectUrl.getClass().equals(Integer.class) || + requestingRedirectUrl.getClass().equals(String.class) || + requestingRedirectUrl.getClass().isEnum()) { + map.put("requesting_redirect_url", requestingRedirectUrl); + } else if (isListOfFile(requestingRedirectUrl)) { + for(int i = 0; i< getListSize(requestingRedirectUrl); i++) { + map.put("requesting_redirect_url[" + i + "]", getFromList(requestingRedirectUrl, i)); + } + } + else { + map.put("requesting_redirect_url", JSON.getDefault().getMapper().writeValueAsString(requestingRedirectUrl)); + } } + if (showProgressStepper != null) { + if (isFileTypeOrListOfFiles(showProgressStepper)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (showProgressStepper.getClass().equals(java.io.File.class) || + showProgressStepper.getClass().equals(Integer.class) || + showProgressStepper.getClass().equals(String.class) || + showProgressStepper.getClass().isEnum()) { + map.put("show_progress_stepper", showProgressStepper); + } else if (isListOfFile(showProgressStepper)) { + for(int i = 0; i< getListSize(showProgressStepper); i++) { + map.put("show_progress_stepper[" + i + "]", getFromList(showProgressStepper, i)); + } + } + else { + map.put("show_progress_stepper", JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - /** Return true if this UnclaimedDraftEditAndResendRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); } - UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest = - (UnclaimedDraftEditAndResendRequest) o; - return Objects.equals(this.clientId, unclaimedDraftEditAndResendRequest.clientId) - && Objects.equals( - this.editorOptions, unclaimedDraftEditAndResendRequest.editorOptions) - && Objects.equals( - this.isForEmbeddedSigning, - unclaimedDraftEditAndResendRequest.isForEmbeddedSigning) - && Objects.equals( - this.requesterEmailAddress, - unclaimedDraftEditAndResendRequest.requesterEmailAddress) - && Objects.equals( - this.requestingRedirectUrl, - unclaimedDraftEditAndResendRequest.requestingRedirectUrl) - && Objects.equals( - this.showProgressStepper, - unclaimedDraftEditAndResendRequest.showProgressStepper) - && Objects.equals( - this.signingRedirectUrl, - unclaimedDraftEditAndResendRequest.signingRedirectUrl) - && Objects.equals(this.testMode, unclaimedDraftEditAndResendRequest.testMode); } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - clientId, - editorOptions, - isForEmbeddedSigning, - requesterEmailAddress, - requestingRedirectUrl, - showProgressStepper, - signingRedirectUrl, - testMode); + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UnclaimedDraftEditAndResendRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); - sb.append(" isForEmbeddedSigning: ") - .append(toIndentedString(isForEmbeddedSigning)) - .append("\n"); - sb.append(" requesterEmailAddress: ") - .append(toIndentedString(requesterEmailAddress)) - .append("\n"); - sb.append(" requestingRedirectUrl: ") - .append(toIndentedString(requestingRedirectUrl)) - .append("\n"); - sb.append(" showProgressStepper: ") - .append(toIndentedString(showProgressStepper)) - .append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - - if (clientId.getClass().equals(java.io.File.class) - || clientId.getClass().equals(Integer.class) - || clientId.getClass().equals(String.class) - || clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for (int i = 0; i < getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } else { - map.put( - "client_id", - JSON.getDefault().getMapper().writeValueAsString(clientId)); - } - } - if (editorOptions != null) { - if (isFileTypeOrListOfFiles(editorOptions)) { - fileTypeFound = true; - } - - if (editorOptions.getClass().equals(java.io.File.class) - || editorOptions.getClass().equals(Integer.class) - || editorOptions.getClass().equals(String.class) - || editorOptions.getClass().isEnum()) { - map.put("editor_options", editorOptions); - } else if (isListOfFile(editorOptions)) { - for (int i = 0; i < getListSize(editorOptions); i++) { - map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); - } - } else { - map.put( - "editor_options", - JSON.getDefault().getMapper().writeValueAsString(editorOptions)); - } - } - if (isForEmbeddedSigning != null) { - if (isFileTypeOrListOfFiles(isForEmbeddedSigning)) { - fileTypeFound = true; - } - - if (isForEmbeddedSigning.getClass().equals(java.io.File.class) - || isForEmbeddedSigning.getClass().equals(Integer.class) - || isForEmbeddedSigning.getClass().equals(String.class) - || isForEmbeddedSigning.getClass().isEnum()) { - map.put("is_for_embedded_signing", isForEmbeddedSigning); - } else if (isListOfFile(isForEmbeddedSigning)) { - for (int i = 0; i < getListSize(isForEmbeddedSigning); i++) { - map.put( - "is_for_embedded_signing[" + i + "]", - getFromList(isForEmbeddedSigning, i)); - } - } else { - map.put( - "is_for_embedded_signing", - JSON.getDefault().getMapper().writeValueAsString(isForEmbeddedSigning)); - } - } - if (requesterEmailAddress != null) { - if (isFileTypeOrListOfFiles(requesterEmailAddress)) { - fileTypeFound = true; - } - - if (requesterEmailAddress.getClass().equals(java.io.File.class) - || requesterEmailAddress.getClass().equals(Integer.class) - || requesterEmailAddress.getClass().equals(String.class) - || requesterEmailAddress.getClass().isEnum()) { - map.put("requester_email_address", requesterEmailAddress); - } else if (isListOfFile(requesterEmailAddress)) { - for (int i = 0; i < getListSize(requesterEmailAddress); i++) { - map.put( - "requester_email_address[" + i + "]", - getFromList(requesterEmailAddress, i)); - } - } else { - map.put( - "requester_email_address", - JSON.getDefault() - .getMapper() - .writeValueAsString(requesterEmailAddress)); - } - } - if (requestingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { - fileTypeFound = true; - } - - if (requestingRedirectUrl.getClass().equals(java.io.File.class) - || requestingRedirectUrl.getClass().equals(Integer.class) - || requestingRedirectUrl.getClass().equals(String.class) - || requestingRedirectUrl.getClass().isEnum()) { - map.put("requesting_redirect_url", requestingRedirectUrl); - } else if (isListOfFile(requestingRedirectUrl)) { - for (int i = 0; i < getListSize(requestingRedirectUrl); i++) { - map.put( - "requesting_redirect_url[" + i + "]", - getFromList(requestingRedirectUrl, i)); - } - } else { - map.put( - "requesting_redirect_url", - JSON.getDefault() - .getMapper() - .writeValueAsString(requestingRedirectUrl)); - } - } - if (showProgressStepper != null) { - if (isFileTypeOrListOfFiles(showProgressStepper)) { - fileTypeFound = true; - } - - if (showProgressStepper.getClass().equals(java.io.File.class) - || showProgressStepper.getClass().equals(Integer.class) - || showProgressStepper.getClass().equals(String.class) - || showProgressStepper.getClass().isEnum()) { - map.put("show_progress_stepper", showProgressStepper); - } else if (isListOfFile(showProgressStepper)) { - for (int i = 0; i < getListSize(showProgressStepper); i++) { - map.put( - "show_progress_stepper[" + i + "]", - getFromList(showProgressStepper, i)); - } - } else { - map.put( - "show_progress_stepper", - JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java index cf497fce5..03c0906a5 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java @@ -10,427 +10,425 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** A group of documents that a user can take ownership of via the claim URL. */ + +import com.dropbox.sign.ApiException; +/** + * A group of documents that a user can take ownership of via the claim URL. + */ @JsonPropertyOrder({ - UnclaimedDraftResponse.JSON_PROPERTY_SIGNATURE_REQUEST_ID, - UnclaimedDraftResponse.JSON_PROPERTY_CLAIM_URL, - UnclaimedDraftResponse.JSON_PROPERTY_SIGNING_REDIRECT_URL, - UnclaimedDraftResponse.JSON_PROPERTY_REQUESTING_REDIRECT_URL, - UnclaimedDraftResponse.JSON_PROPERTY_EXPIRES_AT, - UnclaimedDraftResponse.JSON_PROPERTY_TEST_MODE + UnclaimedDraftResponse.JSON_PROPERTY_SIGNATURE_REQUEST_ID, + UnclaimedDraftResponse.JSON_PROPERTY_CLAIM_URL, + UnclaimedDraftResponse.JSON_PROPERTY_SIGNING_REDIRECT_URL, + UnclaimedDraftResponse.JSON_PROPERTY_REQUESTING_REDIRECT_URL, + UnclaimedDraftResponse.JSON_PROPERTY_EXPIRES_AT, + UnclaimedDraftResponse.JSON_PROPERTY_TEST_MODE }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class UnclaimedDraftResponse { - public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; - @javax.annotation.Nullable private String signatureRequestId; - - public static final String JSON_PROPERTY_CLAIM_URL = "claim_url"; - @javax.annotation.Nullable private String claimUrl; - - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - @javax.annotation.Nullable private String signingRedirectUrl; - - public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; - @javax.annotation.Nullable private String requestingRedirectUrl; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @javax.annotation.Nullable private Integer expiresAt; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - @javax.annotation.Nullable private Boolean testMode; - - public UnclaimedDraftResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static UnclaimedDraftResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, UnclaimedDraftResponse.class); + public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; + @javax.annotation.Nullable + private String signatureRequestId; + + public static final String JSON_PROPERTY_CLAIM_URL = "claim_url"; + @javax.annotation.Nullable + private String claimUrl; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + @javax.annotation.Nullable + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; + @javax.annotation.Nullable + private String requestingRedirectUrl; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + @javax.annotation.Nullable + private Integer expiresAt; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + @javax.annotation.Nullable + private Boolean testMode; + + public UnclaimedDraftResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public UnclaimedDraftResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, UnclaimedDraftResponse.class); + } + + static public UnclaimedDraftResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + UnclaimedDraftResponse.class + ); + } + + public UnclaimedDraftResponse signatureRequestId(@javax.annotation.Nullable String signatureRequestId) { + this.signatureRequestId = signatureRequestId; + return this; + } + + /** + * The ID of the signature request that is represented by this UnclaimedDraft. + * @return signatureRequestId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSignatureRequestId() { + return signatureRequestId; + } + + + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatureRequestId(@javax.annotation.Nullable String signatureRequestId) { + this.signatureRequestId = signatureRequestId; + } + + + public UnclaimedDraftResponse claimUrl(@javax.annotation.Nullable String claimUrl) { + this.claimUrl = claimUrl; + return this; + } + + /** + * The URL to be used to claim this UnclaimedDraft. + * @return claimUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLAIM_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClaimUrl() { + return claimUrl; + } + + + @JsonProperty(JSON_PROPERTY_CLAIM_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClaimUrl(@javax.annotation.Nullable String claimUrl) { + this.claimUrl = claimUrl; + } + + + public UnclaimedDraftResponse signingRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * @return signingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + + public UnclaimedDraftResponse requestingRedirectUrl(@javax.annotation.Nullable String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.). + * @return requestingRedirectUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRequestingRedirectUrl() { + return requestingRedirectUrl; + } + + + @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestingRedirectUrl(@javax.annotation.Nullable String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + } + + + public UnclaimedDraftResponse expiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the link expires. + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { + this.expiresAt = expiresAt; + } + + + public UnclaimedDraftResponse testMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test draft. Signature requests made from test drafts have no legal value. + * @return testMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getTestMode() { + return testMode; + } + + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(@javax.annotation.Nullable Boolean testMode) { + this.testMode = testMode; + } + + + /** + * Return true if this UnclaimedDraftResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public static UnclaimedDraftResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue( - new ObjectMapper().writeValueAsString(data), UnclaimedDraftResponse.class); - } - - public UnclaimedDraftResponse signatureRequestId( - @javax.annotation.Nullable String signatureRequestId) { - this.signatureRequestId = signatureRequestId; - return this; - } - - /** - * The ID of the signature request that is represented by this UnclaimedDraft. - * - * @return signatureRequestId - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSignatureRequestId() { - return signatureRequestId; - } - - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatureRequestId(@javax.annotation.Nullable String signatureRequestId) { - this.signatureRequestId = signatureRequestId; - } - - public UnclaimedDraftResponse claimUrl(@javax.annotation.Nullable String claimUrl) { - this.claimUrl = claimUrl; - return this; - } - - /** - * The URL to be used to claim this UnclaimedDraft. - * - * @return claimUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLAIM_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClaimUrl() { - return claimUrl; - } - - @JsonProperty(JSON_PROPERTY_CLAIM_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClaimUrl(@javax.annotation.Nullable String claimUrl) { - this.claimUrl = claimUrl; - } - - public UnclaimedDraftResponse signingRedirectUrl( - @javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully sign. - * - * @return signingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(@javax.annotation.Nullable String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - public UnclaimedDraftResponse requestingRedirectUrl( - @javax.annotation.Nullable String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully request a signature (Will only - * be returned in the response if it is applicable to the request.). - * - * @return requestingRedirectUrl - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRequestingRedirectUrl() { - return requestingRedirectUrl; - } - - @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequestingRedirectUrl(@javax.annotation.Nullable String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - } - - public UnclaimedDraftResponse expiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * When the link expires. - * - * @return expiresAt - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getExpiresAt() { - return expiresAt; + if (o == null || getClass() != o.getClass()) { + return false; } + UnclaimedDraftResponse unclaimedDraftResponse = (UnclaimedDraftResponse) o; + return Objects.equals(this.signatureRequestId, unclaimedDraftResponse.signatureRequestId) && + Objects.equals(this.claimUrl, unclaimedDraftResponse.claimUrl) && + Objects.equals(this.signingRedirectUrl, unclaimedDraftResponse.signingRedirectUrl) && + Objects.equals(this.requestingRedirectUrl, unclaimedDraftResponse.requestingRedirectUrl) && + Objects.equals(this.expiresAt, unclaimedDraftResponse.expiresAt) && + Objects.equals(this.testMode, unclaimedDraftResponse.testMode); + } + + @Override + public int hashCode() { + return Objects.hash(signatureRequestId, claimUrl, signingRedirectUrl, requestingRedirectUrl, expiresAt, testMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnclaimedDraftResponse {\n"); + sb.append(" signatureRequestId: ").append(toIndentedString(signatureRequestId)).append("\n"); + sb.append(" claimUrl: ").append(toIndentedString(claimUrl)).append("\n"); + sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); + sb.append(" requestingRedirectUrl: ").append(toIndentedString(requestingRedirectUrl)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (signatureRequestId != null) { + if (isFileTypeOrListOfFiles(signatureRequestId)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@javax.annotation.Nullable Integer expiresAt) { - this.expiresAt = expiresAt; + if (signatureRequestId.getClass().equals(java.io.File.class) || + signatureRequestId.getClass().equals(Integer.class) || + signatureRequestId.getClass().equals(String.class) || + signatureRequestId.getClass().isEnum()) { + map.put("signature_request_id", signatureRequestId); + } else if (isListOfFile(signatureRequestId)) { + for(int i = 0; i< getListSize(signatureRequestId); i++) { + map.put("signature_request_id[" + i + "]", getFromList(signatureRequestId, i)); + } + } + else { + map.put("signature_request_id", JSON.getDefault().getMapper().writeValueAsString(signatureRequestId)); + } } + if (claimUrl != null) { + if (isFileTypeOrListOfFiles(claimUrl)) { + fileTypeFound = true; + } - public UnclaimedDraftResponse testMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; - return this; + if (claimUrl.getClass().equals(java.io.File.class) || + claimUrl.getClass().equals(Integer.class) || + claimUrl.getClass().equals(String.class) || + claimUrl.getClass().isEnum()) { + map.put("claim_url", claimUrl); + } else if (isListOfFile(claimUrl)) { + for(int i = 0; i< getListSize(claimUrl); i++) { + map.put("claim_url[" + i + "]", getFromList(claimUrl, i)); + } + } + else { + map.put("claim_url", JSON.getDefault().getMapper().writeValueAsString(claimUrl)); + } } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } - /** - * Whether this is a test draft. Signature requests made from test drafts have no legal value. - * - * @return testMode - */ - @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTestMode() { - return testMode; + if (signingRedirectUrl.getClass().equals(java.io.File.class) || + signingRedirectUrl.getClass().equals(Integer.class) || + signingRedirectUrl.getClass().equals(String.class) || + signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for(int i = 0; i< getListSize(signingRedirectUrl); i++) { + map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); + } + } + else { + map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } } + if (requestingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(@javax.annotation.Nullable Boolean testMode) { - this.testMode = testMode; + if (requestingRedirectUrl.getClass().equals(java.io.File.class) || + requestingRedirectUrl.getClass().equals(Integer.class) || + requestingRedirectUrl.getClass().equals(String.class) || + requestingRedirectUrl.getClass().isEnum()) { + map.put("requesting_redirect_url", requestingRedirectUrl); + } else if (isListOfFile(requestingRedirectUrl)) { + for(int i = 0; i< getListSize(requestingRedirectUrl); i++) { + map.put("requesting_redirect_url[" + i + "]", getFromList(requestingRedirectUrl, i)); + } + } + else { + map.put("requesting_redirect_url", JSON.getDefault().getMapper().writeValueAsString(requestingRedirectUrl)); + } } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } - /** Return true if this UnclaimedDraftResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (expiresAt.getClass().equals(java.io.File.class) || + expiresAt.getClass().equals(Integer.class) || + expiresAt.getClass().equals(String.class) || + expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for(int i = 0; i< getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); } - UnclaimedDraftResponse unclaimedDraftResponse = (UnclaimedDraftResponse) o; - return Objects.equals(this.signatureRequestId, unclaimedDraftResponse.signatureRequestId) - && Objects.equals(this.claimUrl, unclaimedDraftResponse.claimUrl) - && Objects.equals( - this.signingRedirectUrl, unclaimedDraftResponse.signingRedirectUrl) - && Objects.equals( - this.requestingRedirectUrl, unclaimedDraftResponse.requestingRedirectUrl) - && Objects.equals(this.expiresAt, unclaimedDraftResponse.expiresAt) - && Objects.equals(this.testMode, unclaimedDraftResponse.testMode); } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } - @Override - public int hashCode() { - return Objects.hash( - signatureRequestId, - claimUrl, - signingRedirectUrl, - requestingRedirectUrl, - expiresAt, - testMode); + if (testMode.getClass().equals(java.io.File.class) || + testMode.getClass().equals(Integer.class) || + testMode.getClass().equals(String.class) || + testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for(int i = 0; i< getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } + else { + map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + } } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UnclaimedDraftResponse {\n"); - sb.append(" signatureRequestId: ") - .append(toIndentedString(signatureRequestId)) - .append("\n"); - sb.append(" claimUrl: ").append(toIndentedString(claimUrl)).append("\n"); - sb.append(" signingRedirectUrl: ") - .append(toIndentedString(signingRedirectUrl)) - .append("\n"); - sb.append(" requestingRedirectUrl: ") - .append(toIndentedString(requestingRedirectUrl)) - .append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append("}"); - return sb.toString(); + } catch (Exception e) { + throw new ApiException(e); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (signatureRequestId != null) { - if (isFileTypeOrListOfFiles(signatureRequestId)) { - fileTypeFound = true; - } - - if (signatureRequestId.getClass().equals(java.io.File.class) - || signatureRequestId.getClass().equals(Integer.class) - || signatureRequestId.getClass().equals(String.class) - || signatureRequestId.getClass().isEnum()) { - map.put("signature_request_id", signatureRequestId); - } else if (isListOfFile(signatureRequestId)) { - for (int i = 0; i < getListSize(signatureRequestId); i++) { - map.put( - "signature_request_id[" + i + "]", - getFromList(signatureRequestId, i)); - } - } else { - map.put( - "signature_request_id", - JSON.getDefault().getMapper().writeValueAsString(signatureRequestId)); - } - } - if (claimUrl != null) { - if (isFileTypeOrListOfFiles(claimUrl)) { - fileTypeFound = true; - } - - if (claimUrl.getClass().equals(java.io.File.class) - || claimUrl.getClass().equals(Integer.class) - || claimUrl.getClass().equals(String.class) - || claimUrl.getClass().isEnum()) { - map.put("claim_url", claimUrl); - } else if (isListOfFile(claimUrl)) { - for (int i = 0; i < getListSize(claimUrl); i++) { - map.put("claim_url[" + i + "]", getFromList(claimUrl, i)); - } - } else { - map.put( - "claim_url", - JSON.getDefault().getMapper().writeValueAsString(claimUrl)); - } - } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - - if (signingRedirectUrl.getClass().equals(java.io.File.class) - || signingRedirectUrl.getClass().equals(Integer.class) - || signingRedirectUrl.getClass().equals(String.class) - || signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for (int i = 0; i < getListSize(signingRedirectUrl); i++) { - map.put( - "signing_redirect_url[" + i + "]", - getFromList(signingRedirectUrl, i)); - } - } else { - map.put( - "signing_redirect_url", - JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } - } - if (requestingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { - fileTypeFound = true; - } - - if (requestingRedirectUrl.getClass().equals(java.io.File.class) - || requestingRedirectUrl.getClass().equals(Integer.class) - || requestingRedirectUrl.getClass().equals(String.class) - || requestingRedirectUrl.getClass().isEnum()) { - map.put("requesting_redirect_url", requestingRedirectUrl); - } else if (isListOfFile(requestingRedirectUrl)) { - for (int i = 0; i < getListSize(requestingRedirectUrl); i++) { - map.put( - "requesting_redirect_url[" + i + "]", - getFromList(requestingRedirectUrl, i)); - } - } else { - map.put( - "requesting_redirect_url", - JSON.getDefault() - .getMapper() - .writeValueAsString(requestingRedirectUrl)); - } - } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - - if (expiresAt.getClass().equals(java.io.File.class) - || expiresAt.getClass().equals(Integer.class) - || expiresAt.getClass().equals(String.class) - || expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for (int i = 0; i < getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } else { - map.put( - "expires_at", - JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } - } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - - if (testMode.getClass().equals(java.io.File.class) - || testMode.getClass().equals(Integer.class) - || testMode.getClass().equals(String.class) - || testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for (int i = 0; i < getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } else { - map.put( - "test_mode", - JSON.getDefault().getMapper().writeValueAsString(testMode)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + return fileTypeFound ? map : new HashMap<>(); + } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/WarningResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/WarningResponse.java index df3fc0502..231e6af05 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/WarningResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/WarningResponse.java @@ -10,210 +10,221 @@ * Do not edit the class manually. */ + package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import com.dropbox.sign.JSON; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -/** A list of warnings. */ + +import com.dropbox.sign.ApiException; +/** + * A list of warnings. + */ @JsonPropertyOrder({ - WarningResponse.JSON_PROPERTY_WARNING_MSG, - WarningResponse.JSON_PROPERTY_WARNING_NAME + WarningResponse.JSON_PROPERTY_WARNING_MSG, + WarningResponse.JSON_PROPERTY_WARNING_NAME }) -@javax.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -@JsonIgnoreProperties(ignoreUnknown = true) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) public class WarningResponse { - public static final String JSON_PROPERTY_WARNING_MSG = "warning_msg"; - @javax.annotation.Nonnull private String warningMsg; - - public static final String JSON_PROPERTY_WARNING_NAME = "warning_name"; - @javax.annotation.Nonnull private String warningName; - - public WarningResponse() {} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * - * @param jsonData String of JSON data representing target object - */ - public static WarningResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, WarningResponse.class); - } - - public static WarningResponse init(HashMap data) throws Exception { - return new ObjectMapper() - .readValue(new ObjectMapper().writeValueAsString(data), WarningResponse.class); - } - - public WarningResponse warningMsg(@javax.annotation.Nonnull String warningMsg) { - this.warningMsg = warningMsg; - return this; - } - - /** - * Warning message - * - * @return warningMsg - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_WARNING_MSG) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getWarningMsg() { - return warningMsg; - } - - @JsonProperty(JSON_PROPERTY_WARNING_MSG) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setWarningMsg(@javax.annotation.Nonnull String warningMsg) { - this.warningMsg = warningMsg; - } - - public WarningResponse warningName(@javax.annotation.Nonnull String warningName) { - this.warningName = warningName; - return this; - } - - /** - * Warning name - * - * @return warningName - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_WARNING_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getWarningName() { - return warningName; - } + public static final String JSON_PROPERTY_WARNING_MSG = "warning_msg"; + @javax.annotation.Nonnull + private String warningMsg; + + public static final String JSON_PROPERTY_WARNING_NAME = "warning_name"; + @javax.annotation.Nonnull + private String warningName; + + public WarningResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public WarningResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, WarningResponse.class); + } + + static public WarningResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + WarningResponse.class + ); + } + + public WarningResponse warningMsg(@javax.annotation.Nonnull String warningMsg) { + this.warningMsg = warningMsg; + return this; + } + + /** + * Warning message + * @return warningMsg + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WARNING_MSG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getWarningMsg() { + return warningMsg; + } + + + @JsonProperty(JSON_PROPERTY_WARNING_MSG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWarningMsg(@javax.annotation.Nonnull String warningMsg) { + this.warningMsg = warningMsg; + } + + + public WarningResponse warningName(@javax.annotation.Nonnull String warningName) { + this.warningName = warningName; + return this; + } + + /** + * Warning name + * @return warningName + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WARNING_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getWarningName() { + return warningName; + } + + + @JsonProperty(JSON_PROPERTY_WARNING_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWarningName(@javax.annotation.Nonnull String warningName) { + this.warningName = warningName; + } + + + /** + * Return true if this WarningResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WarningResponse warningResponse = (WarningResponse) o; + return Objects.equals(this.warningMsg, warningResponse.warningMsg) && + Objects.equals(this.warningName, warningResponse.warningName); + } + + @Override + public int hashCode() { + return Objects.hash(warningMsg, warningName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WarningResponse {\n"); + sb.append(" warningMsg: ").append(toIndentedString(warningMsg)).append("\n"); + sb.append(" warningName: ").append(toIndentedString(warningName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (warningMsg != null) { + if (isFileTypeOrListOfFiles(warningMsg)) { + fileTypeFound = true; + } - @JsonProperty(JSON_PROPERTY_WARNING_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setWarningName(@javax.annotation.Nonnull String warningName) { - this.warningName = warningName; + if (warningMsg.getClass().equals(java.io.File.class) || + warningMsg.getClass().equals(Integer.class) || + warningMsg.getClass().equals(String.class) || + warningMsg.getClass().isEnum()) { + map.put("warning_msg", warningMsg); + } else if (isListOfFile(warningMsg)) { + for(int i = 0; i< getListSize(warningMsg); i++) { + map.put("warning_msg[" + i + "]", getFromList(warningMsg, i)); + } + } + else { + map.put("warning_msg", JSON.getDefault().getMapper().writeValueAsString(warningMsg)); + } } + if (warningName != null) { + if (isFileTypeOrListOfFiles(warningName)) { + fileTypeFound = true; + } - /** Return true if this WarningResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + if (warningName.getClass().equals(java.io.File.class) || + warningName.getClass().equals(Integer.class) || + warningName.getClass().equals(String.class) || + warningName.getClass().isEnum()) { + map.put("warning_name", warningName); + } else if (isListOfFile(warningName)) { + for(int i = 0; i< getListSize(warningName); i++) { + map.put("warning_name[" + i + "]", getFromList(warningName, i)); + } } - if (o == null || getClass() != o.getClass()) { - return false; + else { + map.put("warning_name", JSON.getDefault().getMapper().writeValueAsString(warningName)); } - WarningResponse warningResponse = (WarningResponse) o; - return Objects.equals(this.warningMsg, warningResponse.warningMsg) - && Objects.equals(this.warningName, warningResponse.warningName); } - - @Override - public int hashCode() { - return Objects.hash(warningMsg, warningName); + } catch (Exception e) { + throw new ApiException(e); } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WarningResponse {\n"); - sb.append(" warningMsg: ").append(toIndentedString(warningMsg)).append("\n"); - sb.append(" warningName: ").append(toIndentedString(warningName)).append("\n"); - sb.append("}"); - return sb.toString(); - } + return fileTypeFound ? map : new HashMap<>(); + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (warningMsg != null) { - if (isFileTypeOrListOfFiles(warningMsg)) { - fileTypeFound = true; - } - - if (warningMsg.getClass().equals(java.io.File.class) - || warningMsg.getClass().equals(Integer.class) - || warningMsg.getClass().equals(String.class) - || warningMsg.getClass().isEnum()) { - map.put("warning_msg", warningMsg); - } else if (isListOfFile(warningMsg)) { - for (int i = 0; i < getListSize(warningMsg); i++) { - map.put("warning_msg[" + i + "]", getFromList(warningMsg, i)); - } - } else { - map.put( - "warning_msg", - JSON.getDefault().getMapper().writeValueAsString(warningMsg)); - } - } - if (warningName != null) { - if (isFileTypeOrListOfFiles(warningName)) { - fileTypeFound = true; - } - - if (warningName.getClass().equals(java.io.File.class) - || warningName.getClass().equals(Integer.class) - || warningName.getClass().equals(String.class) - || warningName.getClass().isEnum()) { - map.put("warning_name", warningName); - } else if (isListOfFile(warningName)) { - for (int i = 0; i < getListSize(warningName); i++) { - map.put("warning_name[" + i + "]", getFromList(warningName, i)); - } - } else { - map.put( - "warning_name", - JSON.getDefault().getMapper().writeValueAsString(warningName)); - } - } - } catch (Exception e) { - throw new ApiException(e); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - return fileTypeFound ? map : new HashMap<>(); - } - - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List - && !isListEmpty(obj) - && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) - Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()) - .getMethod("get", int.class) - .invoke(obj, index); - } + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } + diff --git a/sdks/java-v2/README.md b/sdks/java-v2/README.md index bf70604a9..b3f0bfef4 100644 --- a/sdks/java-v2/README.md +++ b/sdks/java-v2/README.md @@ -212,6 +212,7 @@ Class | Method | HTTP request | Description *TemplateApi* | [**templateCreate**](docs/TemplateApi.md#templateCreate) | **POST** /template/create | Create Template *TemplateApi* | [**templateCreateEmbeddedDraft**](docs/TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft *TemplateApi* | [**templateDelete**](docs/TemplateApi.md#templateDelete) | **POST** /template/delete/{template_id} | Delete Template +*TemplateApi* | [**templateEdit**](docs/TemplateApi.md#templateEdit) | **POST** /template/edit/{template_id} | _t__TemplateEdit::SUMMARY *TemplateApi* | [**templateFiles**](docs/TemplateApi.md#templateFiles) | **GET** /template/files/{template_id} | Get Template Files *TemplateApi* | [**templateFilesAsDataUri**](docs/TemplateApi.md#templateFilesAsDataUri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri *TemplateApi* | [**templateFilesAsFileUrl**](docs/TemplateApi.md#templateFilesAsFileUrl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url @@ -375,7 +376,9 @@ Class | Method | HTTP request | Description - [TemplateCreateRequest](docs/TemplateCreateRequest.md) - [TemplateCreateResponse](docs/TemplateCreateResponse.md) - [TemplateCreateResponseTemplate](docs/TemplateCreateResponseTemplate.md) + - [TemplateEditRequest](docs/TemplateEditRequest.md) - [TemplateEditResponse](docs/TemplateEditResponse.md) + - [TemplateEditResponseTemplate](docs/TemplateEditResponseTemplate.md) - [TemplateGetResponse](docs/TemplateGetResponse.md) - [TemplateListResponse](docs/TemplateListResponse.md) - [TemplateRemoveUserRequest](docs/TemplateRemoveUserRequest.md) diff --git a/sdks/java-v2/docs/TemplateApi.md b/sdks/java-v2/docs/TemplateApi.md index dd470487b..5febb2b2b 100644 --- a/sdks/java-v2/docs/TemplateApi.md +++ b/sdks/java-v2/docs/TemplateApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://api.hellosign.com/v3* [**templateCreate**](TemplateApi.md#templateCreate) | **POST** /template/create | Create Template [**templateCreateEmbeddedDraft**](TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft [**templateDelete**](TemplateApi.md#templateDelete) | **POST** /template/delete/{template_id} | Delete Template +[**templateEdit**](TemplateApi.md#templateEdit) | **POST** /template/edit/{template_id} | _t__TemplateEdit::SUMMARY [**templateFiles**](TemplateApi.md#templateFiles) | **GET** /template/files/{template_id} | Get Template Files [**templateFilesAsDataUri**](TemplateApi.md#templateFilesAsDataUri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri [**templateFilesAsFileUrl**](TemplateApi.md#templateFilesAsFileUrl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url @@ -473,6 +474,48 @@ null (empty response body) | **4XX** | failed_operation | - | +## templateEdit + +> TemplateEditResponse templateEdit(templateId, templateEditRequest) + +_t__TemplateEdit::SUMMARY + +_t__TemplateEdit::DESCRIPTION + +### Example + +```java +REPLACE_ME_WITH_EXAMPLE_FOR__templateEdit_Java_CODE +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| + **templateId** | **String**| _t__TemplateEdit::TEMPLATE_ID | + **templateEditRequest** | [**TemplateEditRequest**](TemplateEditRequest.md)| | + +### Return type + +[**TemplateEditResponse**](TemplateEditResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json, multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + + ## templateFiles > File templateFiles(templateId, fileType) diff --git a/sdks/java-v2/docs/TemplateEditRequest.md b/sdks/java-v2/docs/TemplateEditRequest.md new file mode 100644 index 000000000..fd40d7f32 --- /dev/null +++ b/sdks/java-v2/docs/TemplateEditRequest.md @@ -0,0 +1,18 @@ + + +# TemplateEditRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `ccRoles` | ```List``` | _t__TemplateEdit::CC_ROLES | | +| `allowFormView` | ```Boolean``` | _t__TemplateEdit::ALLOW_FORM_VIEW | | +| `title` | ```String``` | _t__TemplateEdit::TITLE | | +| `subject` | ```String``` | _t__TemplateEdit::SUBJECT | | +| `message` | ```String``` | _t__TemplateEdit::MESSAGE | | + + + diff --git a/sdks/java-v2/docs/TemplateEditResponse.md b/sdks/java-v2/docs/TemplateEditResponse.md index 88d225e68..355f185da 100644 --- a/sdks/java-v2/docs/TemplateEditResponse.md +++ b/sdks/java-v2/docs/TemplateEditResponse.md @@ -8,7 +8,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| `templateId`*_required_ | ```String``` | The id of the Template. | | +| `template` | [```TemplateEditResponseTemplate```](TemplateEditResponseTemplate.md) | | | +| `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/TemplateEditResponseTemplate.md b/sdks/java-v2/docs/TemplateEditResponseTemplate.md new file mode 100644 index 000000000..91cd0ad8a --- /dev/null +++ b/sdks/java-v2/docs/TemplateEditResponseTemplate.md @@ -0,0 +1,14 @@ + + +# TemplateEditResponseTemplate + +_t__TemplateEditResponseTemplate::DESCRIPTION + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `templateId` | ```String``` | The id of the Template. | | + + + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/api/TemplateApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/TemplateApi.java index 974e61c40..14e5eb1f4 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/TemplateApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/TemplateApi.java @@ -17,6 +17,8 @@ import com.dropbox.sign.model.TemplateCreateEmbeddedDraftResponse; import com.dropbox.sign.model.TemplateCreateRequest; import com.dropbox.sign.model.TemplateCreateResponse; +import com.dropbox.sign.model.TemplateEditRequest; +import com.dropbox.sign.model.TemplateEditResponse; import com.dropbox.sign.model.TemplateGetResponse; import com.dropbox.sign.model.TemplateListResponse; import com.dropbox.sign.model.TemplateRemoveUserRequest; @@ -322,6 +324,78 @@ public ApiResponse templateDeleteWithHttpInfo(String templateId) throws Ap false ); } + /** + * _t__TemplateEdit::SUMMARY + * _t__TemplateEdit::DESCRIPTION + * @param templateId _t__TemplateEdit::TEMPLATE_ID (required) + * @param templateEditRequest (required) + * @return TemplateEditResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TemplateEditResponse templateEdit(String templateId, TemplateEditRequest templateEditRequest) throws ApiException { + return templateEditWithHttpInfo(templateId, templateEditRequest).getData(); + } + + + /** + * _t__TemplateEdit::SUMMARY + * _t__TemplateEdit::DESCRIPTION + * @param templateId _t__TemplateEdit::TEMPLATE_ID (required) + * @param templateEditRequest (required) + * @return ApiResponse<TemplateEditResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateEditWithHttpInfo(String templateId, TemplateEditRequest templateEditRequest) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateEdit"); + } + if (templateEditRequest == null) { + throw new ApiException(400, "Missing the required parameter 'templateEditRequest' when calling templateEdit"); + } + + // Path parameters + String localVarPath = "/template/edit/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = templateEditRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateEdit", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateEditRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } /** * Get Template Files * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java index 096164a36..0accdd9fe 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java @@ -50,10 +50,8 @@ public class SubFormFieldRuleAction { */ public enum TypeEnum { CHANGE_FIELD_VISIBILITY(String.valueOf("change-field-visibility")), - FIELD_VISIBILITY(String.valueOf("change-field-visibility")), - CHANGE_GROUP_VISIBILITY(String.valueOf("change-group-visibility")), - GROUP_VISIBILITY(String.valueOf("change-group-visibility")); + CHANGE_GROUP_VISIBILITY(String.valueOf("change-group-visibility")); private String value; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditRequest.java new file mode 100644 index 000000000..b3899d2eb --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditRequest.java @@ -0,0 +1,393 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * TemplateEditRequest + */ +@JsonPropertyOrder({ + TemplateEditRequest.JSON_PROPERTY_CC_ROLES, + TemplateEditRequest.JSON_PROPERTY_ALLOW_FORM_VIEW, + TemplateEditRequest.JSON_PROPERTY_TITLE, + TemplateEditRequest.JSON_PROPERTY_SUBJECT, + TemplateEditRequest.JSON_PROPERTY_MESSAGE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateEditRequest { + public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; + @jakarta.annotation.Nullable + private List ccRoles = null; + + public static final String JSON_PROPERTY_ALLOW_FORM_VIEW = "allow_form_view"; + @jakarta.annotation.Nullable + private Boolean allowFormView; + + public static final String JSON_PROPERTY_TITLE = "title"; + @jakarta.annotation.Nullable + private String title; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + @jakarta.annotation.Nullable + private String subject; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @jakarta.annotation.Nullable + private String message; + + public TemplateEditRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateEditRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateEditRequest.class); + } + + static public TemplateEditRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateEditRequest.class + ); + } + + public TemplateEditRequest ccRoles(@jakarta.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + return this; + } + + public TemplateEditRequest addCcRolesItem(String ccRolesItem) { + if (this.ccRoles == null) { + this.ccRoles = new ArrayList<>(); + } + this.ccRoles.add(ccRolesItem); + return this; + } + + /** + * _t__TemplateEdit::CC_ROLES + * @return ccRoles + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCcRoles() { + return ccRoles; + } + + + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcRoles(@jakarta.annotation.Nullable List ccRoles) { + this.ccRoles = ccRoles; + } + + + public TemplateEditRequest allowFormView(@jakarta.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + return this; + } + + /** + * _t__TemplateEdit::ALLOW_FORM_VIEW + * @return allowFormView + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowFormView() { + return allowFormView; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FORM_VIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFormView(@jakarta.annotation.Nullable Boolean allowFormView) { + this.allowFormView = allowFormView; + } + + + public TemplateEditRequest title(@jakarta.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * _t__TemplateEdit::TITLE + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTitle() { + return title; + } + + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(@jakarta.annotation.Nullable String title) { + this.title = title; + } + + + public TemplateEditRequest subject(@jakarta.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * _t__TemplateEdit::SUBJECT + * @return subject + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(@jakarta.annotation.Nullable String subject) { + this.subject = subject; + } + + + public TemplateEditRequest message(@jakarta.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * _t__TemplateEdit::MESSAGE + * @return message + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@jakarta.annotation.Nullable String message) { + this.message = message; + } + + + /** + * Return true if this TemplateEditRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateEditRequest templateEditRequest = (TemplateEditRequest) o; + return Objects.equals(this.ccRoles, templateEditRequest.ccRoles) && + Objects.equals(this.allowFormView, templateEditRequest.allowFormView) && + Objects.equals(this.title, templateEditRequest.title) && + Objects.equals(this.subject, templateEditRequest.subject) && + Objects.equals(this.message, templateEditRequest.message); + } + + @Override + public int hashCode() { + return Objects.hash(ccRoles, allowFormView, title, subject, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateEditRequest {\n"); + sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); + sb.append(" allowFormView: ").append(toIndentedString(allowFormView)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (ccRoles != null) { + if (isFileTypeOrListOfFiles(ccRoles)) { + fileTypeFound = true; + } + + if (ccRoles.getClass().equals(java.io.File.class) || + ccRoles.getClass().equals(Integer.class) || + ccRoles.getClass().equals(String.class) || + ccRoles.getClass().isEnum()) { + map.put("cc_roles", ccRoles); + } else if (isListOfFile(ccRoles)) { + for(int i = 0; i< getListSize(ccRoles); i++) { + map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); + } + } + else { + map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + } + } + if (allowFormView != null) { + if (isFileTypeOrListOfFiles(allowFormView)) { + fileTypeFound = true; + } + + if (allowFormView.getClass().equals(java.io.File.class) || + allowFormView.getClass().equals(Integer.class) || + allowFormView.getClass().equals(String.class) || + allowFormView.getClass().isEnum()) { + map.put("allow_form_view", allowFormView); + } else if (isListOfFile(allowFormView)) { + for(int i = 0; i< getListSize(allowFormView); i++) { + map.put("allow_form_view[" + i + "]", getFromList(allowFormView, i)); + } + } + else { + map.put("allow_form_view", JSON.getDefault().getMapper().writeValueAsString(allowFormView)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) || + title.getClass().equals(Integer.class) || + title.getClass().equals(String.class) || + title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for(int i = 0; i< getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } + else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) || + subject.getClass().equals(Integer.class) || + subject.getClass().equals(String.class) || + subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for(int i = 0; i< getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } + else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) || + message.getClass().equals(Integer.class) || + message.getClass().equals(String.class) || + message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for(int i = 0; i< getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } + else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java index 866a87fa3..9a2fbeaea 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java @@ -16,12 +16,16 @@ import java.util.Objects; import java.util.Map; import java.util.HashMap; +import com.dropbox.sign.model.TemplateEditResponseTemplate; +import com.dropbox.sign.model.WarningResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -33,14 +37,19 @@ * TemplateEditResponse */ @JsonPropertyOrder({ - TemplateEditResponse.JSON_PROPERTY_TEMPLATE_ID + TemplateEditResponse.JSON_PROPERTY_TEMPLATE, + TemplateEditResponse.JSON_PROPERTY_WARNINGS }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") @JsonIgnoreProperties(ignoreUnknown=true) public class TemplateEditResponse { - public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; - @jakarta.annotation.Nonnull - private String templateId; + public static final String JSON_PROPERTY_TEMPLATE = "template"; + @jakarta.annotation.Nullable + private TemplateEditResponseTemplate template; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @jakarta.annotation.Nullable + private List warnings = null; public TemplateEditResponse() { } @@ -60,28 +69,61 @@ static public TemplateEditResponse init(HashMap data) throws Exception { ); } - public TemplateEditResponse templateId(@jakarta.annotation.Nonnull String templateId) { - this.templateId = templateId; + public TemplateEditResponse template(@jakarta.annotation.Nullable TemplateEditResponseTemplate template) { + this.template = template; return this; } /** - * The id of the Template. - * @return templateId + * Get template + * @return template */ - @jakarta.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTemplateId() { - return templateId; + public TemplateEditResponseTemplate getTemplate() { + return template; } - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateId(@jakarta.annotation.Nonnull String templateId) { - this.templateId = templateId; + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplate(@jakarta.annotation.Nullable TemplateEditResponseTemplate template) { + this.template = template; + } + + + public TemplateEditResponse warnings(@jakarta.annotation.Nullable List warnings) { + this.warnings = warnings; + return this; + } + + public TemplateEditResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); + } + this.warnings.add(warningsItem); + return this; + } + + /** + * A list of warnings. + * @return warnings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(@jakarta.annotation.Nullable List warnings) { + this.warnings = warnings; } @@ -97,19 +139,21 @@ public boolean equals(Object o) { return false; } TemplateEditResponse templateEditResponse = (TemplateEditResponse) o; - return Objects.equals(this.templateId, templateEditResponse.templateId); + return Objects.equals(this.template, templateEditResponse.template) && + Objects.equals(this.warnings, templateEditResponse.warnings); } @Override public int hashCode() { - return Objects.hash(templateId); + return Objects.hash(template, warnings); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TemplateEditResponse {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); sb.append("}"); return sb.toString(); } @@ -118,23 +162,42 @@ public Map createFormData() throws ApiException { Map map = new HashMap<>(); boolean fileTypeFound = false; try { - if (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { + if (template != null) { + if (isFileTypeOrListOfFiles(template)) { + fileTypeFound = true; + } + + if (template.getClass().equals(java.io.File.class) || + template.getClass().equals(Integer.class) || + template.getClass().equals(String.class) || + template.getClass().isEnum()) { + map.put("template", template); + } else if (isListOfFile(template)) { + for(int i = 0; i< getListSize(template); i++) { + map.put("template[" + i + "]", getFromList(template, i)); + } + } + else { + map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); + } + } + if (warnings != null) { + if (isFileTypeOrListOfFiles(warnings)) { fileTypeFound = true; } - if (templateId.getClass().equals(java.io.File.class) || - templateId.getClass().equals(Integer.class) || - templateId.getClass().equals(String.class) || - templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for(int i = 0; i< getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); + if (warnings.getClass().equals(java.io.File.class) || + warnings.getClass().equals(Integer.class) || + warnings.getClass().equals(String.class) || + warnings.getClass().isEnum()) { + map.put("warnings", warnings); + } else if (isListOfFile(warnings)) { + for(int i = 0; i< getListSize(warnings); i++) { + map.put("warnings[" + i + "]", getFromList(warnings, i)); } } else { - map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); + map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); } } } catch (Exception e) { diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponseTemplate.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponseTemplate.java new file mode 100644 index 000000000..d2703f848 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponseTemplate.java @@ -0,0 +1,179 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * _t__TemplateEditResponseTemplate::DESCRIPTION + */ +@JsonPropertyOrder({ + TemplateEditResponseTemplate.JSON_PROPERTY_TEMPLATE_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateEditResponseTemplate { + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + @jakarta.annotation.Nullable + private String templateId; + + public TemplateEditResponseTemplate() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public TemplateEditResponseTemplate init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateEditResponseTemplate.class); + } + + static public TemplateEditResponseTemplate init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + TemplateEditResponseTemplate.class + ); + } + + public TemplateEditResponseTemplate templateId(@jakarta.annotation.Nullable String templateId) { + this.templateId = templateId; + return this; + } + + /** + * The id of the Template. + * @return templateId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTemplateId() { + return templateId; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(@jakarta.annotation.Nullable String templateId) { + this.templateId = templateId; + } + + + /** + * Return true if this TemplateEditResponseTemplate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateEditResponseTemplate templateEditResponseTemplate = (TemplateEditResponseTemplate) o; + return Objects.equals(this.templateId, templateEditResponseTemplate.templateId); + } + + @Override + public int hashCode() { + return Objects.hash(templateId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateEditResponseTemplate {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateId != null) { + if (isFileTypeOrListOfFiles(templateId)) { + fileTypeFound = true; + } + + if (templateId.getClass().equals(java.io.File.class) || + templateId.getClass().equals(Integer.class) || + templateId.getClass().equals(String.class) || + templateId.getClass().isEnum()) { + map.put("template_id", templateId); + } else if (isListOfFile(templateId)) { + for(int i = 0; i< getListSize(templateId); i++) { + map.put("template_id[" + i + "]", getFromList(templateId, i)); + } + } + else { + map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdks/node/README.md b/sdks/node/README.md index 93d2bfdfd..5c2ae2475 100644 --- a/sdks/node/README.md +++ b/sdks/node/README.md @@ -141,6 +141,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | *TemplateApi* | [**templateCreate**](./docs/api/TemplateApi.md#templatecreate) | **POST** /template/create | Create Template | | *TemplateApi* | [**templateCreateEmbeddedDraft**](./docs/api/TemplateApi.md#templatecreateembeddeddraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft | | *TemplateApi* | [**templateDelete**](./docs/api/TemplateApi.md#templatedelete) | **POST** /template/delete/{template_id} | Delete Template | +| *TemplateApi* | [**templateEdit**](./docs/api/TemplateApi.md#templateedit) | **POST** /template/edit/{template_id} | _t__TemplateEdit::SUMMARY | | *TemplateApi* | [**templateFiles**](./docs/api/TemplateApi.md#templatefiles) | **GET** /template/files/{template_id} | Get Template Files | | *TemplateApi* | [**templateFilesAsDataUri**](./docs/api/TemplateApi.md#templatefilesasdatauri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri | | *TemplateApi* | [**templateFilesAsFileUrl**](./docs/api/TemplateApi.md#templatefilesasfileurl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url | @@ -303,7 +304,9 @@ All URIs are relative to *https://api.hellosign.com/v3* - [TemplateCreateRequest](./docs/model/TemplateCreateRequest.md) - [TemplateCreateResponse](./docs/model/TemplateCreateResponse.md) - [TemplateCreateResponseTemplate](./docs/model/TemplateCreateResponseTemplate.md) +- [TemplateEditRequest](./docs/model/TemplateEditRequest.md) - [TemplateEditResponse](./docs/model/TemplateEditResponse.md) +- [TemplateEditResponseTemplate](./docs/model/TemplateEditResponseTemplate.md) - [TemplateGetResponse](./docs/model/TemplateGetResponse.md) - [TemplateListResponse](./docs/model/TemplateListResponse.md) - [TemplateRemoveUserRequest](./docs/model/TemplateRemoveUserRequest.md) diff --git a/sdks/node/api/templateApi.ts b/sdks/node/api/templateApi.ts index 35ac24648..8c61e07ac 100644 --- a/sdks/node/api/templateApi.ts +++ b/sdks/node/api/templateApi.ts @@ -37,6 +37,8 @@ import { TemplateCreateEmbeddedDraftResponse, TemplateCreateRequest, TemplateCreateResponse, + TemplateEditRequest, + TemplateEditResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, @@ -688,6 +690,165 @@ export class TemplateApi { }); }); } + /** + * _t__TemplateEdit::DESCRIPTION + * @summary _t__TemplateEdit::SUMMARY + * @param templateId _t__TemplateEdit::TEMPLATE_ID + * @param templateEditRequest + * @param options + */ + public async templateEdit( + templateId: string, + templateEditRequest: TemplateEditRequest, + options: optionsI = { headers: {} } + ): Promise> { + templateEditRequest = deserializeIfNeeded( + templateEditRequest, + "TemplateEditRequest" + ); + const localVarPath = + this.basePath + + "/template/edit/{template_id}".replace( + "{" + "template_id" + "}", + encodeURIComponent(String(templateId)) + ); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + // give precedence to 'application/json' + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams: any = {}; + let localVarBodyParams: any = undefined; + + // verify required parameter 'templateId' is not null or undefined + if (templateId === null || templateId === undefined) { + throw new Error( + "Required parameter templateId was null or undefined when calling templateEdit." + ); + } + + // verify required parameter 'templateEditRequest' is not null or undefined + if (templateEditRequest === null || templateEditRequest === undefined) { + throw new Error( + "Required parameter templateEditRequest was null or undefined when calling templateEdit." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + const result = generateFormData( + templateEditRequest, + TemplateEditRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + + let data = {}; + if (localVarUseFormData) { + const formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize( + templateEditRequest, + "TemplateEditRequest" + ); + } + + let localVarRequestOptions: AxiosRequestConfig = { + method: "POST", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then(() => + this.authentications.default.applyToRequest(localVarRequestOptions) + ); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => + interceptor(localVarRequestOptions) + ); + } + + return interceptorPromise.then(() => { + return new Promise>( + (resolve, reject) => { + axios.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse( + resolve, + reject, + response, + "TemplateEditResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "TemplateEditResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + } + ); + }); + } /** * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. * @summary Get Template Files diff --git a/sdks/node/dist/api.js b/sdks/node/dist/api.js deleted file mode 100644 index f8478972a..000000000 --- a/sdks/node/dist/api.js +++ /dev/null @@ -1,36635 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all3) => { - for (var name in all3) - __defProp(target, name, { get: all3[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/delayed-stream/lib/delayed_stream.js -var require_delayed_stream = __commonJS({ - "node_modules/delayed-stream/lib/delayed_stream.js"(exports2, module2) { - var Stream = require("stream").Stream; - var util3 = require("util"); - module2.exports = DelayedStream; - function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; - } - util3.inherits(DelayedStream, Stream); - DelayedStream.create = function(source, options) { - var delayedStream = new this(); - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - delayedStream.source = source; - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - source.on("error", function() { - }); - if (delayedStream.pauseStream) { - source.pause(); - } - return delayedStream; - }; - Object.defineProperty(DelayedStream.prototype, "readable", { - configurable: true, - enumerable: true, - get: function() { - return this.source.readable; - } - }); - DelayedStream.prototype.setEncoding = function() { - return this.source.setEncoding.apply(this.source, arguments); - }; - DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - this.source.resume(); - }; - DelayedStream.prototype.pause = function() { - this.source.pause(); - }; - DelayedStream.prototype.release = function() { - this._released = true; - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; - }; - DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; - }; - DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - if (args[0] === "data") { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - this._bufferedEvents.push(args); - }; - DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - if (this.dataSize <= this.maxDataSize) { - return; - } - this._maxDataSizeExceeded = true; - var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; - this.emit("error", new Error(message)); - }; - } -}); - -// node_modules/combined-stream/lib/combined_stream.js -var require_combined_stream = __commonJS({ - "node_modules/combined-stream/lib/combined_stream.js"(exports2, module2) { - var util3 = require("util"); - var Stream = require("stream").Stream; - var DelayedStream = require_delayed_stream(); - module2.exports = CombinedStream; - function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - this._released = false; - this._streams = []; - this._currentStream = null; - this._insideLoop = false; - this._pendingNext = false; - } - util3.inherits(CombinedStream, Stream); - CombinedStream.create = function(options) { - var combinedStream = new this(); - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - return combinedStream; - }; - CombinedStream.isStreamLike = function(stream4) { - return typeof stream4 !== "function" && typeof stream4 !== "string" && typeof stream4 !== "boolean" && typeof stream4 !== "number" && !Buffer.isBuffer(stream4); - }; - CombinedStream.prototype.append = function(stream4) { - var isStreamLike = CombinedStream.isStreamLike(stream4); - if (isStreamLike) { - if (!(stream4 instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream4, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams - }); - stream4.on("data", this._checkDataSize.bind(this)); - stream4 = newStream; - } - this._handleErrors(stream4); - if (this.pauseStreams) { - stream4.pause(); - } - } - this._streams.push(stream4); - return this; - }; - CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; - }; - CombinedStream.prototype._getNext = function() { - this._currentStream = null; - if (this._insideLoop) { - this._pendingNext = true; - return; - } - this._insideLoop = true; - try { - do { - this._pendingNext = false; - this._realGetNext(); - } while (this._pendingNext); - } finally { - this._insideLoop = false; - } - }; - CombinedStream.prototype._realGetNext = function() { - var stream4 = this._streams.shift(); - if (typeof stream4 == "undefined") { - this.end(); - return; - } - if (typeof stream4 !== "function") { - this._pipeNext(stream4); - return; - } - var getStream = stream4; - getStream(function(stream5) { - var isStreamLike = CombinedStream.isStreamLike(stream5); - if (isStreamLike) { - stream5.on("data", this._checkDataSize.bind(this)); - this._handleErrors(stream5); - } - this._pipeNext(stream5); - }.bind(this)); - }; - CombinedStream.prototype._pipeNext = function(stream4) { - this._currentStream = stream4; - var isStreamLike = CombinedStream.isStreamLike(stream4); - if (isStreamLike) { - stream4.on("end", this._getNext.bind(this)); - stream4.pipe(this, { end: false }); - return; - } - var value = stream4; - this.write(value); - this._getNext(); - }; - CombinedStream.prototype._handleErrors = function(stream4) { - var self2 = this; - stream4.on("error", function(err) { - self2._emitError(err); - }); - }; - CombinedStream.prototype.write = function(data) { - this.emit("data", data); - }; - CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause(); - this.emit("pause"); - }; - CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume(); - this.emit("resume"); - }; - CombinedStream.prototype.end = function() { - this._reset(); - this.emit("end"); - }; - CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit("close"); - }; - CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; - }; - CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; - this._emitError(new Error(message)); - }; - CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - var self2 = this; - this._streams.forEach(function(stream4) { - if (!stream4.dataSize) { - return; - } - self2.dataSize += stream4.dataSize; - }); - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } - }; - CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit("error", err); - }; - } -}); - -// node_modules/mime-db/db.json -var require_db = __commonJS({ - "node_modules/mime-db/db.json"(exports2, module2) { - module2.exports = { - "application/1d-interleaved-parityfec": { - source: "iana" - }, - "application/3gpdash-qoe-report+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/3gpp-ims+xml": { - source: "iana", - compressible: true - }, - "application/3gpphal+json": { - source: "iana", - compressible: true - }, - "application/3gpphalforms+json": { - source: "iana", - compressible: true - }, - "application/a2l": { - source: "iana" - }, - "application/ace+cbor": { - source: "iana" - }, - "application/activemessage": { - source: "iana" - }, - "application/activity+json": { - source: "iana", - compressible: true - }, - "application/alto-costmap+json": { - source: "iana", - compressible: true - }, - "application/alto-costmapfilter+json": { - source: "iana", - compressible: true - }, - "application/alto-directory+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointcost+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointcostparams+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointprop+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointpropparams+json": { - source: "iana", - compressible: true - }, - "application/alto-error+json": { - source: "iana", - compressible: true - }, - "application/alto-networkmap+json": { - source: "iana", - compressible: true - }, - "application/alto-networkmapfilter+json": { - source: "iana", - compressible: true - }, - "application/alto-updatestreamcontrol+json": { - source: "iana", - compressible: true - }, - "application/alto-updatestreamparams+json": { - source: "iana", - compressible: true - }, - "application/aml": { - source: "iana" - }, - "application/andrew-inset": { - source: "iana", - extensions: ["ez"] - }, - "application/applefile": { - source: "iana" - }, - "application/applixware": { - source: "apache", - extensions: ["aw"] - }, - "application/at+jwt": { - source: "iana" - }, - "application/atf": { - source: "iana" - }, - "application/atfx": { - source: "iana" - }, - "application/atom+xml": { - source: "iana", - compressible: true, - extensions: ["atom"] - }, - "application/atomcat+xml": { - source: "iana", - compressible: true, - extensions: ["atomcat"] - }, - "application/atomdeleted+xml": { - source: "iana", - compressible: true, - extensions: ["atomdeleted"] - }, - "application/atomicmail": { - source: "iana" - }, - "application/atomsvc+xml": { - source: "iana", - compressible: true, - extensions: ["atomsvc"] - }, - "application/atsc-dwd+xml": { - source: "iana", - compressible: true, - extensions: ["dwd"] - }, - "application/atsc-dynamic-event-message": { - source: "iana" - }, - "application/atsc-held+xml": { - source: "iana", - compressible: true, - extensions: ["held"] - }, - "application/atsc-rdt+json": { - source: "iana", - compressible: true - }, - "application/atsc-rsat+xml": { - source: "iana", - compressible: true, - extensions: ["rsat"] - }, - "application/atxml": { - source: "iana" - }, - "application/auth-policy+xml": { - source: "iana", - compressible: true - }, - "application/bacnet-xdd+zip": { - source: "iana", - compressible: false - }, - "application/batch-smtp": { - source: "iana" - }, - "application/bdoc": { - compressible: false, - extensions: ["bdoc"] - }, - "application/beep+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/calendar+json": { - source: "iana", - compressible: true - }, - "application/calendar+xml": { - source: "iana", - compressible: true, - extensions: ["xcs"] - }, - "application/call-completion": { - source: "iana" - }, - "application/cals-1840": { - source: "iana" - }, - "application/captive+json": { - source: "iana", - compressible: true - }, - "application/cbor": { - source: "iana" - }, - "application/cbor-seq": { - source: "iana" - }, - "application/cccex": { - source: "iana" - }, - "application/ccmp+xml": { - source: "iana", - compressible: true - }, - "application/ccxml+xml": { - source: "iana", - compressible: true, - extensions: ["ccxml"] - }, - "application/cdfx+xml": { - source: "iana", - compressible: true, - extensions: ["cdfx"] - }, - "application/cdmi-capability": { - source: "iana", - extensions: ["cdmia"] - }, - "application/cdmi-container": { - source: "iana", - extensions: ["cdmic"] - }, - "application/cdmi-domain": { - source: "iana", - extensions: ["cdmid"] - }, - "application/cdmi-object": { - source: "iana", - extensions: ["cdmio"] - }, - "application/cdmi-queue": { - source: "iana", - extensions: ["cdmiq"] - }, - "application/cdni": { - source: "iana" - }, - "application/cea": { - source: "iana" - }, - "application/cea-2018+xml": { - source: "iana", - compressible: true - }, - "application/cellml+xml": { - source: "iana", - compressible: true - }, - "application/cfw": { - source: "iana" - }, - "application/city+json": { - source: "iana", - compressible: true - }, - "application/clr": { - source: "iana" - }, - "application/clue+xml": { - source: "iana", - compressible: true - }, - "application/clue_info+xml": { - source: "iana", - compressible: true - }, - "application/cms": { - source: "iana" - }, - "application/cnrp+xml": { - source: "iana", - compressible: true - }, - "application/coap-group+json": { - source: "iana", - compressible: true - }, - "application/coap-payload": { - source: "iana" - }, - "application/commonground": { - source: "iana" - }, - "application/conference-info+xml": { - source: "iana", - compressible: true - }, - "application/cose": { - source: "iana" - }, - "application/cose-key": { - source: "iana" - }, - "application/cose-key-set": { - source: "iana" - }, - "application/cpl+xml": { - source: "iana", - compressible: true, - extensions: ["cpl"] - }, - "application/csrattrs": { - source: "iana" - }, - "application/csta+xml": { - source: "iana", - compressible: true - }, - "application/cstadata+xml": { - source: "iana", - compressible: true - }, - "application/csvm+json": { - source: "iana", - compressible: true - }, - "application/cu-seeme": { - source: "apache", - extensions: ["cu"] - }, - "application/cwt": { - source: "iana" - }, - "application/cybercash": { - source: "iana" - }, - "application/dart": { - compressible: true - }, - "application/dash+xml": { - source: "iana", - compressible: true, - extensions: ["mpd"] - }, - "application/dash-patch+xml": { - source: "iana", - compressible: true, - extensions: ["mpp"] - }, - "application/dashdelta": { - source: "iana" - }, - "application/davmount+xml": { - source: "iana", - compressible: true, - extensions: ["davmount"] - }, - "application/dca-rft": { - source: "iana" - }, - "application/dcd": { - source: "iana" - }, - "application/dec-dx": { - source: "iana" - }, - "application/dialog-info+xml": { - source: "iana", - compressible: true - }, - "application/dicom": { - source: "iana" - }, - "application/dicom+json": { - source: "iana", - compressible: true - }, - "application/dicom+xml": { - source: "iana", - compressible: true - }, - "application/dii": { - source: "iana" - }, - "application/dit": { - source: "iana" - }, - "application/dns": { - source: "iana" - }, - "application/dns+json": { - source: "iana", - compressible: true - }, - "application/dns-message": { - source: "iana" - }, - "application/docbook+xml": { - source: "apache", - compressible: true, - extensions: ["dbk"] - }, - "application/dots+cbor": { - source: "iana" - }, - "application/dskpp+xml": { - source: "iana", - compressible: true - }, - "application/dssc+der": { - source: "iana", - extensions: ["dssc"] - }, - "application/dssc+xml": { - source: "iana", - compressible: true, - extensions: ["xdssc"] - }, - "application/dvcs": { - source: "iana" - }, - "application/ecmascript": { - source: "iana", - compressible: true, - extensions: ["es", "ecma"] - }, - "application/edi-consent": { - source: "iana" - }, - "application/edi-x12": { - source: "iana", - compressible: false - }, - "application/edifact": { - source: "iana", - compressible: false - }, - "application/efi": { - source: "iana" - }, - "application/elm+json": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/elm+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.cap+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/emergencycalldata.comment+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.control+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.deviceinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.ecall.msd": { - source: "iana" - }, - "application/emergencycalldata.providerinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.serviceinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.subscriberinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.veds+xml": { - source: "iana", - compressible: true - }, - "application/emma+xml": { - source: "iana", - compressible: true, - extensions: ["emma"] - }, - "application/emotionml+xml": { - source: "iana", - compressible: true, - extensions: ["emotionml"] - }, - "application/encaprtp": { - source: "iana" - }, - "application/epp+xml": { - source: "iana", - compressible: true - }, - "application/epub+zip": { - source: "iana", - compressible: false, - extensions: ["epub"] - }, - "application/eshop": { - source: "iana" - }, - "application/exi": { - source: "iana", - extensions: ["exi"] - }, - "application/expect-ct-report+json": { - source: "iana", - compressible: true - }, - "application/express": { - source: "iana", - extensions: ["exp"] - }, - "application/fastinfoset": { - source: "iana" - }, - "application/fastsoap": { - source: "iana" - }, - "application/fdt+xml": { - source: "iana", - compressible: true, - extensions: ["fdt"] - }, - "application/fhir+json": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/fhir+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/fido.trusted-apps+json": { - compressible: true - }, - "application/fits": { - source: "iana" - }, - "application/flexfec": { - source: "iana" - }, - "application/font-sfnt": { - source: "iana" - }, - "application/font-tdpfr": { - source: "iana", - extensions: ["pfr"] - }, - "application/font-woff": { - source: "iana", - compressible: false - }, - "application/framework-attributes+xml": { - source: "iana", - compressible: true - }, - "application/geo+json": { - source: "iana", - compressible: true, - extensions: ["geojson"] - }, - "application/geo+json-seq": { - source: "iana" - }, - "application/geopackage+sqlite3": { - source: "iana" - }, - "application/geoxacml+xml": { - source: "iana", - compressible: true - }, - "application/gltf-buffer": { - source: "iana" - }, - "application/gml+xml": { - source: "iana", - compressible: true, - extensions: ["gml"] - }, - "application/gpx+xml": { - source: "apache", - compressible: true, - extensions: ["gpx"] - }, - "application/gxf": { - source: "apache", - extensions: ["gxf"] - }, - "application/gzip": { - source: "iana", - compressible: false, - extensions: ["gz"] - }, - "application/h224": { - source: "iana" - }, - "application/held+xml": { - source: "iana", - compressible: true - }, - "application/hjson": { - extensions: ["hjson"] - }, - "application/http": { - source: "iana" - }, - "application/hyperstudio": { - source: "iana", - extensions: ["stk"] - }, - "application/ibe-key-request+xml": { - source: "iana", - compressible: true - }, - "application/ibe-pkg-reply+xml": { - source: "iana", - compressible: true - }, - "application/ibe-pp-data": { - source: "iana" - }, - "application/iges": { - source: "iana" - }, - "application/im-iscomposing+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/index": { - source: "iana" - }, - "application/index.cmd": { - source: "iana" - }, - "application/index.obj": { - source: "iana" - }, - "application/index.response": { - source: "iana" - }, - "application/index.vnd": { - source: "iana" - }, - "application/inkml+xml": { - source: "iana", - compressible: true, - extensions: ["ink", "inkml"] - }, - "application/iotp": { - source: "iana" - }, - "application/ipfix": { - source: "iana", - extensions: ["ipfix"] - }, - "application/ipp": { - source: "iana" - }, - "application/isup": { - source: "iana" - }, - "application/its+xml": { - source: "iana", - compressible: true, - extensions: ["its"] - }, - "application/java-archive": { - source: "apache", - compressible: false, - extensions: ["jar", "war", "ear"] - }, - "application/java-serialized-object": { - source: "apache", - compressible: false, - extensions: ["ser"] - }, - "application/java-vm": { - source: "apache", - compressible: false, - extensions: ["class"] - }, - "application/javascript": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["js", "mjs"] - }, - "application/jf2feed+json": { - source: "iana", - compressible: true - }, - "application/jose": { - source: "iana" - }, - "application/jose+json": { - source: "iana", - compressible: true - }, - "application/jrd+json": { - source: "iana", - compressible: true - }, - "application/jscalendar+json": { - source: "iana", - compressible: true - }, - "application/json": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["json", "map"] - }, - "application/json-patch+json": { - source: "iana", - compressible: true - }, - "application/json-seq": { - source: "iana" - }, - "application/json5": { - extensions: ["json5"] - }, - "application/jsonml+json": { - source: "apache", - compressible: true, - extensions: ["jsonml"] - }, - "application/jwk+json": { - source: "iana", - compressible: true - }, - "application/jwk-set+json": { - source: "iana", - compressible: true - }, - "application/jwt": { - source: "iana" - }, - "application/kpml-request+xml": { - source: "iana", - compressible: true - }, - "application/kpml-response+xml": { - source: "iana", - compressible: true - }, - "application/ld+json": { - source: "iana", - compressible: true, - extensions: ["jsonld"] - }, - "application/lgr+xml": { - source: "iana", - compressible: true, - extensions: ["lgr"] - }, - "application/link-format": { - source: "iana" - }, - "application/load-control+xml": { - source: "iana", - compressible: true - }, - "application/lost+xml": { - source: "iana", - compressible: true, - extensions: ["lostxml"] - }, - "application/lostsync+xml": { - source: "iana", - compressible: true - }, - "application/lpf+zip": { - source: "iana", - compressible: false - }, - "application/lxf": { - source: "iana" - }, - "application/mac-binhex40": { - source: "iana", - extensions: ["hqx"] - }, - "application/mac-compactpro": { - source: "apache", - extensions: ["cpt"] - }, - "application/macwriteii": { - source: "iana" - }, - "application/mads+xml": { - source: "iana", - compressible: true, - extensions: ["mads"] - }, - "application/manifest+json": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["webmanifest"] - }, - "application/marc": { - source: "iana", - extensions: ["mrc"] - }, - "application/marcxml+xml": { - source: "iana", - compressible: true, - extensions: ["mrcx"] - }, - "application/mathematica": { - source: "iana", - extensions: ["ma", "nb", "mb"] - }, - "application/mathml+xml": { - source: "iana", - compressible: true, - extensions: ["mathml"] - }, - "application/mathml-content+xml": { - source: "iana", - compressible: true - }, - "application/mathml-presentation+xml": { - source: "iana", - compressible: true - }, - "application/mbms-associated-procedure-description+xml": { - source: "iana", - compressible: true - }, - "application/mbms-deregister+xml": { - source: "iana", - compressible: true - }, - "application/mbms-envelope+xml": { - source: "iana", - compressible: true - }, - "application/mbms-msk+xml": { - source: "iana", - compressible: true - }, - "application/mbms-msk-response+xml": { - source: "iana", - compressible: true - }, - "application/mbms-protection-description+xml": { - source: "iana", - compressible: true - }, - "application/mbms-reception-report+xml": { - source: "iana", - compressible: true - }, - "application/mbms-register+xml": { - source: "iana", - compressible: true - }, - "application/mbms-register-response+xml": { - source: "iana", - compressible: true - }, - "application/mbms-schedule+xml": { - source: "iana", - compressible: true - }, - "application/mbms-user-service-description+xml": { - source: "iana", - compressible: true - }, - "application/mbox": { - source: "iana", - extensions: ["mbox"] - }, - "application/media-policy-dataset+xml": { - source: "iana", - compressible: true, - extensions: ["mpf"] - }, - "application/media_control+xml": { - source: "iana", - compressible: true - }, - "application/mediaservercontrol+xml": { - source: "iana", - compressible: true, - extensions: ["mscml"] - }, - "application/merge-patch+json": { - source: "iana", - compressible: true - }, - "application/metalink+xml": { - source: "apache", - compressible: true, - extensions: ["metalink"] - }, - "application/metalink4+xml": { - source: "iana", - compressible: true, - extensions: ["meta4"] - }, - "application/mets+xml": { - source: "iana", - compressible: true, - extensions: ["mets"] - }, - "application/mf4": { - source: "iana" - }, - "application/mikey": { - source: "iana" - }, - "application/mipc": { - source: "iana" - }, - "application/missing-blocks+cbor-seq": { - source: "iana" - }, - "application/mmt-aei+xml": { - source: "iana", - compressible: true, - extensions: ["maei"] - }, - "application/mmt-usd+xml": { - source: "iana", - compressible: true, - extensions: ["musd"] - }, - "application/mods+xml": { - source: "iana", - compressible: true, - extensions: ["mods"] - }, - "application/moss-keys": { - source: "iana" - }, - "application/moss-signature": { - source: "iana" - }, - "application/mosskey-data": { - source: "iana" - }, - "application/mosskey-request": { - source: "iana" - }, - "application/mp21": { - source: "iana", - extensions: ["m21", "mp21"] - }, - "application/mp4": { - source: "iana", - extensions: ["mp4s", "m4p"] - }, - "application/mpeg4-generic": { - source: "iana" - }, - "application/mpeg4-iod": { - source: "iana" - }, - "application/mpeg4-iod-xmt": { - source: "iana" - }, - "application/mrb-consumer+xml": { - source: "iana", - compressible: true - }, - "application/mrb-publish+xml": { - source: "iana", - compressible: true - }, - "application/msc-ivr+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/msc-mixer+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/msword": { - source: "iana", - compressible: false, - extensions: ["doc", "dot"] - }, - "application/mud+json": { - source: "iana", - compressible: true - }, - "application/multipart-core": { - source: "iana" - }, - "application/mxf": { - source: "iana", - extensions: ["mxf"] - }, - "application/n-quads": { - source: "iana", - extensions: ["nq"] - }, - "application/n-triples": { - source: "iana", - extensions: ["nt"] - }, - "application/nasdata": { - source: "iana" - }, - "application/news-checkgroups": { - source: "iana", - charset: "US-ASCII" - }, - "application/news-groupinfo": { - source: "iana", - charset: "US-ASCII" - }, - "application/news-transmission": { - source: "iana" - }, - "application/nlsml+xml": { - source: "iana", - compressible: true - }, - "application/node": { - source: "iana", - extensions: ["cjs"] - }, - "application/nss": { - source: "iana" - }, - "application/oauth-authz-req+jwt": { - source: "iana" - }, - "application/oblivious-dns-message": { - source: "iana" - }, - "application/ocsp-request": { - source: "iana" - }, - "application/ocsp-response": { - source: "iana" - }, - "application/octet-stream": { - source: "iana", - compressible: false, - extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] - }, - "application/oda": { - source: "iana", - extensions: ["oda"] - }, - "application/odm+xml": { - source: "iana", - compressible: true - }, - "application/odx": { - source: "iana" - }, - "application/oebps-package+xml": { - source: "iana", - compressible: true, - extensions: ["opf"] - }, - "application/ogg": { - source: "iana", - compressible: false, - extensions: ["ogx"] - }, - "application/omdoc+xml": { - source: "apache", - compressible: true, - extensions: ["omdoc"] - }, - "application/onenote": { - source: "apache", - extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] - }, - "application/opc-nodeset+xml": { - source: "iana", - compressible: true - }, - "application/oscore": { - source: "iana" - }, - "application/oxps": { - source: "iana", - extensions: ["oxps"] - }, - "application/p21": { - source: "iana" - }, - "application/p21+zip": { - source: "iana", - compressible: false - }, - "application/p2p-overlay+xml": { - source: "iana", - compressible: true, - extensions: ["relo"] - }, - "application/parityfec": { - source: "iana" - }, - "application/passport": { - source: "iana" - }, - "application/patch-ops-error+xml": { - source: "iana", - compressible: true, - extensions: ["xer"] - }, - "application/pdf": { - source: "iana", - compressible: false, - extensions: ["pdf"] - }, - "application/pdx": { - source: "iana" - }, - "application/pem-certificate-chain": { - source: "iana" - }, - "application/pgp-encrypted": { - source: "iana", - compressible: false, - extensions: ["pgp"] - }, - "application/pgp-keys": { - source: "iana", - extensions: ["asc"] - }, - "application/pgp-signature": { - source: "iana", - extensions: ["asc", "sig"] - }, - "application/pics-rules": { - source: "apache", - extensions: ["prf"] - }, - "application/pidf+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/pidf-diff+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/pkcs10": { - source: "iana", - extensions: ["p10"] - }, - "application/pkcs12": { - source: "iana" - }, - "application/pkcs7-mime": { - source: "iana", - extensions: ["p7m", "p7c"] - }, - "application/pkcs7-signature": { - source: "iana", - extensions: ["p7s"] - }, - "application/pkcs8": { - source: "iana", - extensions: ["p8"] - }, - "application/pkcs8-encrypted": { - source: "iana" - }, - "application/pkix-attr-cert": { - source: "iana", - extensions: ["ac"] - }, - "application/pkix-cert": { - source: "iana", - extensions: ["cer"] - }, - "application/pkix-crl": { - source: "iana", - extensions: ["crl"] - }, - "application/pkix-pkipath": { - source: "iana", - extensions: ["pkipath"] - }, - "application/pkixcmp": { - source: "iana", - extensions: ["pki"] - }, - "application/pls+xml": { - source: "iana", - compressible: true, - extensions: ["pls"] - }, - "application/poc-settings+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/postscript": { - source: "iana", - compressible: true, - extensions: ["ai", "eps", "ps"] - }, - "application/ppsp-tracker+json": { - source: "iana", - compressible: true - }, - "application/problem+json": { - source: "iana", - compressible: true - }, - "application/problem+xml": { - source: "iana", - compressible: true - }, - "application/provenance+xml": { - source: "iana", - compressible: true, - extensions: ["provx"] - }, - "application/prs.alvestrand.titrax-sheet": { - source: "iana" - }, - "application/prs.cww": { - source: "iana", - extensions: ["cww"] - }, - "application/prs.cyn": { - source: "iana", - charset: "7-BIT" - }, - "application/prs.hpub+zip": { - source: "iana", - compressible: false - }, - "application/prs.nprend": { - source: "iana" - }, - "application/prs.plucker": { - source: "iana" - }, - "application/prs.rdf-xml-crypt": { - source: "iana" - }, - "application/prs.xsf+xml": { - source: "iana", - compressible: true - }, - "application/pskc+xml": { - source: "iana", - compressible: true, - extensions: ["pskcxml"] - }, - "application/pvd+json": { - source: "iana", - compressible: true - }, - "application/qsig": { - source: "iana" - }, - "application/raml+yaml": { - compressible: true, - extensions: ["raml"] - }, - "application/raptorfec": { - source: "iana" - }, - "application/rdap+json": { - source: "iana", - compressible: true - }, - "application/rdf+xml": { - source: "iana", - compressible: true, - extensions: ["rdf", "owl"] - }, - "application/reginfo+xml": { - source: "iana", - compressible: true, - extensions: ["rif"] - }, - "application/relax-ng-compact-syntax": { - source: "iana", - extensions: ["rnc"] - }, - "application/remote-printing": { - source: "iana" - }, - "application/reputon+json": { - source: "iana", - compressible: true - }, - "application/resource-lists+xml": { - source: "iana", - compressible: true, - extensions: ["rl"] - }, - "application/resource-lists-diff+xml": { - source: "iana", - compressible: true, - extensions: ["rld"] - }, - "application/rfc+xml": { - source: "iana", - compressible: true - }, - "application/riscos": { - source: "iana" - }, - "application/rlmi+xml": { - source: "iana", - compressible: true - }, - "application/rls-services+xml": { - source: "iana", - compressible: true, - extensions: ["rs"] - }, - "application/route-apd+xml": { - source: "iana", - compressible: true, - extensions: ["rapd"] - }, - "application/route-s-tsid+xml": { - source: "iana", - compressible: true, - extensions: ["sls"] - }, - "application/route-usd+xml": { - source: "iana", - compressible: true, - extensions: ["rusd"] - }, - "application/rpki-ghostbusters": { - source: "iana", - extensions: ["gbr"] - }, - "application/rpki-manifest": { - source: "iana", - extensions: ["mft"] - }, - "application/rpki-publication": { - source: "iana" - }, - "application/rpki-roa": { - source: "iana", - extensions: ["roa"] - }, - "application/rpki-updown": { - source: "iana" - }, - "application/rsd+xml": { - source: "apache", - compressible: true, - extensions: ["rsd"] - }, - "application/rss+xml": { - source: "apache", - compressible: true, - extensions: ["rss"] - }, - "application/rtf": { - source: "iana", - compressible: true, - extensions: ["rtf"] - }, - "application/rtploopback": { - source: "iana" - }, - "application/rtx": { - source: "iana" - }, - "application/samlassertion+xml": { - source: "iana", - compressible: true - }, - "application/samlmetadata+xml": { - source: "iana", - compressible: true - }, - "application/sarif+json": { - source: "iana", - compressible: true - }, - "application/sarif-external-properties+json": { - source: "iana", - compressible: true - }, - "application/sbe": { - source: "iana" - }, - "application/sbml+xml": { - source: "iana", - compressible: true, - extensions: ["sbml"] - }, - "application/scaip+xml": { - source: "iana", - compressible: true - }, - "application/scim+json": { - source: "iana", - compressible: true - }, - "application/scvp-cv-request": { - source: "iana", - extensions: ["scq"] - }, - "application/scvp-cv-response": { - source: "iana", - extensions: ["scs"] - }, - "application/scvp-vp-request": { - source: "iana", - extensions: ["spq"] - }, - "application/scvp-vp-response": { - source: "iana", - extensions: ["spp"] - }, - "application/sdp": { - source: "iana", - extensions: ["sdp"] - }, - "application/secevent+jwt": { - source: "iana" - }, - "application/senml+cbor": { - source: "iana" - }, - "application/senml+json": { - source: "iana", - compressible: true - }, - "application/senml+xml": { - source: "iana", - compressible: true, - extensions: ["senmlx"] - }, - "application/senml-etch+cbor": { - source: "iana" - }, - "application/senml-etch+json": { - source: "iana", - compressible: true - }, - "application/senml-exi": { - source: "iana" - }, - "application/sensml+cbor": { - source: "iana" - }, - "application/sensml+json": { - source: "iana", - compressible: true - }, - "application/sensml+xml": { - source: "iana", - compressible: true, - extensions: ["sensmlx"] - }, - "application/sensml-exi": { - source: "iana" - }, - "application/sep+xml": { - source: "iana", - compressible: true - }, - "application/sep-exi": { - source: "iana" - }, - "application/session-info": { - source: "iana" - }, - "application/set-payment": { - source: "iana" - }, - "application/set-payment-initiation": { - source: "iana", - extensions: ["setpay"] - }, - "application/set-registration": { - source: "iana" - }, - "application/set-registration-initiation": { - source: "iana", - extensions: ["setreg"] - }, - "application/sgml": { - source: "iana" - }, - "application/sgml-open-catalog": { - source: "iana" - }, - "application/shf+xml": { - source: "iana", - compressible: true, - extensions: ["shf"] - }, - "application/sieve": { - source: "iana", - extensions: ["siv", "sieve"] - }, - "application/simple-filter+xml": { - source: "iana", - compressible: true - }, - "application/simple-message-summary": { - source: "iana" - }, - "application/simplesymbolcontainer": { - source: "iana" - }, - "application/sipc": { - source: "iana" - }, - "application/slate": { - source: "iana" - }, - "application/smil": { - source: "iana" - }, - "application/smil+xml": { - source: "iana", - compressible: true, - extensions: ["smi", "smil"] - }, - "application/smpte336m": { - source: "iana" - }, - "application/soap+fastinfoset": { - source: "iana" - }, - "application/soap+xml": { - source: "iana", - compressible: true - }, - "application/sparql-query": { - source: "iana", - extensions: ["rq"] - }, - "application/sparql-results+xml": { - source: "iana", - compressible: true, - extensions: ["srx"] - }, - "application/spdx+json": { - source: "iana", - compressible: true - }, - "application/spirits-event+xml": { - source: "iana", - compressible: true - }, - "application/sql": { - source: "iana" - }, - "application/srgs": { - source: "iana", - extensions: ["gram"] - }, - "application/srgs+xml": { - source: "iana", - compressible: true, - extensions: ["grxml"] - }, - "application/sru+xml": { - source: "iana", - compressible: true, - extensions: ["sru"] - }, - "application/ssdl+xml": { - source: "apache", - compressible: true, - extensions: ["ssdl"] - }, - "application/ssml+xml": { - source: "iana", - compressible: true, - extensions: ["ssml"] - }, - "application/stix+json": { - source: "iana", - compressible: true - }, - "application/swid+xml": { - source: "iana", - compressible: true, - extensions: ["swidtag"] - }, - "application/tamp-apex-update": { - source: "iana" - }, - "application/tamp-apex-update-confirm": { - source: "iana" - }, - "application/tamp-community-update": { - source: "iana" - }, - "application/tamp-community-update-confirm": { - source: "iana" - }, - "application/tamp-error": { - source: "iana" - }, - "application/tamp-sequence-adjust": { - source: "iana" - }, - "application/tamp-sequence-adjust-confirm": { - source: "iana" - }, - "application/tamp-status-query": { - source: "iana" - }, - "application/tamp-status-response": { - source: "iana" - }, - "application/tamp-update": { - source: "iana" - }, - "application/tamp-update-confirm": { - source: "iana" - }, - "application/tar": { - compressible: true - }, - "application/taxii+json": { - source: "iana", - compressible: true - }, - "application/td+json": { - source: "iana", - compressible: true - }, - "application/tei+xml": { - source: "iana", - compressible: true, - extensions: ["tei", "teicorpus"] - }, - "application/tetra_isi": { - source: "iana" - }, - "application/thraud+xml": { - source: "iana", - compressible: true, - extensions: ["tfi"] - }, - "application/timestamp-query": { - source: "iana" - }, - "application/timestamp-reply": { - source: "iana" - }, - "application/timestamped-data": { - source: "iana", - extensions: ["tsd"] - }, - "application/tlsrpt+gzip": { - source: "iana" - }, - "application/tlsrpt+json": { - source: "iana", - compressible: true - }, - "application/tnauthlist": { - source: "iana" - }, - "application/token-introspection+jwt": { - source: "iana" - }, - "application/toml": { - compressible: true, - extensions: ["toml"] - }, - "application/trickle-ice-sdpfrag": { - source: "iana" - }, - "application/trig": { - source: "iana", - extensions: ["trig"] - }, - "application/ttml+xml": { - source: "iana", - compressible: true, - extensions: ["ttml"] - }, - "application/tve-trigger": { - source: "iana" - }, - "application/tzif": { - source: "iana" - }, - "application/tzif-leap": { - source: "iana" - }, - "application/ubjson": { - compressible: false, - extensions: ["ubj"] - }, - "application/ulpfec": { - source: "iana" - }, - "application/urc-grpsheet+xml": { - source: "iana", - compressible: true - }, - "application/urc-ressheet+xml": { - source: "iana", - compressible: true, - extensions: ["rsheet"] - }, - "application/urc-targetdesc+xml": { - source: "iana", - compressible: true, - extensions: ["td"] - }, - "application/urc-uisocketdesc+xml": { - source: "iana", - compressible: true - }, - "application/vcard+json": { - source: "iana", - compressible: true - }, - "application/vcard+xml": { - source: "iana", - compressible: true - }, - "application/vemmi": { - source: "iana" - }, - "application/vividence.scriptfile": { - source: "apache" - }, - "application/vnd.1000minds.decision-model+xml": { - source: "iana", - compressible: true, - extensions: ["1km"] - }, - "application/vnd.3gpp-prose+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp-prose-pc3ch+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp-v2x-local-service-information": { - source: "iana" - }, - "application/vnd.3gpp.5gnas": { - source: "iana" - }, - "application/vnd.3gpp.access-transfer-events+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.bsf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.gmop+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.gtpc": { - source: "iana" - }, - "application/vnd.3gpp.interworking-data": { - source: "iana" - }, - "application/vnd.3gpp.lpp": { - source: "iana" - }, - "application/vnd.3gpp.mc-signalling-ear": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-payload": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-signalling": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-floor-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-location-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-signed+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-ue-init-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-affiliation-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-location-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-transmission-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mid-call+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.ngap": { - source: "iana" - }, - "application/vnd.3gpp.pfcp": { - source: "iana" - }, - "application/vnd.3gpp.pic-bw-large": { - source: "iana", - extensions: ["plb"] - }, - "application/vnd.3gpp.pic-bw-small": { - source: "iana", - extensions: ["psb"] - }, - "application/vnd.3gpp.pic-bw-var": { - source: "iana", - extensions: ["pvb"] - }, - "application/vnd.3gpp.s1ap": { - source: "iana" - }, - "application/vnd.3gpp.sms": { - source: "iana" - }, - "application/vnd.3gpp.sms+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.srvcc-ext+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.srvcc-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.state-and-event-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.ussd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp2.sms": { - source: "iana" - }, - "application/vnd.3gpp2.tcap": { - source: "iana", - extensions: ["tcap"] - }, - "application/vnd.3lightssoftware.imagescal": { - source: "iana" - }, - "application/vnd.3m.post-it-notes": { - source: "iana", - extensions: ["pwn"] - }, - "application/vnd.accpac.simply.aso": { - source: "iana", - extensions: ["aso"] - }, - "application/vnd.accpac.simply.imp": { - source: "iana", - extensions: ["imp"] - }, - "application/vnd.acucobol": { - source: "iana", - extensions: ["acu"] - }, - "application/vnd.acucorp": { - source: "iana", - extensions: ["atc", "acutc"] - }, - "application/vnd.adobe.air-application-installer-package+zip": { - source: "apache", - compressible: false, - extensions: ["air"] - }, - "application/vnd.adobe.flash.movie": { - source: "iana" - }, - "application/vnd.adobe.formscentral.fcdt": { - source: "iana", - extensions: ["fcdt"] - }, - "application/vnd.adobe.fxp": { - source: "iana", - extensions: ["fxp", "fxpl"] - }, - "application/vnd.adobe.partial-upload": { - source: "iana" - }, - "application/vnd.adobe.xdp+xml": { - source: "iana", - compressible: true, - extensions: ["xdp"] - }, - "application/vnd.adobe.xfdf": { - source: "iana", - extensions: ["xfdf"] - }, - "application/vnd.aether.imp": { - source: "iana" - }, - "application/vnd.afpc.afplinedata": { - source: "iana" - }, - "application/vnd.afpc.afplinedata-pagedef": { - source: "iana" - }, - "application/vnd.afpc.cmoca-cmresource": { - source: "iana" - }, - "application/vnd.afpc.foca-charset": { - source: "iana" - }, - "application/vnd.afpc.foca-codedfont": { - source: "iana" - }, - "application/vnd.afpc.foca-codepage": { - source: "iana" - }, - "application/vnd.afpc.modca": { - source: "iana" - }, - "application/vnd.afpc.modca-cmtable": { - source: "iana" - }, - "application/vnd.afpc.modca-formdef": { - source: "iana" - }, - "application/vnd.afpc.modca-mediummap": { - source: "iana" - }, - "application/vnd.afpc.modca-objectcontainer": { - source: "iana" - }, - "application/vnd.afpc.modca-overlay": { - source: "iana" - }, - "application/vnd.afpc.modca-pagesegment": { - source: "iana" - }, - "application/vnd.age": { - source: "iana", - extensions: ["age"] - }, - "application/vnd.ah-barcode": { - source: "iana" - }, - "application/vnd.ahead.space": { - source: "iana", - extensions: ["ahead"] - }, - "application/vnd.airzip.filesecure.azf": { - source: "iana", - extensions: ["azf"] - }, - "application/vnd.airzip.filesecure.azs": { - source: "iana", - extensions: ["azs"] - }, - "application/vnd.amadeus+json": { - source: "iana", - compressible: true - }, - "application/vnd.amazon.ebook": { - source: "apache", - extensions: ["azw"] - }, - "application/vnd.amazon.mobi8-ebook": { - source: "iana" - }, - "application/vnd.americandynamics.acc": { - source: "iana", - extensions: ["acc"] - }, - "application/vnd.amiga.ami": { - source: "iana", - extensions: ["ami"] - }, - "application/vnd.amundsen.maze+xml": { - source: "iana", - compressible: true - }, - "application/vnd.android.ota": { - source: "iana" - }, - "application/vnd.android.package-archive": { - source: "apache", - compressible: false, - extensions: ["apk"] - }, - "application/vnd.anki": { - source: "iana" - }, - "application/vnd.anser-web-certificate-issue-initiation": { - source: "iana", - extensions: ["cii"] - }, - "application/vnd.anser-web-funds-transfer-initiation": { - source: "apache", - extensions: ["fti"] - }, - "application/vnd.antix.game-component": { - source: "iana", - extensions: ["atx"] - }, - "application/vnd.apache.arrow.file": { - source: "iana" - }, - "application/vnd.apache.arrow.stream": { - source: "iana" - }, - "application/vnd.apache.thrift.binary": { - source: "iana" - }, - "application/vnd.apache.thrift.compact": { - source: "iana" - }, - "application/vnd.apache.thrift.json": { - source: "iana" - }, - "application/vnd.api+json": { - source: "iana", - compressible: true - }, - "application/vnd.aplextor.warrp+json": { - source: "iana", - compressible: true - }, - "application/vnd.apothekende.reservation+json": { - source: "iana", - compressible: true - }, - "application/vnd.apple.installer+xml": { - source: "iana", - compressible: true, - extensions: ["mpkg"] - }, - "application/vnd.apple.keynote": { - source: "iana", - extensions: ["key"] - }, - "application/vnd.apple.mpegurl": { - source: "iana", - extensions: ["m3u8"] - }, - "application/vnd.apple.numbers": { - source: "iana", - extensions: ["numbers"] - }, - "application/vnd.apple.pages": { - source: "iana", - extensions: ["pages"] - }, - "application/vnd.apple.pkpass": { - compressible: false, - extensions: ["pkpass"] - }, - "application/vnd.arastra.swi": { - source: "iana" - }, - "application/vnd.aristanetworks.swi": { - source: "iana", - extensions: ["swi"] - }, - "application/vnd.artisan+json": { - source: "iana", - compressible: true - }, - "application/vnd.artsquare": { - source: "iana" - }, - "application/vnd.astraea-software.iota": { - source: "iana", - extensions: ["iota"] - }, - "application/vnd.audiograph": { - source: "iana", - extensions: ["aep"] - }, - "application/vnd.autopackage": { - source: "iana" - }, - "application/vnd.avalon+json": { - source: "iana", - compressible: true - }, - "application/vnd.avistar+xml": { - source: "iana", - compressible: true - }, - "application/vnd.balsamiq.bmml+xml": { - source: "iana", - compressible: true, - extensions: ["bmml"] - }, - "application/vnd.balsamiq.bmpr": { - source: "iana" - }, - "application/vnd.banana-accounting": { - source: "iana" - }, - "application/vnd.bbf.usp.error": { - source: "iana" - }, - "application/vnd.bbf.usp.msg": { - source: "iana" - }, - "application/vnd.bbf.usp.msg+json": { - source: "iana", - compressible: true - }, - "application/vnd.bekitzur-stech+json": { - source: "iana", - compressible: true - }, - "application/vnd.bint.med-content": { - source: "iana" - }, - "application/vnd.biopax.rdf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.blink-idb-value-wrapper": { - source: "iana" - }, - "application/vnd.blueice.multipass": { - source: "iana", - extensions: ["mpm"] - }, - "application/vnd.bluetooth.ep.oob": { - source: "iana" - }, - "application/vnd.bluetooth.le.oob": { - source: "iana" - }, - "application/vnd.bmi": { - source: "iana", - extensions: ["bmi"] - }, - "application/vnd.bpf": { - source: "iana" - }, - "application/vnd.bpf3": { - source: "iana" - }, - "application/vnd.businessobjects": { - source: "iana", - extensions: ["rep"] - }, - "application/vnd.byu.uapi+json": { - source: "iana", - compressible: true - }, - "application/vnd.cab-jscript": { - source: "iana" - }, - "application/vnd.canon-cpdl": { - source: "iana" - }, - "application/vnd.canon-lips": { - source: "iana" - }, - "application/vnd.capasystems-pg+json": { - source: "iana", - compressible: true - }, - "application/vnd.cendio.thinlinc.clientconf": { - source: "iana" - }, - "application/vnd.century-systems.tcp_stream": { - source: "iana" - }, - "application/vnd.chemdraw+xml": { - source: "iana", - compressible: true, - extensions: ["cdxml"] - }, - "application/vnd.chess-pgn": { - source: "iana" - }, - "application/vnd.chipnuts.karaoke-mmd": { - source: "iana", - extensions: ["mmd"] - }, - "application/vnd.ciedi": { - source: "iana" - }, - "application/vnd.cinderella": { - source: "iana", - extensions: ["cdy"] - }, - "application/vnd.cirpack.isdn-ext": { - source: "iana" - }, - "application/vnd.citationstyles.style+xml": { - source: "iana", - compressible: true, - extensions: ["csl"] - }, - "application/vnd.claymore": { - source: "iana", - extensions: ["cla"] - }, - "application/vnd.cloanto.rp9": { - source: "iana", - extensions: ["rp9"] - }, - "application/vnd.clonk.c4group": { - source: "iana", - extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] - }, - "application/vnd.cluetrust.cartomobile-config": { - source: "iana", - extensions: ["c11amc"] - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - source: "iana", - extensions: ["c11amz"] - }, - "application/vnd.coffeescript": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.document": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.document-template": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.presentation": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.presentation-template": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet-template": { - source: "iana" - }, - "application/vnd.collection+json": { - source: "iana", - compressible: true - }, - "application/vnd.collection.doc+json": { - source: "iana", - compressible: true - }, - "application/vnd.collection.next+json": { - source: "iana", - compressible: true - }, - "application/vnd.comicbook+zip": { - source: "iana", - compressible: false - }, - "application/vnd.comicbook-rar": { - source: "iana" - }, - "application/vnd.commerce-battelle": { - source: "iana" - }, - "application/vnd.commonspace": { - source: "iana", - extensions: ["csp"] - }, - "application/vnd.contact.cmsg": { - source: "iana", - extensions: ["cdbcmsg"] - }, - "application/vnd.coreos.ignition+json": { - source: "iana", - compressible: true - }, - "application/vnd.cosmocaller": { - source: "iana", - extensions: ["cmc"] - }, - "application/vnd.crick.clicker": { - source: "iana", - extensions: ["clkx"] - }, - "application/vnd.crick.clicker.keyboard": { - source: "iana", - extensions: ["clkk"] - }, - "application/vnd.crick.clicker.palette": { - source: "iana", - extensions: ["clkp"] - }, - "application/vnd.crick.clicker.template": { - source: "iana", - extensions: ["clkt"] - }, - "application/vnd.crick.clicker.wordbank": { - source: "iana", - extensions: ["clkw"] - }, - "application/vnd.criticaltools.wbs+xml": { - source: "iana", - compressible: true, - extensions: ["wbs"] - }, - "application/vnd.cryptii.pipe+json": { - source: "iana", - compressible: true - }, - "application/vnd.crypto-shade-file": { - source: "iana" - }, - "application/vnd.cryptomator.encrypted": { - source: "iana" - }, - "application/vnd.cryptomator.vault": { - source: "iana" - }, - "application/vnd.ctc-posml": { - source: "iana", - extensions: ["pml"] - }, - "application/vnd.ctct.ws+xml": { - source: "iana", - compressible: true - }, - "application/vnd.cups-pdf": { - source: "iana" - }, - "application/vnd.cups-postscript": { - source: "iana" - }, - "application/vnd.cups-ppd": { - source: "iana", - extensions: ["ppd"] - }, - "application/vnd.cups-raster": { - source: "iana" - }, - "application/vnd.cups-raw": { - source: "iana" - }, - "application/vnd.curl": { - source: "iana" - }, - "application/vnd.curl.car": { - source: "apache", - extensions: ["car"] - }, - "application/vnd.curl.pcurl": { - source: "apache", - extensions: ["pcurl"] - }, - "application/vnd.cyan.dean.root+xml": { - source: "iana", - compressible: true - }, - "application/vnd.cybank": { - source: "iana" - }, - "application/vnd.cyclonedx+json": { - source: "iana", - compressible: true - }, - "application/vnd.cyclonedx+xml": { - source: "iana", - compressible: true - }, - "application/vnd.d2l.coursepackage1p0+zip": { - source: "iana", - compressible: false - }, - "application/vnd.d3m-dataset": { - source: "iana" - }, - "application/vnd.d3m-problem": { - source: "iana" - }, - "application/vnd.dart": { - source: "iana", - compressible: true, - extensions: ["dart"] - }, - "application/vnd.data-vision.rdz": { - source: "iana", - extensions: ["rdz"] - }, - "application/vnd.datapackage+json": { - source: "iana", - compressible: true - }, - "application/vnd.dataresource+json": { - source: "iana", - compressible: true - }, - "application/vnd.dbf": { - source: "iana", - extensions: ["dbf"] - }, - "application/vnd.debian.binary-package": { - source: "iana" - }, - "application/vnd.dece.data": { - source: "iana", - extensions: ["uvf", "uvvf", "uvd", "uvvd"] - }, - "application/vnd.dece.ttml+xml": { - source: "iana", - compressible: true, - extensions: ["uvt", "uvvt"] - }, - "application/vnd.dece.unspecified": { - source: "iana", - extensions: ["uvx", "uvvx"] - }, - "application/vnd.dece.zip": { - source: "iana", - extensions: ["uvz", "uvvz"] - }, - "application/vnd.denovo.fcselayout-link": { - source: "iana", - extensions: ["fe_launch"] - }, - "application/vnd.desmume.movie": { - source: "iana" - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - source: "iana" - }, - "application/vnd.dm.delegation+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dna": { - source: "iana", - extensions: ["dna"] - }, - "application/vnd.document+json": { - source: "iana", - compressible: true - }, - "application/vnd.dolby.mlp": { - source: "apache", - extensions: ["mlp"] - }, - "application/vnd.dolby.mobile.1": { - source: "iana" - }, - "application/vnd.dolby.mobile.2": { - source: "iana" - }, - "application/vnd.doremir.scorecloud-binary-document": { - source: "iana" - }, - "application/vnd.dpgraph": { - source: "iana", - extensions: ["dpg"] - }, - "application/vnd.dreamfactory": { - source: "iana", - extensions: ["dfac"] - }, - "application/vnd.drive+json": { - source: "iana", - compressible: true - }, - "application/vnd.ds-keypoint": { - source: "apache", - extensions: ["kpxx"] - }, - "application/vnd.dtg.local": { - source: "iana" - }, - "application/vnd.dtg.local.flash": { - source: "iana" - }, - "application/vnd.dtg.local.html": { - source: "iana" - }, - "application/vnd.dvb.ait": { - source: "iana", - extensions: ["ait"] - }, - "application/vnd.dvb.dvbisl+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.dvbj": { - source: "iana" - }, - "application/vnd.dvb.esgcontainer": { - source: "iana" - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgaccess": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgaccess2": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgpdd": { - source: "iana" - }, - "application/vnd.dvb.ipdcroaming": { - source: "iana" - }, - "application/vnd.dvb.iptv.alfec-base": { - source: "iana" - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - source: "iana" - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-container+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-generic+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-init+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.pfr": { - source: "iana" - }, - "application/vnd.dvb.service": { - source: "iana", - extensions: ["svc"] - }, - "application/vnd.dxr": { - source: "iana" - }, - "application/vnd.dynageo": { - source: "iana", - extensions: ["geo"] - }, - "application/vnd.dzr": { - source: "iana" - }, - "application/vnd.easykaraoke.cdgdownload": { - source: "iana" - }, - "application/vnd.ecdis-update": { - source: "iana" - }, - "application/vnd.ecip.rlp": { - source: "iana" - }, - "application/vnd.eclipse.ditto+json": { - source: "iana", - compressible: true - }, - "application/vnd.ecowin.chart": { - source: "iana", - extensions: ["mag"] - }, - "application/vnd.ecowin.filerequest": { - source: "iana" - }, - "application/vnd.ecowin.fileupdate": { - source: "iana" - }, - "application/vnd.ecowin.series": { - source: "iana" - }, - "application/vnd.ecowin.seriesrequest": { - source: "iana" - }, - "application/vnd.ecowin.seriesupdate": { - source: "iana" - }, - "application/vnd.efi.img": { - source: "iana" - }, - "application/vnd.efi.iso": { - source: "iana" - }, - "application/vnd.emclient.accessrequest+xml": { - source: "iana", - compressible: true - }, - "application/vnd.enliven": { - source: "iana", - extensions: ["nml"] - }, - "application/vnd.enphase.envoy": { - source: "iana" - }, - "application/vnd.eprints.data+xml": { - source: "iana", - compressible: true - }, - "application/vnd.epson.esf": { - source: "iana", - extensions: ["esf"] - }, - "application/vnd.epson.msf": { - source: "iana", - extensions: ["msf"] - }, - "application/vnd.epson.quickanime": { - source: "iana", - extensions: ["qam"] - }, - "application/vnd.epson.salt": { - source: "iana", - extensions: ["slt"] - }, - "application/vnd.epson.ssf": { - source: "iana", - extensions: ["ssf"] - }, - "application/vnd.ericsson.quickcall": { - source: "iana" - }, - "application/vnd.espass-espass+zip": { - source: "iana", - compressible: false - }, - "application/vnd.eszigno3+xml": { - source: "iana", - compressible: true, - extensions: ["es3", "et3"] - }, - "application/vnd.etsi.aoc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.asic-e+zip": { - source: "iana", - compressible: false - }, - "application/vnd.etsi.asic-s+zip": { - source: "iana", - compressible: false - }, - "application/vnd.etsi.cug+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvcommand+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvdiscovery+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-bc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-cod+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvservice+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsync+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvueprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.mcid+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.mheg5": { - source: "iana" - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.pstn+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.sci+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.simservs+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.timestamp-token": { - source: "iana" - }, - "application/vnd.etsi.tsl+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.tsl.der": { - source: "iana" - }, - "application/vnd.eu.kasparian.car+json": { - source: "iana", - compressible: true - }, - "application/vnd.eudora.data": { - source: "iana" - }, - "application/vnd.evolv.ecig.profile": { - source: "iana" - }, - "application/vnd.evolv.ecig.settings": { - source: "iana" - }, - "application/vnd.evolv.ecig.theme": { - source: "iana" - }, - "application/vnd.exstream-empower+zip": { - source: "iana", - compressible: false - }, - "application/vnd.exstream-package": { - source: "iana" - }, - "application/vnd.ezpix-album": { - source: "iana", - extensions: ["ez2"] - }, - "application/vnd.ezpix-package": { - source: "iana", - extensions: ["ez3"] - }, - "application/vnd.f-secure.mobile": { - source: "iana" - }, - "application/vnd.familysearch.gedcom+zip": { - source: "iana", - compressible: false - }, - "application/vnd.fastcopy-disk-image": { - source: "iana" - }, - "application/vnd.fdf": { - source: "iana", - extensions: ["fdf"] - }, - "application/vnd.fdsn.mseed": { - source: "iana", - extensions: ["mseed"] - }, - "application/vnd.fdsn.seed": { - source: "iana", - extensions: ["seed", "dataless"] - }, - "application/vnd.ffsns": { - source: "iana" - }, - "application/vnd.ficlab.flb+zip": { - source: "iana", - compressible: false - }, - "application/vnd.filmit.zfc": { - source: "iana" - }, - "application/vnd.fints": { - source: "iana" - }, - "application/vnd.firemonkeys.cloudcell": { - source: "iana" - }, - "application/vnd.flographit": { - source: "iana", - extensions: ["gph"] - }, - "application/vnd.fluxtime.clip": { - source: "iana", - extensions: ["ftc"] - }, - "application/vnd.font-fontforge-sfd": { - source: "iana" - }, - "application/vnd.framemaker": { - source: "iana", - extensions: ["fm", "frame", "maker", "book"] - }, - "application/vnd.frogans.fnc": { - source: "iana", - extensions: ["fnc"] - }, - "application/vnd.frogans.ltf": { - source: "iana", - extensions: ["ltf"] - }, - "application/vnd.fsc.weblaunch": { - source: "iana", - extensions: ["fsc"] - }, - "application/vnd.fujifilm.fb.docuworks": { - source: "iana" - }, - "application/vnd.fujifilm.fb.docuworks.binder": { - source: "iana" - }, - "application/vnd.fujifilm.fb.docuworks.container": { - source: "iana" - }, - "application/vnd.fujifilm.fb.jfi+xml": { - source: "iana", - compressible: true - }, - "application/vnd.fujitsu.oasys": { - source: "iana", - extensions: ["oas"] - }, - "application/vnd.fujitsu.oasys2": { - source: "iana", - extensions: ["oa2"] - }, - "application/vnd.fujitsu.oasys3": { - source: "iana", - extensions: ["oa3"] - }, - "application/vnd.fujitsu.oasysgp": { - source: "iana", - extensions: ["fg5"] - }, - "application/vnd.fujitsu.oasysprs": { - source: "iana", - extensions: ["bh2"] - }, - "application/vnd.fujixerox.art-ex": { - source: "iana" - }, - "application/vnd.fujixerox.art4": { - source: "iana" - }, - "application/vnd.fujixerox.ddd": { - source: "iana", - extensions: ["ddd"] - }, - "application/vnd.fujixerox.docuworks": { - source: "iana", - extensions: ["xdw"] - }, - "application/vnd.fujixerox.docuworks.binder": { - source: "iana", - extensions: ["xbd"] - }, - "application/vnd.fujixerox.docuworks.container": { - source: "iana" - }, - "application/vnd.fujixerox.hbpl": { - source: "iana" - }, - "application/vnd.fut-misnet": { - source: "iana" - }, - "application/vnd.futoin+cbor": { - source: "iana" - }, - "application/vnd.futoin+json": { - source: "iana", - compressible: true - }, - "application/vnd.fuzzysheet": { - source: "iana", - extensions: ["fzs"] - }, - "application/vnd.genomatix.tuxedo": { - source: "iana", - extensions: ["txd"] - }, - "application/vnd.gentics.grd+json": { - source: "iana", - compressible: true - }, - "application/vnd.geo+json": { - source: "iana", - compressible: true - }, - "application/vnd.geocube+xml": { - source: "iana", - compressible: true - }, - "application/vnd.geogebra.file": { - source: "iana", - extensions: ["ggb"] - }, - "application/vnd.geogebra.slides": { - source: "iana" - }, - "application/vnd.geogebra.tool": { - source: "iana", - extensions: ["ggt"] - }, - "application/vnd.geometry-explorer": { - source: "iana", - extensions: ["gex", "gre"] - }, - "application/vnd.geonext": { - source: "iana", - extensions: ["gxt"] - }, - "application/vnd.geoplan": { - source: "iana", - extensions: ["g2w"] - }, - "application/vnd.geospace": { - source: "iana", - extensions: ["g3w"] - }, - "application/vnd.gerber": { - source: "iana" - }, - "application/vnd.globalplatform.card-content-mgt": { - source: "iana" - }, - "application/vnd.globalplatform.card-content-mgt-response": { - source: "iana" - }, - "application/vnd.gmx": { - source: "iana", - extensions: ["gmx"] - }, - "application/vnd.google-apps.document": { - compressible: false, - extensions: ["gdoc"] - }, - "application/vnd.google-apps.presentation": { - compressible: false, - extensions: ["gslides"] - }, - "application/vnd.google-apps.spreadsheet": { - compressible: false, - extensions: ["gsheet"] - }, - "application/vnd.google-earth.kml+xml": { - source: "iana", - compressible: true, - extensions: ["kml"] - }, - "application/vnd.google-earth.kmz": { - source: "iana", - compressible: false, - extensions: ["kmz"] - }, - "application/vnd.gov.sk.e-form+xml": { - source: "iana", - compressible: true - }, - "application/vnd.gov.sk.e-form+zip": { - source: "iana", - compressible: false - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - source: "iana", - compressible: true - }, - "application/vnd.grafeq": { - source: "iana", - extensions: ["gqf", "gqs"] - }, - "application/vnd.gridmp": { - source: "iana" - }, - "application/vnd.groove-account": { - source: "iana", - extensions: ["gac"] - }, - "application/vnd.groove-help": { - source: "iana", - extensions: ["ghf"] - }, - "application/vnd.groove-identity-message": { - source: "iana", - extensions: ["gim"] - }, - "application/vnd.groove-injector": { - source: "iana", - extensions: ["grv"] - }, - "application/vnd.groove-tool-message": { - source: "iana", - extensions: ["gtm"] - }, - "application/vnd.groove-tool-template": { - source: "iana", - extensions: ["tpl"] - }, - "application/vnd.groove-vcard": { - source: "iana", - extensions: ["vcg"] - }, - "application/vnd.hal+json": { - source: "iana", - compressible: true - }, - "application/vnd.hal+xml": { - source: "iana", - compressible: true, - extensions: ["hal"] - }, - "application/vnd.handheld-entertainment+xml": { - source: "iana", - compressible: true, - extensions: ["zmm"] - }, - "application/vnd.hbci": { - source: "iana", - extensions: ["hbci"] - }, - "application/vnd.hc+json": { - source: "iana", - compressible: true - }, - "application/vnd.hcl-bireports": { - source: "iana" - }, - "application/vnd.hdt": { - source: "iana" - }, - "application/vnd.heroku+json": { - source: "iana", - compressible: true - }, - "application/vnd.hhe.lesson-player": { - source: "iana", - extensions: ["les"] - }, - "application/vnd.hl7cda+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.hl7v2+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.hp-hpgl": { - source: "iana", - extensions: ["hpgl"] - }, - "application/vnd.hp-hpid": { - source: "iana", - extensions: ["hpid"] - }, - "application/vnd.hp-hps": { - source: "iana", - extensions: ["hps"] - }, - "application/vnd.hp-jlyt": { - source: "iana", - extensions: ["jlt"] - }, - "application/vnd.hp-pcl": { - source: "iana", - extensions: ["pcl"] - }, - "application/vnd.hp-pclxl": { - source: "iana", - extensions: ["pclxl"] - }, - "application/vnd.httphone": { - source: "iana" - }, - "application/vnd.hydrostatix.sof-data": { - source: "iana", - extensions: ["sfd-hdstx"] - }, - "application/vnd.hyper+json": { - source: "iana", - compressible: true - }, - "application/vnd.hyper-item+json": { - source: "iana", - compressible: true - }, - "application/vnd.hyperdrive+json": { - source: "iana", - compressible: true - }, - "application/vnd.hzn-3d-crossword": { - source: "iana" - }, - "application/vnd.ibm.afplinedata": { - source: "iana" - }, - "application/vnd.ibm.electronic-media": { - source: "iana" - }, - "application/vnd.ibm.minipay": { - source: "iana", - extensions: ["mpy"] - }, - "application/vnd.ibm.modcap": { - source: "iana", - extensions: ["afp", "listafp", "list3820"] - }, - "application/vnd.ibm.rights-management": { - source: "iana", - extensions: ["irm"] - }, - "application/vnd.ibm.secure-container": { - source: "iana", - extensions: ["sc"] - }, - "application/vnd.iccprofile": { - source: "iana", - extensions: ["icc", "icm"] - }, - "application/vnd.ieee.1905": { - source: "iana" - }, - "application/vnd.igloader": { - source: "iana", - extensions: ["igl"] - }, - "application/vnd.imagemeter.folder+zip": { - source: "iana", - compressible: false - }, - "application/vnd.imagemeter.image+zip": { - source: "iana", - compressible: false - }, - "application/vnd.immervision-ivp": { - source: "iana", - extensions: ["ivp"] - }, - "application/vnd.immervision-ivu": { - source: "iana", - extensions: ["ivu"] - }, - "application/vnd.ims.imsccv1p1": { - source: "iana" - }, - "application/vnd.ims.imsccv1p2": { - source: "iana" - }, - "application/vnd.ims.imsccv1p3": { - source: "iana" - }, - "application/vnd.ims.lis.v2.result+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - source: "iana", - compressible: true - }, - "application/vnd.informedcontrol.rms+xml": { - source: "iana", - compressible: true - }, - "application/vnd.informix-visionary": { - source: "iana" - }, - "application/vnd.infotech.project": { - source: "iana" - }, - "application/vnd.infotech.project+xml": { - source: "iana", - compressible: true - }, - "application/vnd.innopath.wamp.notification": { - source: "iana" - }, - "application/vnd.insors.igm": { - source: "iana", - extensions: ["igm"] - }, - "application/vnd.intercon.formnet": { - source: "iana", - extensions: ["xpw", "xpx"] - }, - "application/vnd.intergeo": { - source: "iana", - extensions: ["i2g"] - }, - "application/vnd.intertrust.digibox": { - source: "iana" - }, - "application/vnd.intertrust.nncp": { - source: "iana" - }, - "application/vnd.intu.qbo": { - source: "iana", - extensions: ["qbo"] - }, - "application/vnd.intu.qfx": { - source: "iana", - extensions: ["qfx"] - }, - "application/vnd.iptc.g2.catalogitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.conceptitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.newsitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.newsmessage+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.packageitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.planningitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ipunplugged.rcprofile": { - source: "iana", - extensions: ["rcprofile"] - }, - "application/vnd.irepository.package+xml": { - source: "iana", - compressible: true, - extensions: ["irp"] - }, - "application/vnd.is-xpr": { - source: "iana", - extensions: ["xpr"] - }, - "application/vnd.isac.fcs": { - source: "iana", - extensions: ["fcs"] - }, - "application/vnd.iso11783-10+zip": { - source: "iana", - compressible: false - }, - "application/vnd.jam": { - source: "iana", - extensions: ["jam"] - }, - "application/vnd.japannet-directory-service": { - source: "iana" - }, - "application/vnd.japannet-jpnstore-wakeup": { - source: "iana" - }, - "application/vnd.japannet-payment-wakeup": { - source: "iana" - }, - "application/vnd.japannet-registration": { - source: "iana" - }, - "application/vnd.japannet-registration-wakeup": { - source: "iana" - }, - "application/vnd.japannet-setstore-wakeup": { - source: "iana" - }, - "application/vnd.japannet-verification": { - source: "iana" - }, - "application/vnd.japannet-verification-wakeup": { - source: "iana" - }, - "application/vnd.jcp.javame.midlet-rms": { - source: "iana", - extensions: ["rms"] - }, - "application/vnd.jisp": { - source: "iana", - extensions: ["jisp"] - }, - "application/vnd.joost.joda-archive": { - source: "iana", - extensions: ["joda"] - }, - "application/vnd.jsk.isdn-ngn": { - source: "iana" - }, - "application/vnd.kahootz": { - source: "iana", - extensions: ["ktz", "ktr"] - }, - "application/vnd.kde.karbon": { - source: "iana", - extensions: ["karbon"] - }, - "application/vnd.kde.kchart": { - source: "iana", - extensions: ["chrt"] - }, - "application/vnd.kde.kformula": { - source: "iana", - extensions: ["kfo"] - }, - "application/vnd.kde.kivio": { - source: "iana", - extensions: ["flw"] - }, - "application/vnd.kde.kontour": { - source: "iana", - extensions: ["kon"] - }, - "application/vnd.kde.kpresenter": { - source: "iana", - extensions: ["kpr", "kpt"] - }, - "application/vnd.kde.kspread": { - source: "iana", - extensions: ["ksp"] - }, - "application/vnd.kde.kword": { - source: "iana", - extensions: ["kwd", "kwt"] - }, - "application/vnd.kenameaapp": { - source: "iana", - extensions: ["htke"] - }, - "application/vnd.kidspiration": { - source: "iana", - extensions: ["kia"] - }, - "application/vnd.kinar": { - source: "iana", - extensions: ["kne", "knp"] - }, - "application/vnd.koan": { - source: "iana", - extensions: ["skp", "skd", "skt", "skm"] - }, - "application/vnd.kodak-descriptor": { - source: "iana", - extensions: ["sse"] - }, - "application/vnd.las": { - source: "iana" - }, - "application/vnd.las.las+json": { - source: "iana", - compressible: true - }, - "application/vnd.las.las+xml": { - source: "iana", - compressible: true, - extensions: ["lasxml"] - }, - "application/vnd.laszip": { - source: "iana" - }, - "application/vnd.leap+json": { - source: "iana", - compressible: true - }, - "application/vnd.liberty-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.llamagraphics.life-balance.desktop": { - source: "iana", - extensions: ["lbd"] - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - source: "iana", - compressible: true, - extensions: ["lbe"] - }, - "application/vnd.logipipe.circuit+zip": { - source: "iana", - compressible: false - }, - "application/vnd.loom": { - source: "iana" - }, - "application/vnd.lotus-1-2-3": { - source: "iana", - extensions: ["123"] - }, - "application/vnd.lotus-approach": { - source: "iana", - extensions: ["apr"] - }, - "application/vnd.lotus-freelance": { - source: "iana", - extensions: ["pre"] - }, - "application/vnd.lotus-notes": { - source: "iana", - extensions: ["nsf"] - }, - "application/vnd.lotus-organizer": { - source: "iana", - extensions: ["org"] - }, - "application/vnd.lotus-screencam": { - source: "iana", - extensions: ["scm"] - }, - "application/vnd.lotus-wordpro": { - source: "iana", - extensions: ["lwp"] - }, - "application/vnd.macports.portpkg": { - source: "iana", - extensions: ["portpkg"] - }, - "application/vnd.mapbox-vector-tile": { - source: "iana", - extensions: ["mvt"] - }, - "application/vnd.marlin.drm.actiontoken+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.conftoken+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.license+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.mdcf": { - source: "iana" - }, - "application/vnd.mason+json": { - source: "iana", - compressible: true - }, - "application/vnd.maxar.archive.3tz+zip": { - source: "iana", - compressible: false - }, - "application/vnd.maxmind.maxmind-db": { - source: "iana" - }, - "application/vnd.mcd": { - source: "iana", - extensions: ["mcd"] - }, - "application/vnd.medcalcdata": { - source: "iana", - extensions: ["mc1"] - }, - "application/vnd.mediastation.cdkey": { - source: "iana", - extensions: ["cdkey"] - }, - "application/vnd.meridian-slingshot": { - source: "iana" - }, - "application/vnd.mfer": { - source: "iana", - extensions: ["mwf"] - }, - "application/vnd.mfmp": { - source: "iana", - extensions: ["mfm"] - }, - "application/vnd.micro+json": { - source: "iana", - compressible: true - }, - "application/vnd.micrografx.flo": { - source: "iana", - extensions: ["flo"] - }, - "application/vnd.micrografx.igx": { - source: "iana", - extensions: ["igx"] - }, - "application/vnd.microsoft.portable-executable": { - source: "iana" - }, - "application/vnd.microsoft.windows.thumbnail-cache": { - source: "iana" - }, - "application/vnd.miele+json": { - source: "iana", - compressible: true - }, - "application/vnd.mif": { - source: "iana", - extensions: ["mif"] - }, - "application/vnd.minisoft-hp3000-save": { - source: "iana" - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - source: "iana" - }, - "application/vnd.mobius.daf": { - source: "iana", - extensions: ["daf"] - }, - "application/vnd.mobius.dis": { - source: "iana", - extensions: ["dis"] - }, - "application/vnd.mobius.mbk": { - source: "iana", - extensions: ["mbk"] - }, - "application/vnd.mobius.mqy": { - source: "iana", - extensions: ["mqy"] - }, - "application/vnd.mobius.msl": { - source: "iana", - extensions: ["msl"] - }, - "application/vnd.mobius.plc": { - source: "iana", - extensions: ["plc"] - }, - "application/vnd.mobius.txf": { - source: "iana", - extensions: ["txf"] - }, - "application/vnd.mophun.application": { - source: "iana", - extensions: ["mpn"] - }, - "application/vnd.mophun.certificate": { - source: "iana", - extensions: ["mpc"] - }, - "application/vnd.motorola.flexsuite": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.adsi": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.fis": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.gotap": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.kmr": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.ttc": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.wem": { - source: "iana" - }, - "application/vnd.motorola.iprm": { - source: "iana" - }, - "application/vnd.mozilla.xul+xml": { - source: "iana", - compressible: true, - extensions: ["xul"] - }, - "application/vnd.ms-3mfdocument": { - source: "iana" - }, - "application/vnd.ms-artgalry": { - source: "iana", - extensions: ["cil"] - }, - "application/vnd.ms-asf": { - source: "iana" - }, - "application/vnd.ms-cab-compressed": { - source: "iana", - extensions: ["cab"] - }, - "application/vnd.ms-color.iccprofile": { - source: "apache" - }, - "application/vnd.ms-excel": { - source: "iana", - compressible: false, - extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - source: "iana", - extensions: ["xlam"] - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - source: "iana", - extensions: ["xlsb"] - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - source: "iana", - extensions: ["xlsm"] - }, - "application/vnd.ms-excel.template.macroenabled.12": { - source: "iana", - extensions: ["xltm"] - }, - "application/vnd.ms-fontobject": { - source: "iana", - compressible: true, - extensions: ["eot"] - }, - "application/vnd.ms-htmlhelp": { - source: "iana", - extensions: ["chm"] - }, - "application/vnd.ms-ims": { - source: "iana", - extensions: ["ims"] - }, - "application/vnd.ms-lrm": { - source: "iana", - extensions: ["lrm"] - }, - "application/vnd.ms-office.activex+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-officetheme": { - source: "iana", - extensions: ["thmx"] - }, - "application/vnd.ms-opentype": { - source: "apache", - compressible: true - }, - "application/vnd.ms-outlook": { - compressible: false, - extensions: ["msg"] - }, - "application/vnd.ms-package.obfuscated-opentype": { - source: "apache" - }, - "application/vnd.ms-pki.seccat": { - source: "apache", - extensions: ["cat"] - }, - "application/vnd.ms-pki.stl": { - source: "apache", - extensions: ["stl"] - }, - "application/vnd.ms-playready.initiator+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-powerpoint": { - source: "iana", - compressible: false, - extensions: ["ppt", "pps", "pot"] - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - source: "iana", - extensions: ["ppam"] - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - source: "iana", - extensions: ["pptm"] - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - source: "iana", - extensions: ["sldm"] - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - source: "iana", - extensions: ["ppsm"] - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - source: "iana", - extensions: ["potm"] - }, - "application/vnd.ms-printdevicecapabilities+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-printing.printticket+xml": { - source: "apache", - compressible: true - }, - "application/vnd.ms-printschematicket+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-project": { - source: "iana", - extensions: ["mpp", "mpt"] - }, - "application/vnd.ms-tnef": { - source: "iana" - }, - "application/vnd.ms-windows.devicepairing": { - source: "iana" - }, - "application/vnd.ms-windows.nwprinting.oob": { - source: "iana" - }, - "application/vnd.ms-windows.printerpairing": { - source: "iana" - }, - "application/vnd.ms-windows.wsd.oob": { - source: "iana" - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - source: "iana" - }, - "application/vnd.ms-wmdrm.lic-resp": { - source: "iana" - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - source: "iana" - }, - "application/vnd.ms-wmdrm.meter-resp": { - source: "iana" - }, - "application/vnd.ms-word.document.macroenabled.12": { - source: "iana", - extensions: ["docm"] - }, - "application/vnd.ms-word.template.macroenabled.12": { - source: "iana", - extensions: ["dotm"] - }, - "application/vnd.ms-works": { - source: "iana", - extensions: ["wps", "wks", "wcm", "wdb"] - }, - "application/vnd.ms-wpl": { - source: "iana", - extensions: ["wpl"] - }, - "application/vnd.ms-xpsdocument": { - source: "iana", - compressible: false, - extensions: ["xps"] - }, - "application/vnd.msa-disk-image": { - source: "iana" - }, - "application/vnd.mseq": { - source: "iana", - extensions: ["mseq"] - }, - "application/vnd.msign": { - source: "iana" - }, - "application/vnd.multiad.creator": { - source: "iana" - }, - "application/vnd.multiad.creator.cif": { - source: "iana" - }, - "application/vnd.music-niff": { - source: "iana" - }, - "application/vnd.musician": { - source: "iana", - extensions: ["mus"] - }, - "application/vnd.muvee.style": { - source: "iana", - extensions: ["msty"] - }, - "application/vnd.mynfc": { - source: "iana", - extensions: ["taglet"] - }, - "application/vnd.nacamar.ybrid+json": { - source: "iana", - compressible: true - }, - "application/vnd.ncd.control": { - source: "iana" - }, - "application/vnd.ncd.reference": { - source: "iana" - }, - "application/vnd.nearst.inv+json": { - source: "iana", - compressible: true - }, - "application/vnd.nebumind.line": { - source: "iana" - }, - "application/vnd.nervana": { - source: "iana" - }, - "application/vnd.netfpx": { - source: "iana" - }, - "application/vnd.neurolanguage.nlu": { - source: "iana", - extensions: ["nlu"] - }, - "application/vnd.nimn": { - source: "iana" - }, - "application/vnd.nintendo.nitro.rom": { - source: "iana" - }, - "application/vnd.nintendo.snes.rom": { - source: "iana" - }, - "application/vnd.nitf": { - source: "iana", - extensions: ["ntf", "nitf"] - }, - "application/vnd.noblenet-directory": { - source: "iana", - extensions: ["nnd"] - }, - "application/vnd.noblenet-sealer": { - source: "iana", - extensions: ["nns"] - }, - "application/vnd.noblenet-web": { - source: "iana", - extensions: ["nnw"] - }, - "application/vnd.nokia.catalogs": { - source: "iana" - }, - "application/vnd.nokia.conml+wbxml": { - source: "iana" - }, - "application/vnd.nokia.conml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.iptv.config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.isds-radio-presets": { - source: "iana" - }, - "application/vnd.nokia.landmark+wbxml": { - source: "iana" - }, - "application/vnd.nokia.landmark+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.landmarkcollection+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.n-gage.ac+xml": { - source: "iana", - compressible: true, - extensions: ["ac"] - }, - "application/vnd.nokia.n-gage.data": { - source: "iana", - extensions: ["ngdat"] - }, - "application/vnd.nokia.n-gage.symbian.install": { - source: "iana", - extensions: ["n-gage"] - }, - "application/vnd.nokia.ncd": { - source: "iana" - }, - "application/vnd.nokia.pcd+wbxml": { - source: "iana" - }, - "application/vnd.nokia.pcd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.radio-preset": { - source: "iana", - extensions: ["rpst"] - }, - "application/vnd.nokia.radio-presets": { - source: "iana", - extensions: ["rpss"] - }, - "application/vnd.novadigm.edm": { - source: "iana", - extensions: ["edm"] - }, - "application/vnd.novadigm.edx": { - source: "iana", - extensions: ["edx"] - }, - "application/vnd.novadigm.ext": { - source: "iana", - extensions: ["ext"] - }, - "application/vnd.ntt-local.content-share": { - source: "iana" - }, - "application/vnd.ntt-local.file-transfer": { - source: "iana" - }, - "application/vnd.ntt-local.ogw_remote-access": { - source: "iana" - }, - "application/vnd.ntt-local.sip-ta_remote": { - source: "iana" - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - source: "iana" - }, - "application/vnd.oasis.opendocument.chart": { - source: "iana", - extensions: ["odc"] - }, - "application/vnd.oasis.opendocument.chart-template": { - source: "iana", - extensions: ["otc"] - }, - "application/vnd.oasis.opendocument.database": { - source: "iana", - extensions: ["odb"] - }, - "application/vnd.oasis.opendocument.formula": { - source: "iana", - extensions: ["odf"] - }, - "application/vnd.oasis.opendocument.formula-template": { - source: "iana", - extensions: ["odft"] - }, - "application/vnd.oasis.opendocument.graphics": { - source: "iana", - compressible: false, - extensions: ["odg"] - }, - "application/vnd.oasis.opendocument.graphics-template": { - source: "iana", - extensions: ["otg"] - }, - "application/vnd.oasis.opendocument.image": { - source: "iana", - extensions: ["odi"] - }, - "application/vnd.oasis.opendocument.image-template": { - source: "iana", - extensions: ["oti"] - }, - "application/vnd.oasis.opendocument.presentation": { - source: "iana", - compressible: false, - extensions: ["odp"] - }, - "application/vnd.oasis.opendocument.presentation-template": { - source: "iana", - extensions: ["otp"] - }, - "application/vnd.oasis.opendocument.spreadsheet": { - source: "iana", - compressible: false, - extensions: ["ods"] - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - source: "iana", - extensions: ["ots"] - }, - "application/vnd.oasis.opendocument.text": { - source: "iana", - compressible: false, - extensions: ["odt"] - }, - "application/vnd.oasis.opendocument.text-master": { - source: "iana", - extensions: ["odm"] - }, - "application/vnd.oasis.opendocument.text-template": { - source: "iana", - extensions: ["ott"] - }, - "application/vnd.oasis.opendocument.text-web": { - source: "iana", - extensions: ["oth"] - }, - "application/vnd.obn": { - source: "iana" - }, - "application/vnd.ocf+cbor": { - source: "iana" - }, - "application/vnd.oci.image.manifest.v1+json": { - source: "iana", - compressible: true - }, - "application/vnd.oftn.l10n+json": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.contentaccessdownload+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.cspg-hexbinary": { - source: "iana" - }, - "application/vnd.oipf.dae.svg+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.dae.xhtml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.pae.gem": { - source: "iana" - }, - "application/vnd.oipf.spdiscovery+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.spdlist+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.ueprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.userprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.olpc-sugar": { - source: "iana", - extensions: ["xo"] - }, - "application/vnd.oma-scws-config": { - source: "iana" - }, - "application/vnd.oma-scws-http-request": { - source: "iana" - }, - "application/vnd.oma-scws-http-response": { - source: "iana" - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.imd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.ltkm": { - source: "iana" - }, - "application/vnd.oma.bcast.notification+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.provisioningtrigger": { - source: "iana" - }, - "application/vnd.oma.bcast.sgboot": { - source: "iana" - }, - "application/vnd.oma.bcast.sgdd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.sgdu": { - source: "iana" - }, - "application/vnd.oma.bcast.simple-symbol-container": { - source: "iana" - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.sprov+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.stkm": { - source: "iana" - }, - "application/vnd.oma.cab-address-book+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-feature-handler+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-pcc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-subs-invite+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-user-prefs+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.dcd": { - source: "iana" - }, - "application/vnd.oma.dcdc": { - source: "iana" - }, - "application/vnd.oma.dd2+xml": { - source: "iana", - compressible: true, - extensions: ["dd2"] - }, - "application/vnd.oma.drm.risd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.group-usage-list+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.lwm2m+cbor": { - source: "iana" - }, - "application/vnd.oma.lwm2m+json": { - source: "iana", - compressible: true - }, - "application/vnd.oma.lwm2m+tlv": { - source: "iana" - }, - "application/vnd.oma.pal+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.final-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.groups+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.push": { - source: "iana" - }, - "application/vnd.oma.scidm.messages+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.xcap-directory+xml": { - source: "iana", - compressible: true - }, - "application/vnd.omads-email+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omads-file+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omads-folder+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omaloc-supl-init": { - source: "iana" - }, - "application/vnd.onepager": { - source: "iana" - }, - "application/vnd.onepagertamp": { - source: "iana" - }, - "application/vnd.onepagertamx": { - source: "iana" - }, - "application/vnd.onepagertat": { - source: "iana" - }, - "application/vnd.onepagertatp": { - source: "iana" - }, - "application/vnd.onepagertatx": { - source: "iana" - }, - "application/vnd.openblox.game+xml": { - source: "iana", - compressible: true, - extensions: ["obgx"] - }, - "application/vnd.openblox.game-binary": { - source: "iana" - }, - "application/vnd.openeye.oeb": { - source: "iana" - }, - "application/vnd.openofficeorg.extension": { - source: "apache", - extensions: ["oxt"] - }, - "application/vnd.openstreetmap.data+xml": { - source: "iana", - compressible: true, - extensions: ["osm"] - }, - "application/vnd.opentimestamps.ots": { - source: "iana" - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - source: "iana", - compressible: false, - extensions: ["pptx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - source: "iana", - extensions: ["sldx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - source: "iana", - extensions: ["ppsx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - source: "iana", - extensions: ["potx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - source: "iana", - compressible: false, - extensions: ["xlsx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - source: "iana", - extensions: ["xltx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - source: "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - source: "iana", - compressible: false, - extensions: ["docx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - source: "iana", - extensions: ["dotx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.relationships+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oracle.resource+json": { - source: "iana", - compressible: true - }, - "application/vnd.orange.indata": { - source: "iana" - }, - "application/vnd.osa.netdeploy": { - source: "iana" - }, - "application/vnd.osgeo.mapguide.package": { - source: "iana", - extensions: ["mgp"] - }, - "application/vnd.osgi.bundle": { - source: "iana" - }, - "application/vnd.osgi.dp": { - source: "iana", - extensions: ["dp"] - }, - "application/vnd.osgi.subsystem": { - source: "iana", - extensions: ["esa"] - }, - "application/vnd.otps.ct-kip+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oxli.countgraph": { - source: "iana" - }, - "application/vnd.pagerduty+json": { - source: "iana", - compressible: true - }, - "application/vnd.palm": { - source: "iana", - extensions: ["pdb", "pqa", "oprc"] - }, - "application/vnd.panoply": { - source: "iana" - }, - "application/vnd.paos.xml": { - source: "iana" - }, - "application/vnd.patentdive": { - source: "iana" - }, - "application/vnd.patientecommsdoc": { - source: "iana" - }, - "application/vnd.pawaafile": { - source: "iana", - extensions: ["paw"] - }, - "application/vnd.pcos": { - source: "iana" - }, - "application/vnd.pg.format": { - source: "iana", - extensions: ["str"] - }, - "application/vnd.pg.osasli": { - source: "iana", - extensions: ["ei6"] - }, - "application/vnd.piaccess.application-licence": { - source: "iana" - }, - "application/vnd.picsel": { - source: "iana", - extensions: ["efif"] - }, - "application/vnd.pmi.widget": { - source: "iana", - extensions: ["wg"] - }, - "application/vnd.poc.group-advertisement+xml": { - source: "iana", - compressible: true - }, - "application/vnd.pocketlearn": { - source: "iana", - extensions: ["plf"] - }, - "application/vnd.powerbuilder6": { - source: "iana", - extensions: ["pbd"] - }, - "application/vnd.powerbuilder6-s": { - source: "iana" - }, - "application/vnd.powerbuilder7": { - source: "iana" - }, - "application/vnd.powerbuilder7-s": { - source: "iana" - }, - "application/vnd.powerbuilder75": { - source: "iana" - }, - "application/vnd.powerbuilder75-s": { - source: "iana" - }, - "application/vnd.preminet": { - source: "iana" - }, - "application/vnd.previewsystems.box": { - source: "iana", - extensions: ["box"] - }, - "application/vnd.proteus.magazine": { - source: "iana", - extensions: ["mgz"] - }, - "application/vnd.psfs": { - source: "iana" - }, - "application/vnd.publishare-delta-tree": { - source: "iana", - extensions: ["qps"] - }, - "application/vnd.pvi.ptid1": { - source: "iana", - extensions: ["ptid"] - }, - "application/vnd.pwg-multiplexed": { - source: "iana" - }, - "application/vnd.pwg-xhtml-print+xml": { - source: "iana", - compressible: true - }, - "application/vnd.qualcomm.brew-app-res": { - source: "iana" - }, - "application/vnd.quarantainenet": { - source: "iana" - }, - "application/vnd.quark.quarkxpress": { - source: "iana", - extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] - }, - "application/vnd.quobject-quoxdocument": { - source: "iana" - }, - "application/vnd.radisys.moml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-conf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-conn+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-stream+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-conf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-base+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-group+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - source: "iana", - compressible: true - }, - "application/vnd.rainstor.data": { - source: "iana" - }, - "application/vnd.rapid": { - source: "iana" - }, - "application/vnd.rar": { - source: "iana", - extensions: ["rar"] - }, - "application/vnd.realvnc.bed": { - source: "iana", - extensions: ["bed"] - }, - "application/vnd.recordare.musicxml": { - source: "iana", - extensions: ["mxl"] - }, - "application/vnd.recordare.musicxml+xml": { - source: "iana", - compressible: true, - extensions: ["musicxml"] - }, - "application/vnd.renlearn.rlprint": { - source: "iana" - }, - "application/vnd.resilient.logic": { - source: "iana" - }, - "application/vnd.restful+json": { - source: "iana", - compressible: true - }, - "application/vnd.rig.cryptonote": { - source: "iana", - extensions: ["cryptonote"] - }, - "application/vnd.rim.cod": { - source: "apache", - extensions: ["cod"] - }, - "application/vnd.rn-realmedia": { - source: "apache", - extensions: ["rm"] - }, - "application/vnd.rn-realmedia-vbr": { - source: "apache", - extensions: ["rmvb"] - }, - "application/vnd.route66.link66+xml": { - source: "iana", - compressible: true, - extensions: ["link66"] - }, - "application/vnd.rs-274x": { - source: "iana" - }, - "application/vnd.ruckus.download": { - source: "iana" - }, - "application/vnd.s3sms": { - source: "iana" - }, - "application/vnd.sailingtracker.track": { - source: "iana", - extensions: ["st"] - }, - "application/vnd.sar": { - source: "iana" - }, - "application/vnd.sbm.cid": { - source: "iana" - }, - "application/vnd.sbm.mid2": { - source: "iana" - }, - "application/vnd.scribus": { - source: "iana" - }, - "application/vnd.sealed.3df": { - source: "iana" - }, - "application/vnd.sealed.csf": { - source: "iana" - }, - "application/vnd.sealed.doc": { - source: "iana" - }, - "application/vnd.sealed.eml": { - source: "iana" - }, - "application/vnd.sealed.mht": { - source: "iana" - }, - "application/vnd.sealed.net": { - source: "iana" - }, - "application/vnd.sealed.ppt": { - source: "iana" - }, - "application/vnd.sealed.tiff": { - source: "iana" - }, - "application/vnd.sealed.xls": { - source: "iana" - }, - "application/vnd.sealedmedia.softseal.html": { - source: "iana" - }, - "application/vnd.sealedmedia.softseal.pdf": { - source: "iana" - }, - "application/vnd.seemail": { - source: "iana", - extensions: ["see"] - }, - "application/vnd.seis+json": { - source: "iana", - compressible: true - }, - "application/vnd.sema": { - source: "iana", - extensions: ["sema"] - }, - "application/vnd.semd": { - source: "iana", - extensions: ["semd"] - }, - "application/vnd.semf": { - source: "iana", - extensions: ["semf"] - }, - "application/vnd.shade-save-file": { - source: "iana" - }, - "application/vnd.shana.informed.formdata": { - source: "iana", - extensions: ["ifm"] - }, - "application/vnd.shana.informed.formtemplate": { - source: "iana", - extensions: ["itp"] - }, - "application/vnd.shana.informed.interchange": { - source: "iana", - extensions: ["iif"] - }, - "application/vnd.shana.informed.package": { - source: "iana", - extensions: ["ipk"] - }, - "application/vnd.shootproof+json": { - source: "iana", - compressible: true - }, - "application/vnd.shopkick+json": { - source: "iana", - compressible: true - }, - "application/vnd.shp": { - source: "iana" - }, - "application/vnd.shx": { - source: "iana" - }, - "application/vnd.sigrok.session": { - source: "iana" - }, - "application/vnd.simtech-mindmapper": { - source: "iana", - extensions: ["twd", "twds"] - }, - "application/vnd.siren+json": { - source: "iana", - compressible: true - }, - "application/vnd.smaf": { - source: "iana", - extensions: ["mmf"] - }, - "application/vnd.smart.notebook": { - source: "iana" - }, - "application/vnd.smart.teacher": { - source: "iana", - extensions: ["teacher"] - }, - "application/vnd.snesdev-page-table": { - source: "iana" - }, - "application/vnd.software602.filler.form+xml": { - source: "iana", - compressible: true, - extensions: ["fo"] - }, - "application/vnd.software602.filler.form-xml-zip": { - source: "iana" - }, - "application/vnd.solent.sdkm+xml": { - source: "iana", - compressible: true, - extensions: ["sdkm", "sdkd"] - }, - "application/vnd.spotfire.dxp": { - source: "iana", - extensions: ["dxp"] - }, - "application/vnd.spotfire.sfs": { - source: "iana", - extensions: ["sfs"] - }, - "application/vnd.sqlite3": { - source: "iana" - }, - "application/vnd.sss-cod": { - source: "iana" - }, - "application/vnd.sss-dtf": { - source: "iana" - }, - "application/vnd.sss-ntf": { - source: "iana" - }, - "application/vnd.stardivision.calc": { - source: "apache", - extensions: ["sdc"] - }, - "application/vnd.stardivision.draw": { - source: "apache", - extensions: ["sda"] - }, - "application/vnd.stardivision.impress": { - source: "apache", - extensions: ["sdd"] - }, - "application/vnd.stardivision.math": { - source: "apache", - extensions: ["smf"] - }, - "application/vnd.stardivision.writer": { - source: "apache", - extensions: ["sdw", "vor"] - }, - "application/vnd.stardivision.writer-global": { - source: "apache", - extensions: ["sgl"] - }, - "application/vnd.stepmania.package": { - source: "iana", - extensions: ["smzip"] - }, - "application/vnd.stepmania.stepchart": { - source: "iana", - extensions: ["sm"] - }, - "application/vnd.street-stream": { - source: "iana" - }, - "application/vnd.sun.wadl+xml": { - source: "iana", - compressible: true, - extensions: ["wadl"] - }, - "application/vnd.sun.xml.calc": { - source: "apache", - extensions: ["sxc"] - }, - "application/vnd.sun.xml.calc.template": { - source: "apache", - extensions: ["stc"] - }, - "application/vnd.sun.xml.draw": { - source: "apache", - extensions: ["sxd"] - }, - "application/vnd.sun.xml.draw.template": { - source: "apache", - extensions: ["std"] - }, - "application/vnd.sun.xml.impress": { - source: "apache", - extensions: ["sxi"] - }, - "application/vnd.sun.xml.impress.template": { - source: "apache", - extensions: ["sti"] - }, - "application/vnd.sun.xml.math": { - source: "apache", - extensions: ["sxm"] - }, - "application/vnd.sun.xml.writer": { - source: "apache", - extensions: ["sxw"] - }, - "application/vnd.sun.xml.writer.global": { - source: "apache", - extensions: ["sxg"] - }, - "application/vnd.sun.xml.writer.template": { - source: "apache", - extensions: ["stw"] - }, - "application/vnd.sus-calendar": { - source: "iana", - extensions: ["sus", "susp"] - }, - "application/vnd.svd": { - source: "iana", - extensions: ["svd"] - }, - "application/vnd.swiftview-ics": { - source: "iana" - }, - "application/vnd.sycle+xml": { - source: "iana", - compressible: true - }, - "application/vnd.syft+json": { - source: "iana", - compressible: true - }, - "application/vnd.symbian.install": { - source: "apache", - extensions: ["sis", "sisx"] - }, - "application/vnd.syncml+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["xsm"] - }, - "application/vnd.syncml.dm+wbxml": { - source: "iana", - charset: "UTF-8", - extensions: ["bdm"] - }, - "application/vnd.syncml.dm+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["xdm"] - }, - "application/vnd.syncml.dm.notification": { - source: "iana" - }, - "application/vnd.syncml.dmddf+wbxml": { - source: "iana" - }, - "application/vnd.syncml.dmddf+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["ddf"] - }, - "application/vnd.syncml.dmtnds+wbxml": { - source: "iana" - }, - "application/vnd.syncml.dmtnds+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.syncml.ds.notification": { - source: "iana" - }, - "application/vnd.tableschema+json": { - source: "iana", - compressible: true - }, - "application/vnd.tao.intent-module-archive": { - source: "iana", - extensions: ["tao"] - }, - "application/vnd.tcpdump.pcap": { - source: "iana", - extensions: ["pcap", "cap", "dmp"] - }, - "application/vnd.think-cell.ppttc+json": { - source: "iana", - compressible: true - }, - "application/vnd.tmd.mediaflex.api+xml": { - source: "iana", - compressible: true - }, - "application/vnd.tml": { - source: "iana" - }, - "application/vnd.tmobile-livetv": { - source: "iana", - extensions: ["tmo"] - }, - "application/vnd.tri.onesource": { - source: "iana" - }, - "application/vnd.trid.tpt": { - source: "iana", - extensions: ["tpt"] - }, - "application/vnd.triscape.mxs": { - source: "iana", - extensions: ["mxs"] - }, - "application/vnd.trueapp": { - source: "iana", - extensions: ["tra"] - }, - "application/vnd.truedoc": { - source: "iana" - }, - "application/vnd.ubisoft.webplayer": { - source: "iana" - }, - "application/vnd.ufdl": { - source: "iana", - extensions: ["ufd", "ufdl"] - }, - "application/vnd.uiq.theme": { - source: "iana", - extensions: ["utz"] - }, - "application/vnd.umajin": { - source: "iana", - extensions: ["umj"] - }, - "application/vnd.unity": { - source: "iana", - extensions: ["unityweb"] - }, - "application/vnd.uoml+xml": { - source: "iana", - compressible: true, - extensions: ["uoml"] - }, - "application/vnd.uplanet.alert": { - source: "iana" - }, - "application/vnd.uplanet.alert-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.bearer-choice": { - source: "iana" - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.cacheop": { - source: "iana" - }, - "application/vnd.uplanet.cacheop-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.channel": { - source: "iana" - }, - "application/vnd.uplanet.channel-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.list": { - source: "iana" - }, - "application/vnd.uplanet.list-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.listcmd": { - source: "iana" - }, - "application/vnd.uplanet.listcmd-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.signal": { - source: "iana" - }, - "application/vnd.uri-map": { - source: "iana" - }, - "application/vnd.valve.source.material": { - source: "iana" - }, - "application/vnd.vcx": { - source: "iana", - extensions: ["vcx"] - }, - "application/vnd.vd-study": { - source: "iana" - }, - "application/vnd.vectorworks": { - source: "iana" - }, - "application/vnd.vel+json": { - source: "iana", - compressible: true - }, - "application/vnd.verimatrix.vcas": { - source: "iana" - }, - "application/vnd.veritone.aion+json": { - source: "iana", - compressible: true - }, - "application/vnd.veryant.thin": { - source: "iana" - }, - "application/vnd.ves.encrypted": { - source: "iana" - }, - "application/vnd.vidsoft.vidconference": { - source: "iana" - }, - "application/vnd.visio": { - source: "iana", - extensions: ["vsd", "vst", "vss", "vsw"] - }, - "application/vnd.visionary": { - source: "iana", - extensions: ["vis"] - }, - "application/vnd.vividence.scriptfile": { - source: "iana" - }, - "application/vnd.vsf": { - source: "iana", - extensions: ["vsf"] - }, - "application/vnd.wap.sic": { - source: "iana" - }, - "application/vnd.wap.slc": { - source: "iana" - }, - "application/vnd.wap.wbxml": { - source: "iana", - charset: "UTF-8", - extensions: ["wbxml"] - }, - "application/vnd.wap.wmlc": { - source: "iana", - extensions: ["wmlc"] - }, - "application/vnd.wap.wmlscriptc": { - source: "iana", - extensions: ["wmlsc"] - }, - "application/vnd.webturbo": { - source: "iana", - extensions: ["wtb"] - }, - "application/vnd.wfa.dpp": { - source: "iana" - }, - "application/vnd.wfa.p2p": { - source: "iana" - }, - "application/vnd.wfa.wsc": { - source: "iana" - }, - "application/vnd.windows.devicepairing": { - source: "iana" - }, - "application/vnd.wmc": { - source: "iana" - }, - "application/vnd.wmf.bootstrap": { - source: "iana" - }, - "application/vnd.wolfram.mathematica": { - source: "iana" - }, - "application/vnd.wolfram.mathematica.package": { - source: "iana" - }, - "application/vnd.wolfram.player": { - source: "iana", - extensions: ["nbp"] - }, - "application/vnd.wordperfect": { - source: "iana", - extensions: ["wpd"] - }, - "application/vnd.wqd": { - source: "iana", - extensions: ["wqd"] - }, - "application/vnd.wrq-hp3000-labelled": { - source: "iana" - }, - "application/vnd.wt.stf": { - source: "iana", - extensions: ["stf"] - }, - "application/vnd.wv.csp+wbxml": { - source: "iana" - }, - "application/vnd.wv.csp+xml": { - source: "iana", - compressible: true - }, - "application/vnd.wv.ssp+xml": { - source: "iana", - compressible: true - }, - "application/vnd.xacml+json": { - source: "iana", - compressible: true - }, - "application/vnd.xara": { - source: "iana", - extensions: ["xar"] - }, - "application/vnd.xfdl": { - source: "iana", - extensions: ["xfdl"] - }, - "application/vnd.xfdl.webform": { - source: "iana" - }, - "application/vnd.xmi+xml": { - source: "iana", - compressible: true - }, - "application/vnd.xmpie.cpkg": { - source: "iana" - }, - "application/vnd.xmpie.dpkg": { - source: "iana" - }, - "application/vnd.xmpie.plan": { - source: "iana" - }, - "application/vnd.xmpie.ppkg": { - source: "iana" - }, - "application/vnd.xmpie.xlim": { - source: "iana" - }, - "application/vnd.yamaha.hv-dic": { - source: "iana", - extensions: ["hvd"] - }, - "application/vnd.yamaha.hv-script": { - source: "iana", - extensions: ["hvs"] - }, - "application/vnd.yamaha.hv-voice": { - source: "iana", - extensions: ["hvp"] - }, - "application/vnd.yamaha.openscoreformat": { - source: "iana", - extensions: ["osf"] - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - source: "iana", - compressible: true, - extensions: ["osfpvg"] - }, - "application/vnd.yamaha.remote-setup": { - source: "iana" - }, - "application/vnd.yamaha.smaf-audio": { - source: "iana", - extensions: ["saf"] - }, - "application/vnd.yamaha.smaf-phrase": { - source: "iana", - extensions: ["spf"] - }, - "application/vnd.yamaha.through-ngn": { - source: "iana" - }, - "application/vnd.yamaha.tunnel-udpencap": { - source: "iana" - }, - "application/vnd.yaoweme": { - source: "iana" - }, - "application/vnd.yellowriver-custom-menu": { - source: "iana", - extensions: ["cmp"] - }, - "application/vnd.youtube.yt": { - source: "iana" - }, - "application/vnd.zul": { - source: "iana", - extensions: ["zir", "zirz"] - }, - "application/vnd.zzazz.deck+xml": { - source: "iana", - compressible: true, - extensions: ["zaz"] - }, - "application/voicexml+xml": { - source: "iana", - compressible: true, - extensions: ["vxml"] - }, - "application/voucher-cms+json": { - source: "iana", - compressible: true - }, - "application/vq-rtcpxr": { - source: "iana" - }, - "application/wasm": { - source: "iana", - compressible: true, - extensions: ["wasm"] - }, - "application/watcherinfo+xml": { - source: "iana", - compressible: true, - extensions: ["wif"] - }, - "application/webpush-options+json": { - source: "iana", - compressible: true - }, - "application/whoispp-query": { - source: "iana" - }, - "application/whoispp-response": { - source: "iana" - }, - "application/widget": { - source: "iana", - extensions: ["wgt"] - }, - "application/winhlp": { - source: "apache", - extensions: ["hlp"] - }, - "application/wita": { - source: "iana" - }, - "application/wordperfect5.1": { - source: "iana" - }, - "application/wsdl+xml": { - source: "iana", - compressible: true, - extensions: ["wsdl"] - }, - "application/wspolicy+xml": { - source: "iana", - compressible: true, - extensions: ["wspolicy"] - }, - "application/x-7z-compressed": { - source: "apache", - compressible: false, - extensions: ["7z"] - }, - "application/x-abiword": { - source: "apache", - extensions: ["abw"] - }, - "application/x-ace-compressed": { - source: "apache", - extensions: ["ace"] - }, - "application/x-amf": { - source: "apache" - }, - "application/x-apple-diskimage": { - source: "apache", - extensions: ["dmg"] - }, - "application/x-arj": { - compressible: false, - extensions: ["arj"] - }, - "application/x-authorware-bin": { - source: "apache", - extensions: ["aab", "x32", "u32", "vox"] - }, - "application/x-authorware-map": { - source: "apache", - extensions: ["aam"] - }, - "application/x-authorware-seg": { - source: "apache", - extensions: ["aas"] - }, - "application/x-bcpio": { - source: "apache", - extensions: ["bcpio"] - }, - "application/x-bdoc": { - compressible: false, - extensions: ["bdoc"] - }, - "application/x-bittorrent": { - source: "apache", - extensions: ["torrent"] - }, - "application/x-blorb": { - source: "apache", - extensions: ["blb", "blorb"] - }, - "application/x-bzip": { - source: "apache", - compressible: false, - extensions: ["bz"] - }, - "application/x-bzip2": { - source: "apache", - compressible: false, - extensions: ["bz2", "boz"] - }, - "application/x-cbr": { - source: "apache", - extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] - }, - "application/x-cdlink": { - source: "apache", - extensions: ["vcd"] - }, - "application/x-cfs-compressed": { - source: "apache", - extensions: ["cfs"] - }, - "application/x-chat": { - source: "apache", - extensions: ["chat"] - }, - "application/x-chess-pgn": { - source: "apache", - extensions: ["pgn"] - }, - "application/x-chrome-extension": { - extensions: ["crx"] - }, - "application/x-cocoa": { - source: "nginx", - extensions: ["cco"] - }, - "application/x-compress": { - source: "apache" - }, - "application/x-conference": { - source: "apache", - extensions: ["nsc"] - }, - "application/x-cpio": { - source: "apache", - extensions: ["cpio"] - }, - "application/x-csh": { - source: "apache", - extensions: ["csh"] - }, - "application/x-deb": { - compressible: false - }, - "application/x-debian-package": { - source: "apache", - extensions: ["deb", "udeb"] - }, - "application/x-dgc-compressed": { - source: "apache", - extensions: ["dgc"] - }, - "application/x-director": { - source: "apache", - extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] - }, - "application/x-doom": { - source: "apache", - extensions: ["wad"] - }, - "application/x-dtbncx+xml": { - source: "apache", - compressible: true, - extensions: ["ncx"] - }, - "application/x-dtbook+xml": { - source: "apache", - compressible: true, - extensions: ["dtb"] - }, - "application/x-dtbresource+xml": { - source: "apache", - compressible: true, - extensions: ["res"] - }, - "application/x-dvi": { - source: "apache", - compressible: false, - extensions: ["dvi"] - }, - "application/x-envoy": { - source: "apache", - extensions: ["evy"] - }, - "application/x-eva": { - source: "apache", - extensions: ["eva"] - }, - "application/x-font-bdf": { - source: "apache", - extensions: ["bdf"] - }, - "application/x-font-dos": { - source: "apache" - }, - "application/x-font-framemaker": { - source: "apache" - }, - "application/x-font-ghostscript": { - source: "apache", - extensions: ["gsf"] - }, - "application/x-font-libgrx": { - source: "apache" - }, - "application/x-font-linux-psf": { - source: "apache", - extensions: ["psf"] - }, - "application/x-font-pcf": { - source: "apache", - extensions: ["pcf"] - }, - "application/x-font-snf": { - source: "apache", - extensions: ["snf"] - }, - "application/x-font-speedo": { - source: "apache" - }, - "application/x-font-sunos-news": { - source: "apache" - }, - "application/x-font-type1": { - source: "apache", - extensions: ["pfa", "pfb", "pfm", "afm"] - }, - "application/x-font-vfont": { - source: "apache" - }, - "application/x-freearc": { - source: "apache", - extensions: ["arc"] - }, - "application/x-futuresplash": { - source: "apache", - extensions: ["spl"] - }, - "application/x-gca-compressed": { - source: "apache", - extensions: ["gca"] - }, - "application/x-glulx": { - source: "apache", - extensions: ["ulx"] - }, - "application/x-gnumeric": { - source: "apache", - extensions: ["gnumeric"] - }, - "application/x-gramps-xml": { - source: "apache", - extensions: ["gramps"] - }, - "application/x-gtar": { - source: "apache", - extensions: ["gtar"] - }, - "application/x-gzip": { - source: "apache" - }, - "application/x-hdf": { - source: "apache", - extensions: ["hdf"] - }, - "application/x-httpd-php": { - compressible: true, - extensions: ["php"] - }, - "application/x-install-instructions": { - source: "apache", - extensions: ["install"] - }, - "application/x-iso9660-image": { - source: "apache", - extensions: ["iso"] - }, - "application/x-iwork-keynote-sffkey": { - extensions: ["key"] - }, - "application/x-iwork-numbers-sffnumbers": { - extensions: ["numbers"] - }, - "application/x-iwork-pages-sffpages": { - extensions: ["pages"] - }, - "application/x-java-archive-diff": { - source: "nginx", - extensions: ["jardiff"] - }, - "application/x-java-jnlp-file": { - source: "apache", - compressible: false, - extensions: ["jnlp"] - }, - "application/x-javascript": { - compressible: true - }, - "application/x-keepass2": { - extensions: ["kdbx"] - }, - "application/x-latex": { - source: "apache", - compressible: false, - extensions: ["latex"] - }, - "application/x-lua-bytecode": { - extensions: ["luac"] - }, - "application/x-lzh-compressed": { - source: "apache", - extensions: ["lzh", "lha"] - }, - "application/x-makeself": { - source: "nginx", - extensions: ["run"] - }, - "application/x-mie": { - source: "apache", - extensions: ["mie"] - }, - "application/x-mobipocket-ebook": { - source: "apache", - extensions: ["prc", "mobi"] - }, - "application/x-mpegurl": { - compressible: false - }, - "application/x-ms-application": { - source: "apache", - extensions: ["application"] - }, - "application/x-ms-shortcut": { - source: "apache", - extensions: ["lnk"] - }, - "application/x-ms-wmd": { - source: "apache", - extensions: ["wmd"] - }, - "application/x-ms-wmz": { - source: "apache", - extensions: ["wmz"] - }, - "application/x-ms-xbap": { - source: "apache", - extensions: ["xbap"] - }, - "application/x-msaccess": { - source: "apache", - extensions: ["mdb"] - }, - "application/x-msbinder": { - source: "apache", - extensions: ["obd"] - }, - "application/x-mscardfile": { - source: "apache", - extensions: ["crd"] - }, - "application/x-msclip": { - source: "apache", - extensions: ["clp"] - }, - "application/x-msdos-program": { - extensions: ["exe"] - }, - "application/x-msdownload": { - source: "apache", - extensions: ["exe", "dll", "com", "bat", "msi"] - }, - "application/x-msmediaview": { - source: "apache", - extensions: ["mvb", "m13", "m14"] - }, - "application/x-msmetafile": { - source: "apache", - extensions: ["wmf", "wmz", "emf", "emz"] - }, - "application/x-msmoney": { - source: "apache", - extensions: ["mny"] - }, - "application/x-mspublisher": { - source: "apache", - extensions: ["pub"] - }, - "application/x-msschedule": { - source: "apache", - extensions: ["scd"] - }, - "application/x-msterminal": { - source: "apache", - extensions: ["trm"] - }, - "application/x-mswrite": { - source: "apache", - extensions: ["wri"] - }, - "application/x-netcdf": { - source: "apache", - extensions: ["nc", "cdf"] - }, - "application/x-ns-proxy-autoconfig": { - compressible: true, - extensions: ["pac"] - }, - "application/x-nzb": { - source: "apache", - extensions: ["nzb"] - }, - "application/x-perl": { - source: "nginx", - extensions: ["pl", "pm"] - }, - "application/x-pilot": { - source: "nginx", - extensions: ["prc", "pdb"] - }, - "application/x-pkcs12": { - source: "apache", - compressible: false, - extensions: ["p12", "pfx"] - }, - "application/x-pkcs7-certificates": { - source: "apache", - extensions: ["p7b", "spc"] - }, - "application/x-pkcs7-certreqresp": { - source: "apache", - extensions: ["p7r"] - }, - "application/x-pki-message": { - source: "iana" - }, - "application/x-rar-compressed": { - source: "apache", - compressible: false, - extensions: ["rar"] - }, - "application/x-redhat-package-manager": { - source: "nginx", - extensions: ["rpm"] - }, - "application/x-research-info-systems": { - source: "apache", - extensions: ["ris"] - }, - "application/x-sea": { - source: "nginx", - extensions: ["sea"] - }, - "application/x-sh": { - source: "apache", - compressible: true, - extensions: ["sh"] - }, - "application/x-shar": { - source: "apache", - extensions: ["shar"] - }, - "application/x-shockwave-flash": { - source: "apache", - compressible: false, - extensions: ["swf"] - }, - "application/x-silverlight-app": { - source: "apache", - extensions: ["xap"] - }, - "application/x-sql": { - source: "apache", - extensions: ["sql"] - }, - "application/x-stuffit": { - source: "apache", - compressible: false, - extensions: ["sit"] - }, - "application/x-stuffitx": { - source: "apache", - extensions: ["sitx"] - }, - "application/x-subrip": { - source: "apache", - extensions: ["srt"] - }, - "application/x-sv4cpio": { - source: "apache", - extensions: ["sv4cpio"] - }, - "application/x-sv4crc": { - source: "apache", - extensions: ["sv4crc"] - }, - "application/x-t3vm-image": { - source: "apache", - extensions: ["t3"] - }, - "application/x-tads": { - source: "apache", - extensions: ["gam"] - }, - "application/x-tar": { - source: "apache", - compressible: true, - extensions: ["tar"] - }, - "application/x-tcl": { - source: "apache", - extensions: ["tcl", "tk"] - }, - "application/x-tex": { - source: "apache", - extensions: ["tex"] - }, - "application/x-tex-tfm": { - source: "apache", - extensions: ["tfm"] - }, - "application/x-texinfo": { - source: "apache", - extensions: ["texinfo", "texi"] - }, - "application/x-tgif": { - source: "apache", - extensions: ["obj"] - }, - "application/x-ustar": { - source: "apache", - extensions: ["ustar"] - }, - "application/x-virtualbox-hdd": { - compressible: true, - extensions: ["hdd"] - }, - "application/x-virtualbox-ova": { - compressible: true, - extensions: ["ova"] - }, - "application/x-virtualbox-ovf": { - compressible: true, - extensions: ["ovf"] - }, - "application/x-virtualbox-vbox": { - compressible: true, - extensions: ["vbox"] - }, - "application/x-virtualbox-vbox-extpack": { - compressible: false, - extensions: ["vbox-extpack"] - }, - "application/x-virtualbox-vdi": { - compressible: true, - extensions: ["vdi"] - }, - "application/x-virtualbox-vhd": { - compressible: true, - extensions: ["vhd"] - }, - "application/x-virtualbox-vmdk": { - compressible: true, - extensions: ["vmdk"] - }, - "application/x-wais-source": { - source: "apache", - extensions: ["src"] - }, - "application/x-web-app-manifest+json": { - compressible: true, - extensions: ["webapp"] - }, - "application/x-www-form-urlencoded": { - source: "iana", - compressible: true - }, - "application/x-x509-ca-cert": { - source: "iana", - extensions: ["der", "crt", "pem"] - }, - "application/x-x509-ca-ra-cert": { - source: "iana" - }, - "application/x-x509-next-ca-cert": { - source: "iana" - }, - "application/x-xfig": { - source: "apache", - extensions: ["fig"] - }, - "application/x-xliff+xml": { - source: "apache", - compressible: true, - extensions: ["xlf"] - }, - "application/x-xpinstall": { - source: "apache", - compressible: false, - extensions: ["xpi"] - }, - "application/x-xz": { - source: "apache", - extensions: ["xz"] - }, - "application/x-zmachine": { - source: "apache", - extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] - }, - "application/x400-bp": { - source: "iana" - }, - "application/xacml+xml": { - source: "iana", - compressible: true - }, - "application/xaml+xml": { - source: "apache", - compressible: true, - extensions: ["xaml"] - }, - "application/xcap-att+xml": { - source: "iana", - compressible: true, - extensions: ["xav"] - }, - "application/xcap-caps+xml": { - source: "iana", - compressible: true, - extensions: ["xca"] - }, - "application/xcap-diff+xml": { - source: "iana", - compressible: true, - extensions: ["xdf"] - }, - "application/xcap-el+xml": { - source: "iana", - compressible: true, - extensions: ["xel"] - }, - "application/xcap-error+xml": { - source: "iana", - compressible: true - }, - "application/xcap-ns+xml": { - source: "iana", - compressible: true, - extensions: ["xns"] - }, - "application/xcon-conference-info+xml": { - source: "iana", - compressible: true - }, - "application/xcon-conference-info-diff+xml": { - source: "iana", - compressible: true - }, - "application/xenc+xml": { - source: "iana", - compressible: true, - extensions: ["xenc"] - }, - "application/xhtml+xml": { - source: "iana", - compressible: true, - extensions: ["xhtml", "xht"] - }, - "application/xhtml-voice+xml": { - source: "apache", - compressible: true - }, - "application/xliff+xml": { - source: "iana", - compressible: true, - extensions: ["xlf"] - }, - "application/xml": { - source: "iana", - compressible: true, - extensions: ["xml", "xsl", "xsd", "rng"] - }, - "application/xml-dtd": { - source: "iana", - compressible: true, - extensions: ["dtd"] - }, - "application/xml-external-parsed-entity": { - source: "iana" - }, - "application/xml-patch+xml": { - source: "iana", - compressible: true - }, - "application/xmpp+xml": { - source: "iana", - compressible: true - }, - "application/xop+xml": { - source: "iana", - compressible: true, - extensions: ["xop"] - }, - "application/xproc+xml": { - source: "apache", - compressible: true, - extensions: ["xpl"] - }, - "application/xslt+xml": { - source: "iana", - compressible: true, - extensions: ["xsl", "xslt"] - }, - "application/xspf+xml": { - source: "apache", - compressible: true, - extensions: ["xspf"] - }, - "application/xv+xml": { - source: "iana", - compressible: true, - extensions: ["mxml", "xhvml", "xvml", "xvm"] - }, - "application/yang": { - source: "iana", - extensions: ["yang"] - }, - "application/yang-data+json": { - source: "iana", - compressible: true - }, - "application/yang-data+xml": { - source: "iana", - compressible: true - }, - "application/yang-patch+json": { - source: "iana", - compressible: true - }, - "application/yang-patch+xml": { - source: "iana", - compressible: true - }, - "application/yin+xml": { - source: "iana", - compressible: true, - extensions: ["yin"] - }, - "application/zip": { - source: "iana", - compressible: false, - extensions: ["zip"] - }, - "application/zlib": { - source: "iana" - }, - "application/zstd": { - source: "iana" - }, - "audio/1d-interleaved-parityfec": { - source: "iana" - }, - "audio/32kadpcm": { - source: "iana" - }, - "audio/3gpp": { - source: "iana", - compressible: false, - extensions: ["3gpp"] - }, - "audio/3gpp2": { - source: "iana" - }, - "audio/aac": { - source: "iana" - }, - "audio/ac3": { - source: "iana" - }, - "audio/adpcm": { - source: "apache", - extensions: ["adp"] - }, - "audio/amr": { - source: "iana", - extensions: ["amr"] - }, - "audio/amr-wb": { - source: "iana" - }, - "audio/amr-wb+": { - source: "iana" - }, - "audio/aptx": { - source: "iana" - }, - "audio/asc": { - source: "iana" - }, - "audio/atrac-advanced-lossless": { - source: "iana" - }, - "audio/atrac-x": { - source: "iana" - }, - "audio/atrac3": { - source: "iana" - }, - "audio/basic": { - source: "iana", - compressible: false, - extensions: ["au", "snd"] - }, - "audio/bv16": { - source: "iana" - }, - "audio/bv32": { - source: "iana" - }, - "audio/clearmode": { - source: "iana" - }, - "audio/cn": { - source: "iana" - }, - "audio/dat12": { - source: "iana" - }, - "audio/dls": { - source: "iana" - }, - "audio/dsr-es201108": { - source: "iana" - }, - "audio/dsr-es202050": { - source: "iana" - }, - "audio/dsr-es202211": { - source: "iana" - }, - "audio/dsr-es202212": { - source: "iana" - }, - "audio/dv": { - source: "iana" - }, - "audio/dvi4": { - source: "iana" - }, - "audio/eac3": { - source: "iana" - }, - "audio/encaprtp": { - source: "iana" - }, - "audio/evrc": { - source: "iana" - }, - "audio/evrc-qcp": { - source: "iana" - }, - "audio/evrc0": { - source: "iana" - }, - "audio/evrc1": { - source: "iana" - }, - "audio/evrcb": { - source: "iana" - }, - "audio/evrcb0": { - source: "iana" - }, - "audio/evrcb1": { - source: "iana" - }, - "audio/evrcnw": { - source: "iana" - }, - "audio/evrcnw0": { - source: "iana" - }, - "audio/evrcnw1": { - source: "iana" - }, - "audio/evrcwb": { - source: "iana" - }, - "audio/evrcwb0": { - source: "iana" - }, - "audio/evrcwb1": { - source: "iana" - }, - "audio/evs": { - source: "iana" - }, - "audio/flexfec": { - source: "iana" - }, - "audio/fwdred": { - source: "iana" - }, - "audio/g711-0": { - source: "iana" - }, - "audio/g719": { - source: "iana" - }, - "audio/g722": { - source: "iana" - }, - "audio/g7221": { - source: "iana" - }, - "audio/g723": { - source: "iana" - }, - "audio/g726-16": { - source: "iana" - }, - "audio/g726-24": { - source: "iana" - }, - "audio/g726-32": { - source: "iana" - }, - "audio/g726-40": { - source: "iana" - }, - "audio/g728": { - source: "iana" - }, - "audio/g729": { - source: "iana" - }, - "audio/g7291": { - source: "iana" - }, - "audio/g729d": { - source: "iana" - }, - "audio/g729e": { - source: "iana" - }, - "audio/gsm": { - source: "iana" - }, - "audio/gsm-efr": { - source: "iana" - }, - "audio/gsm-hr-08": { - source: "iana" - }, - "audio/ilbc": { - source: "iana" - }, - "audio/ip-mr_v2.5": { - source: "iana" - }, - "audio/isac": { - source: "apache" - }, - "audio/l16": { - source: "iana" - }, - "audio/l20": { - source: "iana" - }, - "audio/l24": { - source: "iana", - compressible: false - }, - "audio/l8": { - source: "iana" - }, - "audio/lpc": { - source: "iana" - }, - "audio/melp": { - source: "iana" - }, - "audio/melp1200": { - source: "iana" - }, - "audio/melp2400": { - source: "iana" - }, - "audio/melp600": { - source: "iana" - }, - "audio/mhas": { - source: "iana" - }, - "audio/midi": { - source: "apache", - extensions: ["mid", "midi", "kar", "rmi"] - }, - "audio/mobile-xmf": { - source: "iana", - extensions: ["mxmf"] - }, - "audio/mp3": { - compressible: false, - extensions: ["mp3"] - }, - "audio/mp4": { - source: "iana", - compressible: false, - extensions: ["m4a", "mp4a"] - }, - "audio/mp4a-latm": { - source: "iana" - }, - "audio/mpa": { - source: "iana" - }, - "audio/mpa-robust": { - source: "iana" - }, - "audio/mpeg": { - source: "iana", - compressible: false, - extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] - }, - "audio/mpeg4-generic": { - source: "iana" - }, - "audio/musepack": { - source: "apache" - }, - "audio/ogg": { - source: "iana", - compressible: false, - extensions: ["oga", "ogg", "spx", "opus"] - }, - "audio/opus": { - source: "iana" - }, - "audio/parityfec": { - source: "iana" - }, - "audio/pcma": { - source: "iana" - }, - "audio/pcma-wb": { - source: "iana" - }, - "audio/pcmu": { - source: "iana" - }, - "audio/pcmu-wb": { - source: "iana" - }, - "audio/prs.sid": { - source: "iana" - }, - "audio/qcelp": { - source: "iana" - }, - "audio/raptorfec": { - source: "iana" - }, - "audio/red": { - source: "iana" - }, - "audio/rtp-enc-aescm128": { - source: "iana" - }, - "audio/rtp-midi": { - source: "iana" - }, - "audio/rtploopback": { - source: "iana" - }, - "audio/rtx": { - source: "iana" - }, - "audio/s3m": { - source: "apache", - extensions: ["s3m"] - }, - "audio/scip": { - source: "iana" - }, - "audio/silk": { - source: "apache", - extensions: ["sil"] - }, - "audio/smv": { - source: "iana" - }, - "audio/smv-qcp": { - source: "iana" - }, - "audio/smv0": { - source: "iana" - }, - "audio/sofa": { - source: "iana" - }, - "audio/sp-midi": { - source: "iana" - }, - "audio/speex": { - source: "iana" - }, - "audio/t140c": { - source: "iana" - }, - "audio/t38": { - source: "iana" - }, - "audio/telephone-event": { - source: "iana" - }, - "audio/tetra_acelp": { - source: "iana" - }, - "audio/tetra_acelp_bb": { - source: "iana" - }, - "audio/tone": { - source: "iana" - }, - "audio/tsvcis": { - source: "iana" - }, - "audio/uemclip": { - source: "iana" - }, - "audio/ulpfec": { - source: "iana" - }, - "audio/usac": { - source: "iana" - }, - "audio/vdvi": { - source: "iana" - }, - "audio/vmr-wb": { - source: "iana" - }, - "audio/vnd.3gpp.iufp": { - source: "iana" - }, - "audio/vnd.4sb": { - source: "iana" - }, - "audio/vnd.audiokoz": { - source: "iana" - }, - "audio/vnd.celp": { - source: "iana" - }, - "audio/vnd.cisco.nse": { - source: "iana" - }, - "audio/vnd.cmles.radio-events": { - source: "iana" - }, - "audio/vnd.cns.anp1": { - source: "iana" - }, - "audio/vnd.cns.inf1": { - source: "iana" - }, - "audio/vnd.dece.audio": { - source: "iana", - extensions: ["uva", "uvva"] - }, - "audio/vnd.digital-winds": { - source: "iana", - extensions: ["eol"] - }, - "audio/vnd.dlna.adts": { - source: "iana" - }, - "audio/vnd.dolby.heaac.1": { - source: "iana" - }, - "audio/vnd.dolby.heaac.2": { - source: "iana" - }, - "audio/vnd.dolby.mlp": { - source: "iana" - }, - "audio/vnd.dolby.mps": { - source: "iana" - }, - "audio/vnd.dolby.pl2": { - source: "iana" - }, - "audio/vnd.dolby.pl2x": { - source: "iana" - }, - "audio/vnd.dolby.pl2z": { - source: "iana" - }, - "audio/vnd.dolby.pulse.1": { - source: "iana" - }, - "audio/vnd.dra": { - source: "iana", - extensions: ["dra"] - }, - "audio/vnd.dts": { - source: "iana", - extensions: ["dts"] - }, - "audio/vnd.dts.hd": { - source: "iana", - extensions: ["dtshd"] - }, - "audio/vnd.dts.uhd": { - source: "iana" - }, - "audio/vnd.dvb.file": { - source: "iana" - }, - "audio/vnd.everad.plj": { - source: "iana" - }, - "audio/vnd.hns.audio": { - source: "iana" - }, - "audio/vnd.lucent.voice": { - source: "iana", - extensions: ["lvp"] - }, - "audio/vnd.ms-playready.media.pya": { - source: "iana", - extensions: ["pya"] - }, - "audio/vnd.nokia.mobile-xmf": { - source: "iana" - }, - "audio/vnd.nortel.vbk": { - source: "iana" - }, - "audio/vnd.nuera.ecelp4800": { - source: "iana", - extensions: ["ecelp4800"] - }, - "audio/vnd.nuera.ecelp7470": { - source: "iana", - extensions: ["ecelp7470"] - }, - "audio/vnd.nuera.ecelp9600": { - source: "iana", - extensions: ["ecelp9600"] - }, - "audio/vnd.octel.sbc": { - source: "iana" - }, - "audio/vnd.presonus.multitrack": { - source: "iana" - }, - "audio/vnd.qcelp": { - source: "iana" - }, - "audio/vnd.rhetorex.32kadpcm": { - source: "iana" - }, - "audio/vnd.rip": { - source: "iana", - extensions: ["rip"] - }, - "audio/vnd.rn-realaudio": { - compressible: false - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - source: "iana" - }, - "audio/vnd.vmx.cvsd": { - source: "iana" - }, - "audio/vnd.wave": { - compressible: false - }, - "audio/vorbis": { - source: "iana", - compressible: false - }, - "audio/vorbis-config": { - source: "iana" - }, - "audio/wav": { - compressible: false, - extensions: ["wav"] - }, - "audio/wave": { - compressible: false, - extensions: ["wav"] - }, - "audio/webm": { - source: "apache", - compressible: false, - extensions: ["weba"] - }, - "audio/x-aac": { - source: "apache", - compressible: false, - extensions: ["aac"] - }, - "audio/x-aiff": { - source: "apache", - extensions: ["aif", "aiff", "aifc"] - }, - "audio/x-caf": { - source: "apache", - compressible: false, - extensions: ["caf"] - }, - "audio/x-flac": { - source: "apache", - extensions: ["flac"] - }, - "audio/x-m4a": { - source: "nginx", - extensions: ["m4a"] - }, - "audio/x-matroska": { - source: "apache", - extensions: ["mka"] - }, - "audio/x-mpegurl": { - source: "apache", - extensions: ["m3u"] - }, - "audio/x-ms-wax": { - source: "apache", - extensions: ["wax"] - }, - "audio/x-ms-wma": { - source: "apache", - extensions: ["wma"] - }, - "audio/x-pn-realaudio": { - source: "apache", - extensions: ["ram", "ra"] - }, - "audio/x-pn-realaudio-plugin": { - source: "apache", - extensions: ["rmp"] - }, - "audio/x-realaudio": { - source: "nginx", - extensions: ["ra"] - }, - "audio/x-tta": { - source: "apache" - }, - "audio/x-wav": { - source: "apache", - extensions: ["wav"] - }, - "audio/xm": { - source: "apache", - extensions: ["xm"] - }, - "chemical/x-cdx": { - source: "apache", - extensions: ["cdx"] - }, - "chemical/x-cif": { - source: "apache", - extensions: ["cif"] - }, - "chemical/x-cmdf": { - source: "apache", - extensions: ["cmdf"] - }, - "chemical/x-cml": { - source: "apache", - extensions: ["cml"] - }, - "chemical/x-csml": { - source: "apache", - extensions: ["csml"] - }, - "chemical/x-pdb": { - source: "apache" - }, - "chemical/x-xyz": { - source: "apache", - extensions: ["xyz"] - }, - "font/collection": { - source: "iana", - extensions: ["ttc"] - }, - "font/otf": { - source: "iana", - compressible: true, - extensions: ["otf"] - }, - "font/sfnt": { - source: "iana" - }, - "font/ttf": { - source: "iana", - compressible: true, - extensions: ["ttf"] - }, - "font/woff": { - source: "iana", - extensions: ["woff"] - }, - "font/woff2": { - source: "iana", - extensions: ["woff2"] - }, - "image/aces": { - source: "iana", - extensions: ["exr"] - }, - "image/apng": { - compressible: false, - extensions: ["apng"] - }, - "image/avci": { - source: "iana", - extensions: ["avci"] - }, - "image/avcs": { - source: "iana", - extensions: ["avcs"] - }, - "image/avif": { - source: "iana", - compressible: false, - extensions: ["avif"] - }, - "image/bmp": { - source: "iana", - compressible: true, - extensions: ["bmp"] - }, - "image/cgm": { - source: "iana", - extensions: ["cgm"] - }, - "image/dicom-rle": { - source: "iana", - extensions: ["drle"] - }, - "image/emf": { - source: "iana", - extensions: ["emf"] - }, - "image/fits": { - source: "iana", - extensions: ["fits"] - }, - "image/g3fax": { - source: "iana", - extensions: ["g3"] - }, - "image/gif": { - source: "iana", - compressible: false, - extensions: ["gif"] - }, - "image/heic": { - source: "iana", - extensions: ["heic"] - }, - "image/heic-sequence": { - source: "iana", - extensions: ["heics"] - }, - "image/heif": { - source: "iana", - extensions: ["heif"] - }, - "image/heif-sequence": { - source: "iana", - extensions: ["heifs"] - }, - "image/hej2k": { - source: "iana", - extensions: ["hej2"] - }, - "image/hsj2": { - source: "iana", - extensions: ["hsj2"] - }, - "image/ief": { - source: "iana", - extensions: ["ief"] - }, - "image/jls": { - source: "iana", - extensions: ["jls"] - }, - "image/jp2": { - source: "iana", - compressible: false, - extensions: ["jp2", "jpg2"] - }, - "image/jpeg": { - source: "iana", - compressible: false, - extensions: ["jpeg", "jpg", "jpe"] - }, - "image/jph": { - source: "iana", - extensions: ["jph"] - }, - "image/jphc": { - source: "iana", - extensions: ["jhc"] - }, - "image/jpm": { - source: "iana", - compressible: false, - extensions: ["jpm"] - }, - "image/jpx": { - source: "iana", - compressible: false, - extensions: ["jpx", "jpf"] - }, - "image/jxr": { - source: "iana", - extensions: ["jxr"] - }, - "image/jxra": { - source: "iana", - extensions: ["jxra"] - }, - "image/jxrs": { - source: "iana", - extensions: ["jxrs"] - }, - "image/jxs": { - source: "iana", - extensions: ["jxs"] - }, - "image/jxsc": { - source: "iana", - extensions: ["jxsc"] - }, - "image/jxsi": { - source: "iana", - extensions: ["jxsi"] - }, - "image/jxss": { - source: "iana", - extensions: ["jxss"] - }, - "image/ktx": { - source: "iana", - extensions: ["ktx"] - }, - "image/ktx2": { - source: "iana", - extensions: ["ktx2"] - }, - "image/naplps": { - source: "iana" - }, - "image/pjpeg": { - compressible: false - }, - "image/png": { - source: "iana", - compressible: false, - extensions: ["png"] - }, - "image/prs.btif": { - source: "iana", - extensions: ["btif"] - }, - "image/prs.pti": { - source: "iana", - extensions: ["pti"] - }, - "image/pwg-raster": { - source: "iana" - }, - "image/sgi": { - source: "apache", - extensions: ["sgi"] - }, - "image/svg+xml": { - source: "iana", - compressible: true, - extensions: ["svg", "svgz"] - }, - "image/t38": { - source: "iana", - extensions: ["t38"] - }, - "image/tiff": { - source: "iana", - compressible: false, - extensions: ["tif", "tiff"] - }, - "image/tiff-fx": { - source: "iana", - extensions: ["tfx"] - }, - "image/vnd.adobe.photoshop": { - source: "iana", - compressible: true, - extensions: ["psd"] - }, - "image/vnd.airzip.accelerator.azv": { - source: "iana", - extensions: ["azv"] - }, - "image/vnd.cns.inf2": { - source: "iana" - }, - "image/vnd.dece.graphic": { - source: "iana", - extensions: ["uvi", "uvvi", "uvg", "uvvg"] - }, - "image/vnd.djvu": { - source: "iana", - extensions: ["djvu", "djv"] - }, - "image/vnd.dvb.subtitle": { - source: "iana", - extensions: ["sub"] - }, - "image/vnd.dwg": { - source: "iana", - extensions: ["dwg"] - }, - "image/vnd.dxf": { - source: "iana", - extensions: ["dxf"] - }, - "image/vnd.fastbidsheet": { - source: "iana", - extensions: ["fbs"] - }, - "image/vnd.fpx": { - source: "iana", - extensions: ["fpx"] - }, - "image/vnd.fst": { - source: "iana", - extensions: ["fst"] - }, - "image/vnd.fujixerox.edmics-mmr": { - source: "iana", - extensions: ["mmr"] - }, - "image/vnd.fujixerox.edmics-rlc": { - source: "iana", - extensions: ["rlc"] - }, - "image/vnd.globalgraphics.pgb": { - source: "iana" - }, - "image/vnd.microsoft.icon": { - source: "iana", - compressible: true, - extensions: ["ico"] - }, - "image/vnd.mix": { - source: "iana" - }, - "image/vnd.mozilla.apng": { - source: "iana" - }, - "image/vnd.ms-dds": { - compressible: true, - extensions: ["dds"] - }, - "image/vnd.ms-modi": { - source: "iana", - extensions: ["mdi"] - }, - "image/vnd.ms-photo": { - source: "apache", - extensions: ["wdp"] - }, - "image/vnd.net-fpx": { - source: "iana", - extensions: ["npx"] - }, - "image/vnd.pco.b16": { - source: "iana", - extensions: ["b16"] - }, - "image/vnd.radiance": { - source: "iana" - }, - "image/vnd.sealed.png": { - source: "iana" - }, - "image/vnd.sealedmedia.softseal.gif": { - source: "iana" - }, - "image/vnd.sealedmedia.softseal.jpg": { - source: "iana" - }, - "image/vnd.svf": { - source: "iana" - }, - "image/vnd.tencent.tap": { - source: "iana", - extensions: ["tap"] - }, - "image/vnd.valve.source.texture": { - source: "iana", - extensions: ["vtf"] - }, - "image/vnd.wap.wbmp": { - source: "iana", - extensions: ["wbmp"] - }, - "image/vnd.xiff": { - source: "iana", - extensions: ["xif"] - }, - "image/vnd.zbrush.pcx": { - source: "iana", - extensions: ["pcx"] - }, - "image/webp": { - source: "apache", - extensions: ["webp"] - }, - "image/wmf": { - source: "iana", - extensions: ["wmf"] - }, - "image/x-3ds": { - source: "apache", - extensions: ["3ds"] - }, - "image/x-cmu-raster": { - source: "apache", - extensions: ["ras"] - }, - "image/x-cmx": { - source: "apache", - extensions: ["cmx"] - }, - "image/x-freehand": { - source: "apache", - extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] - }, - "image/x-icon": { - source: "apache", - compressible: true, - extensions: ["ico"] - }, - "image/x-jng": { - source: "nginx", - extensions: ["jng"] - }, - "image/x-mrsid-image": { - source: "apache", - extensions: ["sid"] - }, - "image/x-ms-bmp": { - source: "nginx", - compressible: true, - extensions: ["bmp"] - }, - "image/x-pcx": { - source: "apache", - extensions: ["pcx"] - }, - "image/x-pict": { - source: "apache", - extensions: ["pic", "pct"] - }, - "image/x-portable-anymap": { - source: "apache", - extensions: ["pnm"] - }, - "image/x-portable-bitmap": { - source: "apache", - extensions: ["pbm"] - }, - "image/x-portable-graymap": { - source: "apache", - extensions: ["pgm"] - }, - "image/x-portable-pixmap": { - source: "apache", - extensions: ["ppm"] - }, - "image/x-rgb": { - source: "apache", - extensions: ["rgb"] - }, - "image/x-tga": { - source: "apache", - extensions: ["tga"] - }, - "image/x-xbitmap": { - source: "apache", - extensions: ["xbm"] - }, - "image/x-xcf": { - compressible: false - }, - "image/x-xpixmap": { - source: "apache", - extensions: ["xpm"] - }, - "image/x-xwindowdump": { - source: "apache", - extensions: ["xwd"] - }, - "message/cpim": { - source: "iana" - }, - "message/delivery-status": { - source: "iana" - }, - "message/disposition-notification": { - source: "iana", - extensions: [ - "disposition-notification" - ] - }, - "message/external-body": { - source: "iana" - }, - "message/feedback-report": { - source: "iana" - }, - "message/global": { - source: "iana", - extensions: ["u8msg"] - }, - "message/global-delivery-status": { - source: "iana", - extensions: ["u8dsn"] - }, - "message/global-disposition-notification": { - source: "iana", - extensions: ["u8mdn"] - }, - "message/global-headers": { - source: "iana", - extensions: ["u8hdr"] - }, - "message/http": { - source: "iana", - compressible: false - }, - "message/imdn+xml": { - source: "iana", - compressible: true - }, - "message/news": { - source: "iana" - }, - "message/partial": { - source: "iana", - compressible: false - }, - "message/rfc822": { - source: "iana", - compressible: true, - extensions: ["eml", "mime"] - }, - "message/s-http": { - source: "iana" - }, - "message/sip": { - source: "iana" - }, - "message/sipfrag": { - source: "iana" - }, - "message/tracking-status": { - source: "iana" - }, - "message/vnd.si.simp": { - source: "iana" - }, - "message/vnd.wfa.wsc": { - source: "iana", - extensions: ["wsc"] - }, - "model/3mf": { - source: "iana", - extensions: ["3mf"] - }, - "model/e57": { - source: "iana" - }, - "model/gltf+json": { - source: "iana", - compressible: true, - extensions: ["gltf"] - }, - "model/gltf-binary": { - source: "iana", - compressible: true, - extensions: ["glb"] - }, - "model/iges": { - source: "iana", - compressible: false, - extensions: ["igs", "iges"] - }, - "model/mesh": { - source: "iana", - compressible: false, - extensions: ["msh", "mesh", "silo"] - }, - "model/mtl": { - source: "iana", - extensions: ["mtl"] - }, - "model/obj": { - source: "iana", - extensions: ["obj"] - }, - "model/step": { - source: "iana" - }, - "model/step+xml": { - source: "iana", - compressible: true, - extensions: ["stpx"] - }, - "model/step+zip": { - source: "iana", - compressible: false, - extensions: ["stpz"] - }, - "model/step-xml+zip": { - source: "iana", - compressible: false, - extensions: ["stpxz"] - }, - "model/stl": { - source: "iana", - extensions: ["stl"] - }, - "model/vnd.collada+xml": { - source: "iana", - compressible: true, - extensions: ["dae"] - }, - "model/vnd.dwf": { - source: "iana", - extensions: ["dwf"] - }, - "model/vnd.flatland.3dml": { - source: "iana" - }, - "model/vnd.gdl": { - source: "iana", - extensions: ["gdl"] - }, - "model/vnd.gs-gdl": { - source: "apache" - }, - "model/vnd.gs.gdl": { - source: "iana" - }, - "model/vnd.gtw": { - source: "iana", - extensions: ["gtw"] - }, - "model/vnd.moml+xml": { - source: "iana", - compressible: true - }, - "model/vnd.mts": { - source: "iana", - extensions: ["mts"] - }, - "model/vnd.opengex": { - source: "iana", - extensions: ["ogex"] - }, - "model/vnd.parasolid.transmit.binary": { - source: "iana", - extensions: ["x_b"] - }, - "model/vnd.parasolid.transmit.text": { - source: "iana", - extensions: ["x_t"] - }, - "model/vnd.pytha.pyox": { - source: "iana" - }, - "model/vnd.rosette.annotated-data-model": { - source: "iana" - }, - "model/vnd.sap.vds": { - source: "iana", - extensions: ["vds"] - }, - "model/vnd.usdz+zip": { - source: "iana", - compressible: false, - extensions: ["usdz"] - }, - "model/vnd.valve.source.compiled-map": { - source: "iana", - extensions: ["bsp"] - }, - "model/vnd.vtu": { - source: "iana", - extensions: ["vtu"] - }, - "model/vrml": { - source: "iana", - compressible: false, - extensions: ["wrl", "vrml"] - }, - "model/x3d+binary": { - source: "apache", - compressible: false, - extensions: ["x3db", "x3dbz"] - }, - "model/x3d+fastinfoset": { - source: "iana", - extensions: ["x3db"] - }, - "model/x3d+vrml": { - source: "apache", - compressible: false, - extensions: ["x3dv", "x3dvz"] - }, - "model/x3d+xml": { - source: "iana", - compressible: true, - extensions: ["x3d", "x3dz"] - }, - "model/x3d-vrml": { - source: "iana", - extensions: ["x3dv"] - }, - "multipart/alternative": { - source: "iana", - compressible: false - }, - "multipart/appledouble": { - source: "iana" - }, - "multipart/byteranges": { - source: "iana" - }, - "multipart/digest": { - source: "iana" - }, - "multipart/encrypted": { - source: "iana", - compressible: false - }, - "multipart/form-data": { - source: "iana", - compressible: false - }, - "multipart/header-set": { - source: "iana" - }, - "multipart/mixed": { - source: "iana" - }, - "multipart/multilingual": { - source: "iana" - }, - "multipart/parallel": { - source: "iana" - }, - "multipart/related": { - source: "iana", - compressible: false - }, - "multipart/report": { - source: "iana" - }, - "multipart/signed": { - source: "iana", - compressible: false - }, - "multipart/vnd.bint.med-plus": { - source: "iana" - }, - "multipart/voice-message": { - source: "iana" - }, - "multipart/x-mixed-replace": { - source: "iana" - }, - "text/1d-interleaved-parityfec": { - source: "iana" - }, - "text/cache-manifest": { - source: "iana", - compressible: true, - extensions: ["appcache", "manifest"] - }, - "text/calendar": { - source: "iana", - extensions: ["ics", "ifb"] - }, - "text/calender": { - compressible: true - }, - "text/cmd": { - compressible: true - }, - "text/coffeescript": { - extensions: ["coffee", "litcoffee"] - }, - "text/cql": { - source: "iana" - }, - "text/cql-expression": { - source: "iana" - }, - "text/cql-identifier": { - source: "iana" - }, - "text/css": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["css"] - }, - "text/csv": { - source: "iana", - compressible: true, - extensions: ["csv"] - }, - "text/csv-schema": { - source: "iana" - }, - "text/directory": { - source: "iana" - }, - "text/dns": { - source: "iana" - }, - "text/ecmascript": { - source: "iana" - }, - "text/encaprtp": { - source: "iana" - }, - "text/enriched": { - source: "iana" - }, - "text/fhirpath": { - source: "iana" - }, - "text/flexfec": { - source: "iana" - }, - "text/fwdred": { - source: "iana" - }, - "text/gff3": { - source: "iana" - }, - "text/grammar-ref-list": { - source: "iana" - }, - "text/html": { - source: "iana", - compressible: true, - extensions: ["html", "htm", "shtml"] - }, - "text/jade": { - extensions: ["jade"] - }, - "text/javascript": { - source: "iana", - compressible: true - }, - "text/jcr-cnd": { - source: "iana" - }, - "text/jsx": { - compressible: true, - extensions: ["jsx"] - }, - "text/less": { - compressible: true, - extensions: ["less"] - }, - "text/markdown": { - source: "iana", - compressible: true, - extensions: ["markdown", "md"] - }, - "text/mathml": { - source: "nginx", - extensions: ["mml"] - }, - "text/mdx": { - compressible: true, - extensions: ["mdx"] - }, - "text/mizar": { - source: "iana" - }, - "text/n3": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["n3"] - }, - "text/parameters": { - source: "iana", - charset: "UTF-8" - }, - "text/parityfec": { - source: "iana" - }, - "text/plain": { - source: "iana", - compressible: true, - extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] - }, - "text/provenance-notation": { - source: "iana", - charset: "UTF-8" - }, - "text/prs.fallenstein.rst": { - source: "iana" - }, - "text/prs.lines.tag": { - source: "iana", - extensions: ["dsc"] - }, - "text/prs.prop.logic": { - source: "iana" - }, - "text/raptorfec": { - source: "iana" - }, - "text/red": { - source: "iana" - }, - "text/rfc822-headers": { - source: "iana" - }, - "text/richtext": { - source: "iana", - compressible: true, - extensions: ["rtx"] - }, - "text/rtf": { - source: "iana", - compressible: true, - extensions: ["rtf"] - }, - "text/rtp-enc-aescm128": { - source: "iana" - }, - "text/rtploopback": { - source: "iana" - }, - "text/rtx": { - source: "iana" - }, - "text/sgml": { - source: "iana", - extensions: ["sgml", "sgm"] - }, - "text/shaclc": { - source: "iana" - }, - "text/shex": { - source: "iana", - extensions: ["shex"] - }, - "text/slim": { - extensions: ["slim", "slm"] - }, - "text/spdx": { - source: "iana", - extensions: ["spdx"] - }, - "text/strings": { - source: "iana" - }, - "text/stylus": { - extensions: ["stylus", "styl"] - }, - "text/t140": { - source: "iana" - }, - "text/tab-separated-values": { - source: "iana", - compressible: true, - extensions: ["tsv"] - }, - "text/troff": { - source: "iana", - extensions: ["t", "tr", "roff", "man", "me", "ms"] - }, - "text/turtle": { - source: "iana", - charset: "UTF-8", - extensions: ["ttl"] - }, - "text/ulpfec": { - source: "iana" - }, - "text/uri-list": { - source: "iana", - compressible: true, - extensions: ["uri", "uris", "urls"] - }, - "text/vcard": { - source: "iana", - compressible: true, - extensions: ["vcard"] - }, - "text/vnd.a": { - source: "iana" - }, - "text/vnd.abc": { - source: "iana" - }, - "text/vnd.ascii-art": { - source: "iana" - }, - "text/vnd.curl": { - source: "iana", - extensions: ["curl"] - }, - "text/vnd.curl.dcurl": { - source: "apache", - extensions: ["dcurl"] - }, - "text/vnd.curl.mcurl": { - source: "apache", - extensions: ["mcurl"] - }, - "text/vnd.curl.scurl": { - source: "apache", - extensions: ["scurl"] - }, - "text/vnd.debian.copyright": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.dmclientscript": { - source: "iana" - }, - "text/vnd.dvb.subtitle": { - source: "iana", - extensions: ["sub"] - }, - "text/vnd.esmertec.theme-descriptor": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.familysearch.gedcom": { - source: "iana", - extensions: ["ged"] - }, - "text/vnd.ficlab.flt": { - source: "iana" - }, - "text/vnd.fly": { - source: "iana", - extensions: ["fly"] - }, - "text/vnd.fmi.flexstor": { - source: "iana", - extensions: ["flx"] - }, - "text/vnd.gml": { - source: "iana" - }, - "text/vnd.graphviz": { - source: "iana", - extensions: ["gv"] - }, - "text/vnd.hans": { - source: "iana" - }, - "text/vnd.hgl": { - source: "iana" - }, - "text/vnd.in3d.3dml": { - source: "iana", - extensions: ["3dml"] - }, - "text/vnd.in3d.spot": { - source: "iana", - extensions: ["spot"] - }, - "text/vnd.iptc.newsml": { - source: "iana" - }, - "text/vnd.iptc.nitf": { - source: "iana" - }, - "text/vnd.latex-z": { - source: "iana" - }, - "text/vnd.motorola.reflex": { - source: "iana" - }, - "text/vnd.ms-mediapackage": { - source: "iana" - }, - "text/vnd.net2phone.commcenter.command": { - source: "iana" - }, - "text/vnd.radisys.msml-basic-layout": { - source: "iana" - }, - "text/vnd.senx.warpscript": { - source: "iana" - }, - "text/vnd.si.uricatalogue": { - source: "iana" - }, - "text/vnd.sosi": { - source: "iana" - }, - "text/vnd.sun.j2me.app-descriptor": { - source: "iana", - charset: "UTF-8", - extensions: ["jad"] - }, - "text/vnd.trolltech.linguist": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.wap.si": { - source: "iana" - }, - "text/vnd.wap.sl": { - source: "iana" - }, - "text/vnd.wap.wml": { - source: "iana", - extensions: ["wml"] - }, - "text/vnd.wap.wmlscript": { - source: "iana", - extensions: ["wmls"] - }, - "text/vtt": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["vtt"] - }, - "text/x-asm": { - source: "apache", - extensions: ["s", "asm"] - }, - "text/x-c": { - source: "apache", - extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] - }, - "text/x-component": { - source: "nginx", - extensions: ["htc"] - }, - "text/x-fortran": { - source: "apache", - extensions: ["f", "for", "f77", "f90"] - }, - "text/x-gwt-rpc": { - compressible: true - }, - "text/x-handlebars-template": { - extensions: ["hbs"] - }, - "text/x-java-source": { - source: "apache", - extensions: ["java"] - }, - "text/x-jquery-tmpl": { - compressible: true - }, - "text/x-lua": { - extensions: ["lua"] - }, - "text/x-markdown": { - compressible: true, - extensions: ["mkd"] - }, - "text/x-nfo": { - source: "apache", - extensions: ["nfo"] - }, - "text/x-opml": { - source: "apache", - extensions: ["opml"] - }, - "text/x-org": { - compressible: true, - extensions: ["org"] - }, - "text/x-pascal": { - source: "apache", - extensions: ["p", "pas"] - }, - "text/x-processing": { - compressible: true, - extensions: ["pde"] - }, - "text/x-sass": { - extensions: ["sass"] - }, - "text/x-scss": { - extensions: ["scss"] - }, - "text/x-setext": { - source: "apache", - extensions: ["etx"] - }, - "text/x-sfv": { - source: "apache", - extensions: ["sfv"] - }, - "text/x-suse-ymp": { - compressible: true, - extensions: ["ymp"] - }, - "text/x-uuencode": { - source: "apache", - extensions: ["uu"] - }, - "text/x-vcalendar": { - source: "apache", - extensions: ["vcs"] - }, - "text/x-vcard": { - source: "apache", - extensions: ["vcf"] - }, - "text/xml": { - source: "iana", - compressible: true, - extensions: ["xml"] - }, - "text/xml-external-parsed-entity": { - source: "iana" - }, - "text/yaml": { - compressible: true, - extensions: ["yaml", "yml"] - }, - "video/1d-interleaved-parityfec": { - source: "iana" - }, - "video/3gpp": { - source: "iana", - extensions: ["3gp", "3gpp"] - }, - "video/3gpp-tt": { - source: "iana" - }, - "video/3gpp2": { - source: "iana", - extensions: ["3g2"] - }, - "video/av1": { - source: "iana" - }, - "video/bmpeg": { - source: "iana" - }, - "video/bt656": { - source: "iana" - }, - "video/celb": { - source: "iana" - }, - "video/dv": { - source: "iana" - }, - "video/encaprtp": { - source: "iana" - }, - "video/ffv1": { - source: "iana" - }, - "video/flexfec": { - source: "iana" - }, - "video/h261": { - source: "iana", - extensions: ["h261"] - }, - "video/h263": { - source: "iana", - extensions: ["h263"] - }, - "video/h263-1998": { - source: "iana" - }, - "video/h263-2000": { - source: "iana" - }, - "video/h264": { - source: "iana", - extensions: ["h264"] - }, - "video/h264-rcdo": { - source: "iana" - }, - "video/h264-svc": { - source: "iana" - }, - "video/h265": { - source: "iana" - }, - "video/iso.segment": { - source: "iana", - extensions: ["m4s"] - }, - "video/jpeg": { - source: "iana", - extensions: ["jpgv"] - }, - "video/jpeg2000": { - source: "iana" - }, - "video/jpm": { - source: "apache", - extensions: ["jpm", "jpgm"] - }, - "video/jxsv": { - source: "iana" - }, - "video/mj2": { - source: "iana", - extensions: ["mj2", "mjp2"] - }, - "video/mp1s": { - source: "iana" - }, - "video/mp2p": { - source: "iana" - }, - "video/mp2t": { - source: "iana", - extensions: ["ts"] - }, - "video/mp4": { - source: "iana", - compressible: false, - extensions: ["mp4", "mp4v", "mpg4"] - }, - "video/mp4v-es": { - source: "iana" - }, - "video/mpeg": { - source: "iana", - compressible: false, - extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] - }, - "video/mpeg4-generic": { - source: "iana" - }, - "video/mpv": { - source: "iana" - }, - "video/nv": { - source: "iana" - }, - "video/ogg": { - source: "iana", - compressible: false, - extensions: ["ogv"] - }, - "video/parityfec": { - source: "iana" - }, - "video/pointer": { - source: "iana" - }, - "video/quicktime": { - source: "iana", - compressible: false, - extensions: ["qt", "mov"] - }, - "video/raptorfec": { - source: "iana" - }, - "video/raw": { - source: "iana" - }, - "video/rtp-enc-aescm128": { - source: "iana" - }, - "video/rtploopback": { - source: "iana" - }, - "video/rtx": { - source: "iana" - }, - "video/scip": { - source: "iana" - }, - "video/smpte291": { - source: "iana" - }, - "video/smpte292m": { - source: "iana" - }, - "video/ulpfec": { - source: "iana" - }, - "video/vc1": { - source: "iana" - }, - "video/vc2": { - source: "iana" - }, - "video/vnd.cctv": { - source: "iana" - }, - "video/vnd.dece.hd": { - source: "iana", - extensions: ["uvh", "uvvh"] - }, - "video/vnd.dece.mobile": { - source: "iana", - extensions: ["uvm", "uvvm"] - }, - "video/vnd.dece.mp4": { - source: "iana" - }, - "video/vnd.dece.pd": { - source: "iana", - extensions: ["uvp", "uvvp"] - }, - "video/vnd.dece.sd": { - source: "iana", - extensions: ["uvs", "uvvs"] - }, - "video/vnd.dece.video": { - source: "iana", - extensions: ["uvv", "uvvv"] - }, - "video/vnd.directv.mpeg": { - source: "iana" - }, - "video/vnd.directv.mpeg-tts": { - source: "iana" - }, - "video/vnd.dlna.mpeg-tts": { - source: "iana" - }, - "video/vnd.dvb.file": { - source: "iana", - extensions: ["dvb"] - }, - "video/vnd.fvt": { - source: "iana", - extensions: ["fvt"] - }, - "video/vnd.hns.video": { - source: "iana" - }, - "video/vnd.iptvforum.1dparityfec-1010": { - source: "iana" - }, - "video/vnd.iptvforum.1dparityfec-2005": { - source: "iana" - }, - "video/vnd.iptvforum.2dparityfec-1010": { - source: "iana" - }, - "video/vnd.iptvforum.2dparityfec-2005": { - source: "iana" - }, - "video/vnd.iptvforum.ttsavc": { - source: "iana" - }, - "video/vnd.iptvforum.ttsmpeg2": { - source: "iana" - }, - "video/vnd.motorola.video": { - source: "iana" - }, - "video/vnd.motorola.videop": { - source: "iana" - }, - "video/vnd.mpegurl": { - source: "iana", - extensions: ["mxu", "m4u"] - }, - "video/vnd.ms-playready.media.pyv": { - source: "iana", - extensions: ["pyv"] - }, - "video/vnd.nokia.interleaved-multimedia": { - source: "iana" - }, - "video/vnd.nokia.mp4vr": { - source: "iana" - }, - "video/vnd.nokia.videovoip": { - source: "iana" - }, - "video/vnd.objectvideo": { - source: "iana" - }, - "video/vnd.radgamettools.bink": { - source: "iana" - }, - "video/vnd.radgamettools.smacker": { - source: "iana" - }, - "video/vnd.sealed.mpeg1": { - source: "iana" - }, - "video/vnd.sealed.mpeg4": { - source: "iana" - }, - "video/vnd.sealed.swf": { - source: "iana" - }, - "video/vnd.sealedmedia.softseal.mov": { - source: "iana" - }, - "video/vnd.uvvu.mp4": { - source: "iana", - extensions: ["uvu", "uvvu"] - }, - "video/vnd.vivo": { - source: "iana", - extensions: ["viv"] - }, - "video/vnd.youtube.yt": { - source: "iana" - }, - "video/vp8": { - source: "iana" - }, - "video/vp9": { - source: "iana" - }, - "video/webm": { - source: "apache", - compressible: false, - extensions: ["webm"] - }, - "video/x-f4v": { - source: "apache", - extensions: ["f4v"] - }, - "video/x-fli": { - source: "apache", - extensions: ["fli"] - }, - "video/x-flv": { - source: "apache", - compressible: false, - extensions: ["flv"] - }, - "video/x-m4v": { - source: "apache", - extensions: ["m4v"] - }, - "video/x-matroska": { - source: "apache", - compressible: false, - extensions: ["mkv", "mk3d", "mks"] - }, - "video/x-mng": { - source: "apache", - extensions: ["mng"] - }, - "video/x-ms-asf": { - source: "apache", - extensions: ["asf", "asx"] - }, - "video/x-ms-vob": { - source: "apache", - extensions: ["vob"] - }, - "video/x-ms-wm": { - source: "apache", - extensions: ["wm"] - }, - "video/x-ms-wmv": { - source: "apache", - compressible: false, - extensions: ["wmv"] - }, - "video/x-ms-wmx": { - source: "apache", - extensions: ["wmx"] - }, - "video/x-ms-wvx": { - source: "apache", - extensions: ["wvx"] - }, - "video/x-msvideo": { - source: "apache", - extensions: ["avi"] - }, - "video/x-sgi-movie": { - source: "apache", - extensions: ["movie"] - }, - "video/x-smv": { - source: "apache", - extensions: ["smv"] - }, - "x-conference/x-cooltalk": { - source: "apache", - extensions: ["ice"] - }, - "x-shader/x-fragment": { - compressible: true - }, - "x-shader/x-vertex": { - compressible: true - } - }; - } -}); - -// node_modules/mime-db/index.js -var require_mime_db = __commonJS({ - "node_modules/mime-db/index.js"(exports2, module2) { - module2.exports = require_db(); - } -}); - -// node_modules/mime-types/index.js -var require_mime_types = __commonJS({ - "node_modules/mime-types/index.js"(exports2) { - "use strict"; - var db = require_mime_db(); - var extname = require("path").extname; - var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/; - var TEXT_TYPE_REGEXP = /^text\//i; - exports2.charset = charset; - exports2.charsets = { lookup: charset }; - exports2.contentType = contentType; - exports2.extension = extension; - exports2.extensions = /* @__PURE__ */ Object.create(null); - exports2.lookup = lookup; - exports2.types = /* @__PURE__ */ Object.create(null); - populateMaps(exports2.extensions, exports2.types); - function charset(type) { - if (!type || typeof type !== "string") { - return false; - } - var match = EXTRACT_TYPE_REGEXP.exec(type); - var mime = match && db[match[1].toLowerCase()]; - if (mime && mime.charset) { - return mime.charset; - } - if (match && TEXT_TYPE_REGEXP.test(match[1])) { - return "UTF-8"; - } - return false; - } - function contentType(str) { - if (!str || typeof str !== "string") { - return false; - } - var mime = str.indexOf("/") === -1 ? exports2.lookup(str) : str; - if (!mime) { - return false; - } - if (mime.indexOf("charset") === -1) { - var charset2 = exports2.charset(mime); - if (charset2) mime += "; charset=" + charset2.toLowerCase(); - } - return mime; - } - function extension(type) { - if (!type || typeof type !== "string") { - return false; - } - var match = EXTRACT_TYPE_REGEXP.exec(type); - var exts = match && exports2.extensions[match[1].toLowerCase()]; - if (!exts || !exts.length) { - return false; - } - return exts[0]; - } - function lookup(path) { - if (!path || typeof path !== "string") { - return false; - } - var extension2 = extname("x." + path).toLowerCase().substr(1); - if (!extension2) { - return false; - } - return exports2.types[extension2] || false; - } - function populateMaps(extensions, types) { - var preference = ["nginx", "apache", void 0, "iana"]; - Object.keys(db).forEach(function forEachMimeType(type) { - var mime = db[type]; - var exts = mime.extensions; - if (!exts || !exts.length) { - return; - } - extensions[type] = exts; - for (var i = 0; i < exts.length; i++) { - var extension2 = exts[i]; - if (types[extension2]) { - var from = preference.indexOf(db[types[extension2]].source); - var to = preference.indexOf(mime.source); - if (types[extension2] !== "application/octet-stream" && (from > to || from === to && types[extension2].substr(0, 12) === "application/")) { - continue; - } - } - types[extension2] = type; - } - }); - } - } -}); - -// node_modules/asynckit/lib/defer.js -var require_defer = __commonJS({ - "node_modules/asynckit/lib/defer.js"(exports2, module2) { - module2.exports = defer; - function defer(fn) { - var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null; - if (nextTick) { - nextTick(fn); - } else { - setTimeout(fn, 0); - } - } - } -}); - -// node_modules/asynckit/lib/async.js -var require_async = __commonJS({ - "node_modules/asynckit/lib/async.js"(exports2, module2) { - var defer = require_defer(); - module2.exports = async; - function async(callback) { - var isAsync = false; - defer(function() { - isAsync = true; - }); - return function async_callback(err, result) { - if (isAsync) { - callback(err, result); - } else { - defer(function nextTick_callback() { - callback(err, result); - }); - } - }; - } - } -}); - -// node_modules/asynckit/lib/abort.js -var require_abort = __commonJS({ - "node_modules/asynckit/lib/abort.js"(exports2, module2) { - module2.exports = abort; - function abort(state) { - Object.keys(state.jobs).forEach(clean.bind(state)); - state.jobs = {}; - } - function clean(key) { - if (typeof this.jobs[key] == "function") { - this.jobs[key](); - } - } - } -}); - -// node_modules/asynckit/lib/iterate.js -var require_iterate = __commonJS({ - "node_modules/asynckit/lib/iterate.js"(exports2, module2) { - var async = require_async(); - var abort = require_abort(); - module2.exports = iterate; - function iterate(list, iterator, state, callback) { - var key = state["keyedList"] ? state["keyedList"][state.index] : state.index; - state.jobs[key] = runJob(iterator, key, list[key], function(error, output) { - if (!(key in state.jobs)) { - return; - } - delete state.jobs[key]; - if (error) { - abort(state); - } else { - state.results[key] = output; - } - callback(error, state.results); - }); - } - function runJob(iterator, key, item, callback) { - var aborter; - if (iterator.length == 2) { - aborter = iterator(item, async(callback)); - } else { - aborter = iterator(item, key, async(callback)); - } - return aborter; - } - } -}); - -// node_modules/asynckit/lib/state.js -var require_state = __commonJS({ - "node_modules/asynckit/lib/state.js"(exports2, module2) { - module2.exports = state; - function state(list, sortMethod) { - var isNamedList = !Array.isArray(list), initState = { - index: 0, - keyedList: isNamedList || sortMethod ? Object.keys(list) : null, - jobs: {}, - results: isNamedList ? {} : [], - size: isNamedList ? Object.keys(list).length : list.length - }; - if (sortMethod) { - initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) { - return sortMethod(list[a], list[b]); - }); - } - return initState; - } - } -}); - -// node_modules/asynckit/lib/terminator.js -var require_terminator = __commonJS({ - "node_modules/asynckit/lib/terminator.js"(exports2, module2) { - var abort = require_abort(); - var async = require_async(); - module2.exports = terminator; - function terminator(callback) { - if (!Object.keys(this.jobs).length) { - return; - } - this.index = this.size; - abort(this); - async(callback)(null, this.results); - } - } -}); - -// node_modules/asynckit/parallel.js -var require_parallel = __commonJS({ - "node_modules/asynckit/parallel.js"(exports2, module2) { - var iterate = require_iterate(); - var initState = require_state(); - var terminator = require_terminator(); - module2.exports = parallel; - function parallel(list, iterator, callback) { - var state = initState(list); - while (state.index < (state["keyedList"] || list).length) { - iterate(list, iterator, state, function(error, result) { - if (error) { - callback(error, result); - return; - } - if (Object.keys(state.jobs).length === 0) { - callback(null, state.results); - return; - } - }); - state.index++; - } - return terminator.bind(state, callback); - } - } -}); - -// node_modules/asynckit/serialOrdered.js -var require_serialOrdered = __commonJS({ - "node_modules/asynckit/serialOrdered.js"(exports2, module2) { - var iterate = require_iterate(); - var initState = require_state(); - var terminator = require_terminator(); - module2.exports = serialOrdered; - module2.exports.ascending = ascending; - module2.exports.descending = descending; - function serialOrdered(list, iterator, sortMethod, callback) { - var state = initState(list, sortMethod); - iterate(list, iterator, state, function iteratorHandler(error, result) { - if (error) { - callback(error, result); - return; - } - state.index++; - if (state.index < (state["keyedList"] || list).length) { - iterate(list, iterator, state, iteratorHandler); - return; - } - callback(null, state.results); - }); - return terminator.bind(state, callback); - } - function ascending(a, b) { - return a < b ? -1 : a > b ? 1 : 0; - } - function descending(a, b) { - return -1 * ascending(a, b); - } - } -}); - -// node_modules/asynckit/serial.js -var require_serial = __commonJS({ - "node_modules/asynckit/serial.js"(exports2, module2) { - var serialOrdered = require_serialOrdered(); - module2.exports = serial; - function serial(list, iterator, callback) { - return serialOrdered(list, iterator, null, callback); - } - } -}); - -// node_modules/asynckit/index.js -var require_asynckit = __commonJS({ - "node_modules/asynckit/index.js"(exports2, module2) { - module2.exports = { - parallel: require_parallel(), - serial: require_serial(), - serialOrdered: require_serialOrdered() - }; - } -}); - -// node_modules/form-data/lib/populate.js -var require_populate = __commonJS({ - "node_modules/form-data/lib/populate.js"(exports2, module2) { - module2.exports = function(dst, src) { - Object.keys(src).forEach(function(prop) { - dst[prop] = dst[prop] || src[prop]; - }); - return dst; - }; - } -}); - -// node_modules/form-data/lib/form_data.js -var require_form_data = __commonJS({ - "node_modules/form-data/lib/form_data.js"(exports2, module2) { - var CombinedStream = require_combined_stream(); - var util3 = require("util"); - var path = require("path"); - var http2 = require("http"); - var https2 = require("https"); - var parseUrl = require("url").parse; - var fs = require("fs"); - var Stream = require("stream").Stream; - var mime = require_mime_types(); - var asynckit = require_asynckit(); - var populate = require_populate(); - module2.exports = FormData3; - util3.inherits(FormData3, CombinedStream); - function FormData3(options) { - if (!(this instanceof FormData3)) { - return new FormData3(options); - } - this._overheadLength = 0; - this._valueLength = 0; - this._valuesToMeasure = []; - CombinedStream.call(this); - options = options || {}; - for (var option in options) { - this[option] = options[option]; - } - } - FormData3.LINE_BREAK = "\r\n"; - FormData3.DEFAULT_CONTENT_TYPE = "application/octet-stream"; - FormData3.prototype.append = function(field, value, options) { - options = options || {}; - if (typeof options == "string") { - options = { filename: options }; - } - var append2 = CombinedStream.prototype.append.bind(this); - if (typeof value == "number") { - value = "" + value; - } - if (util3.isArray(value)) { - this._error(new Error("Arrays are not supported.")); - return; - } - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(); - append2(header); - append2(value); - append2(footer); - this._trackLength(header, value, options); - }; - FormData3.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - if (options.knownLength != null) { - valueLength += +options.knownLength; - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === "string") { - valueLength = Buffer.byteLength(value); - } - this._valueLength += valueLength; - this._overheadLength += Buffer.byteLength(header) + FormData3.LINE_BREAK.length; - if (!value || !value.path && !(value.readable && value.hasOwnProperty("httpVersion")) && !(value instanceof Stream)) { - return; - } - if (!options.knownLength) { - this._valuesToMeasure.push(value); - } - }; - FormData3.prototype._lengthRetriever = function(value, callback) { - if (value.hasOwnProperty("fd")) { - if (value.end != void 0 && value.end != Infinity && value.start != void 0) { - callback(null, value.end + 1 - (value.start ? value.start : 0)); - } else { - fs.stat(value.path, function(err, stat) { - var fileSize; - if (err) { - callback(err); - return; - } - fileSize = stat.size - (value.start ? value.start : 0); - callback(null, fileSize); - }); - } - } else if (value.hasOwnProperty("httpVersion")) { - callback(null, +value.headers["content-length"]); - } else if (value.hasOwnProperty("httpModule")) { - value.on("response", function(response) { - value.pause(); - callback(null, +response.headers["content-length"]); - }); - value.resume(); - } else { - callback("Unknown stream"); - } - }; - FormData3.prototype._multiPartHeader = function(field, value, options) { - if (typeof options.header == "string") { - return options.header; - } - var contentDisposition = this._getContentDisposition(value, options); - var contentType = this._getContentType(value, options); - var contents = ""; - var headers = { - // add custom disposition as third element or keep it two elements if not - "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []), - // if no content type. allow it to be empty array - "Content-Type": [].concat(contentType || []) - }; - if (typeof options.header == "object") { - populate(headers, options.header); - } - var header; - for (var prop in headers) { - if (!headers.hasOwnProperty(prop)) continue; - header = headers[prop]; - if (header == null) { - continue; - } - if (!Array.isArray(header)) { - header = [header]; - } - if (header.length) { - contents += prop + ": " + header.join("; ") + FormData3.LINE_BREAK; - } - } - return "--" + this.getBoundary() + FormData3.LINE_BREAK + contents + FormData3.LINE_BREAK; - }; - FormData3.prototype._getContentDisposition = function(value, options) { - var filename, contentDisposition; - if (typeof options.filepath === "string") { - filename = path.normalize(options.filepath).replace(/\\/g, "/"); - } else if (options.filename || value.name || value.path) { - filename = path.basename(options.filename || value.name || value.path); - } else if (value.readable && value.hasOwnProperty("httpVersion")) { - filename = path.basename(value.client._httpMessage.path || ""); - } - if (filename) { - contentDisposition = 'filename="' + filename + '"'; - } - return contentDisposition; - }; - FormData3.prototype._getContentType = function(value, options) { - var contentType = options.contentType; - if (!contentType && value.name) { - contentType = mime.lookup(value.name); - } - if (!contentType && value.path) { - contentType = mime.lookup(value.path); - } - if (!contentType && value.readable && value.hasOwnProperty("httpVersion")) { - contentType = value.headers["content-type"]; - } - if (!contentType && (options.filepath || options.filename)) { - contentType = mime.lookup(options.filepath || options.filename); - } - if (!contentType && typeof value == "object") { - contentType = FormData3.DEFAULT_CONTENT_TYPE; - } - return contentType; - }; - FormData3.prototype._multiPartFooter = function() { - return function(next) { - var footer = FormData3.LINE_BREAK; - var lastPart = this._streams.length === 0; - if (lastPart) { - footer += this._lastBoundary(); - } - next(footer); - }.bind(this); - }; - FormData3.prototype._lastBoundary = function() { - return "--" + this.getBoundary() + "--" + FormData3.LINE_BREAK; - }; - FormData3.prototype.getHeaders = function(userHeaders) { - var header; - var formHeaders = { - "content-type": "multipart/form-data; boundary=" + this.getBoundary() - }; - for (header in userHeaders) { - if (userHeaders.hasOwnProperty(header)) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - } - return formHeaders; - }; - FormData3.prototype.setBoundary = function(boundary) { - this._boundary = boundary; - }; - FormData3.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } - return this._boundary; - }; - FormData3.prototype.getBuffer = function() { - var dataBuffer = new Buffer.alloc(0); - var boundary = this.getBoundary(); - for (var i = 0, len = this._streams.length; i < len; i++) { - if (typeof this._streams[i] !== "function") { - if (Buffer.isBuffer(this._streams[i])) { - dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]); - } else { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]); - } - if (typeof this._streams[i] !== "string" || this._streams[i].substring(2, boundary.length + 2) !== boundary) { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData3.LINE_BREAK)]); - } - } - } - return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]); - }; - FormData3.prototype._generateBoundary = function() { - var boundary = "--------------------------"; - for (var i = 0; i < 24; i++) { - boundary += Math.floor(Math.random() * 10).toString(16); - } - this._boundary = boundary; - }; - FormData3.prototype.getLengthSync = function() { - var knownLength = this._overheadLength + this._valueLength; - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - if (!this.hasKnownLength()) { - this._error(new Error("Cannot calculate proper length in synchronous way.")); - } - return knownLength; - }; - FormData3.prototype.hasKnownLength = function() { - var hasKnownLength = true; - if (this._valuesToMeasure.length) { - hasKnownLength = false; - } - return hasKnownLength; - }; - FormData3.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - if (!this._valuesToMeasure.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } - asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { - if (err) { - cb(err); - return; - } - values.forEach(function(length) { - knownLength += length; - }); - cb(null, knownLength); - }); - }; - FormData3.prototype.submit = function(params, cb) { - var request, options, defaults2 = { method: "post" }; - if (typeof params == "string") { - params = parseUrl(params); - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname, - protocol: params.protocol - }, defaults2); - } else { - options = populate(params, defaults2); - if (!options.port) { - options.port = options.protocol == "https:" ? 443 : 80; - } - } - options.headers = this.getHeaders(params.headers); - if (options.protocol == "https:") { - request = https2.request(options); - } else { - request = http2.request(options); - } - this.getLength(function(err, length) { - if (err && err !== "Unknown stream") { - this._error(err); - return; - } - if (length) { - request.setHeader("Content-Length", length); - } - this.pipe(request); - if (cb) { - var onResponse; - var callback = function(error, responce) { - request.removeListener("error", callback); - request.removeListener("response", onResponse); - return cb.call(this, error, responce); - }; - onResponse = callback.bind(this, null); - request.on("error", callback); - request.on("response", onResponse); - } - }.bind(this)); - return request; - }; - FormData3.prototype._error = function(err) { - if (!this.error) { - this.error = err; - this.pause(); - this.emit("error", err); - } - }; - FormData3.prototype.toString = function() { - return "[object FormData]"; - }; - } -}); - -// node_modules/proxy-from-env/index.js -var require_proxy_from_env = __commonJS({ - "node_modules/proxy-from-env/index.js"(exports2) { - "use strict"; - var parseUrl = require("url").parse; - var DEFAULT_PORTS = { - ftp: 21, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 - }; - var stringEndsWith = String.prototype.endsWith || function(s) { - return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1; - }; - function getProxyForUrl(url2) { - var parsedUrl = typeof url2 === "string" ? parseUrl(url2) : url2 || {}; - var proto = parsedUrl.protocol; - var hostname = parsedUrl.host; - var port = parsedUrl.port; - if (typeof hostname !== "string" || !hostname || typeof proto !== "string") { - return ""; - } - proto = proto.split(":", 1)[0]; - hostname = hostname.replace(/:\d*$/, ""); - port = parseInt(port) || DEFAULT_PORTS[proto] || 0; - if (!shouldProxy(hostname, port)) { - return ""; - } - var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy"); - if (proxy && proxy.indexOf("://") === -1) { - proxy = proto + "://" + proxy; - } - return proxy; - } - function shouldProxy(hostname, port) { - var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase(); - if (!NO_PROXY) { - return true; - } - if (NO_PROXY === "*") { - return false; - } - return NO_PROXY.split(/[,\s]/).every(function(proxy) { - if (!proxy) { - return true; - } - var parsedProxy = proxy.match(/^(.+):(\d+)$/); - var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; - var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; - if (parsedProxyPort && parsedProxyPort !== port) { - return true; - } - if (!/^[.*]/.test(parsedProxyHostname)) { - return hostname !== parsedProxyHostname; - } - if (parsedProxyHostname.charAt(0) === "*") { - parsedProxyHostname = parsedProxyHostname.slice(1); - } - return !stringEndsWith.call(hostname, parsedProxyHostname); - }); - } - function getEnv(key) { - return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ""; - } - exports2.getProxyForUrl = getProxyForUrl; - } -}); - -// node_modules/ms/index.js -var require_ms = __commonJS({ - "node_modules/ms/index.js"(exports2, module2) { - var s = 1e3; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - module2.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === "string" && val.length > 0) { - return parse(val); - } else if (type === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) - ); - }; - function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || "ms").toLowerCase(); - switch (type) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n * y; - case "weeks": - case "week": - case "w": - return n * w; - case "days": - case "day": - case "d": - return n * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n * h; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n; - default: - return void 0; - } - } - function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + "d"; - } - if (msAbs >= h) { - return Math.round(ms / h) + "h"; - } - if (msAbs >= m) { - return Math.round(ms / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms / s) + "s"; - } - return ms + "ms"; - } - function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, "day"); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, "hour"); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, "second"); - } - return ms + " ms"; - } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); - } - } -}); - -// node_modules/debug/src/common.js -var require_common = __commonJS({ - "node_modules/debug/src/common.js"(exports2, module2) { - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require_ms(); - createDebug.destroy = destroy; - Object.keys(env).forEach((key) => { - createDebug[key] = env[key]; - }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; - } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug(...args) { - if (!debug.enabled) { - return; - } - const self2 = debug; - const curr = Number(/* @__PURE__ */ new Date()); - const ms = curr - (prevTime || curr); - self2.diff = ms; - self2.prev = prevTime; - self2.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - if (typeof args[0] !== "string") { - args.unshift("%O"); - } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val = args[index]; - match = formatter.call(self2, val); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend2; - debug.destroy = createDebug.destroy; - Object.defineProperty(debug, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - return enabledCache; - }, - set: (v) => { - enableOverride = v; - } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug); - } - return debug; - } - function extend2(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - createDebug.names = []; - createDebug.skips = []; - let i; - const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); - const len = split.length; - for (i = 0; i < len; i++) { - if (!split[i]) { - continue; - } - namespaces = split[i].replace(/\*/g, ".*?"); - if (namespaces[0] === "-") { - createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")); - } else { - createDebug.names.push(new RegExp("^" + namespaces + "$")); - } - } - } - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace) - ].join(","); - createDebug.enable(""); - return namespaces; - } - function enabled(name) { - if (name[name.length - 1] === "*") { - return true; - } - let i; - let len; - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - return false; - } - function toNamespace(regexp) { - return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*"); - } - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - function destroy() { - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - createDebug.enable(createDebug.load()); - return createDebug; - } - module2.exports = setup; - } -}); - -// node_modules/debug/src/browser.js -var require_browser = __commonJS({ - "node_modules/debug/src/browser.js"(exports2, module2) { - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load; - exports2.useColors = useColors; - exports2.storage = localstorage(); - exports2.destroy = /* @__PURE__ */ (() => { - let warned = false; - return () => { - if (!warned) { - warned = true; - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - }; - })(); - exports2.colors = [ - "#0000CC", - "#0000FF", - "#0033CC", - "#0033FF", - "#0066CC", - "#0066FF", - "#0099CC", - "#0099FF", - "#00CC00", - "#00CC33", - "#00CC66", - "#00CC99", - "#00CCCC", - "#00CCFF", - "#3300CC", - "#3300FF", - "#3333CC", - "#3333FF", - "#3366CC", - "#3366FF", - "#3399CC", - "#3399FF", - "#33CC00", - "#33CC33", - "#33CC66", - "#33CC99", - "#33CCCC", - "#33CCFF", - "#6600CC", - "#6600FF", - "#6633CC", - "#6633FF", - "#66CC00", - "#66CC33", - "#9900CC", - "#9900FF", - "#9933CC", - "#9933FF", - "#99CC00", - "#99CC33", - "#CC0000", - "#CC0033", - "#CC0066", - "#CC0099", - "#CC00CC", - "#CC00FF", - "#CC3300", - "#CC3333", - "#CC3366", - "#CC3399", - "#CC33CC", - "#CC33FF", - "#CC6600", - "#CC6633", - "#CC9900", - "#CC9933", - "#CCCC00", - "#CCCC33", - "#FF0000", - "#FF0033", - "#FF0066", - "#FF0099", - "#FF00CC", - "#FF00FF", - "#FF3300", - "#FF3333", - "#FF3366", - "#FF3399", - "#FF33CC", - "#FF33FF", - "#FF6600", - "#FF6633", - "#FF9900", - "#FF9933", - "#FFCC00", - "#FFCC33" - ]; - function useColors() { - if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { - return true; - } - if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - let m; - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 - typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker - typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - function formatArgs(args) { - args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); - if (!this.useColors) { - return; - } - const c = "color: " + this.color; - args.splice(1, 0, c, "color: inherit"); - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); - } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error) { - } - } - function load() { - let r; - try { - r = exports2.storage.getItem("debug"); - } catch (error) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; - } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error) { - } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error) { - return "[UnexpectedJSONParseError]: " + error.message; - } - }; - } -}); - -// node_modules/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/has-flag/index.js"(exports2, module2) { - "use strict"; - module2.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); - }; - } -}); - -// node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { - "use strict"; - var os = require("os"); - var tty = require("tty"); - var hasFlag = require_has_flag(); - var { env } = process; - var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - forceColor = 0; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - forceColor = 1; - } - if ("FORCE_COLOR" in env) { - if (env.FORCE_COLOR === "true") { - forceColor = 1; - } else if (env.FORCE_COLOR === "false") { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } - } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (process.platform === "win32") { - const osRelease = os.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": - return version >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; - } - } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - if ("COLORTERM" in env) { - return 1; - } - return min; - } - function getSupportLevel(stream4) { - const level = supportsColor(stream4, stream4 && stream4.isTTY); - return translateLevel(level); - } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) - }; - } -}); - -// node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/debug/src/node.js"(exports2, module2) { - var tty = require("tty"); - var util3 = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load; - exports2.useColors = useColors; - exports2.destroy = util3.deprecate( - () => { - }, - "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." - ); - exports2.colors = [6, 2, 3, 4, 5, 1]; - try { - const supportsColor = require_supports_color(); - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports2.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } - } catch (error) { - } - exports2.inspectOpts = Object.keys(process.env).filter((key) => { - return /^debug_/i.test(key); - }).reduce((obj, key) => { - const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === "null") { - val = null; - } else { - val = Number(val); - } - obj[prop] = val; - return obj; - }, {}); - function useColors() { - return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd); - } - function formatArgs(args) { - const { namespace: name, useColors: useColors2 } = this; - if (useColors2) { - const c = this.color; - const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); - const prefix = ` ${colorCode};1m${name} \x1B[0m`; - args[0] = prefix + args[0].split("\n").join("\n" + prefix); - args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); - } else { - args[0] = getDate() + name + " " + args[0]; - } - } - function getDate() { - if (exports2.inspectOpts.hideDate) { - return ""; - } - return (/* @__PURE__ */ new Date()).toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util3.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } - } - function load() { - return process.env.DEBUG; - } - function init(debug) { - debug.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; - } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util3.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util3.inspect(v, this.inspectOpts); - }; - } -}); - -// node_modules/debug/src/index.js -var require_src = __commonJS({ - "node_modules/debug/src/index.js"(exports2, module2) { - if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { - module2.exports = require_browser(); - } else { - module2.exports = require_node(); - } - } -}); - -// node_modules/follow-redirects/debug.js -var require_debug = __commonJS({ - "node_modules/follow-redirects/debug.js"(exports2, module2) { - var debug; - module2.exports = function() { - if (!debug) { - try { - debug = require_src()("follow-redirects"); - } catch (error) { - } - if (typeof debug !== "function") { - debug = function() { - }; - } - } - debug.apply(null, arguments); - }; - } -}); - -// node_modules/follow-redirects/index.js -var require_follow_redirects = __commonJS({ - "node_modules/follow-redirects/index.js"(exports2, module2) { - var url2 = require("url"); - var URL2 = url2.URL; - var http2 = require("http"); - var https2 = require("https"); - var Writable = require("stream").Writable; - var assert = require("assert"); - var debug = require_debug(); - var useNativeURL = false; - try { - assert(new URL2()); - } catch (error) { - useNativeURL = error.code === "ERR_INVALID_URL"; - } - var preservedUrlFields = [ - "auth", - "host", - "hostname", - "href", - "path", - "pathname", - "port", - "protocol", - "query", - "search", - "hash" - ]; - var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; - var eventHandlers = /* @__PURE__ */ Object.create(null); - events.forEach(function(event) { - eventHandlers[event] = function(arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; - }); - var InvalidUrlError = createErrorType( - "ERR_INVALID_URL", - "Invalid URL", - TypeError - ); - var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "Redirected request failed" - ); - var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded", - RedirectionError - ); - var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" - ); - var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" - ); - var destroy = Writable.prototype.destroy || noop2; - function RedirectableRequest(options, responseCallback) { - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - if (responseCallback) { - this.on("response", responseCallback); - } - var self2 = this; - this._onNativeResponse = function(response) { - try { - self2._processResponse(response); - } catch (cause) { - self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause })); - } - }; - this._performRequest(); - } - RedirectableRequest.prototype = Object.create(Writable.prototype); - RedirectableRequest.prototype.abort = function() { - destroyRequest(this._currentRequest); - this._currentRequest.abort(); - this.emit("abort"); - }; - RedirectableRequest.prototype.destroy = function(error) { - destroyRequest(this._currentRequest, error); - destroy.call(this, error); - return this; - }; - RedirectableRequest.prototype.write = function(data, encoding, callback) { - if (this._ending) { - throw new WriteAfterEndError(); - } - if (!isString2(data) && !isBuffer2(data)) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (isFunction2(encoding)) { - callback = encoding; - encoding = null; - } - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data, encoding }); - this._currentRequest.write(data, encoding, callback); - } else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } - }; - RedirectableRequest.prototype.end = function(data, encoding, callback) { - if (isFunction2(data)) { - callback = data; - data = encoding = null; - } else if (isFunction2(encoding)) { - callback = encoding; - encoding = null; - } - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } else { - var self2 = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function() { - self2._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } - }; - RedirectableRequest.prototype.setHeader = function(name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); - }; - RedirectableRequest.prototype.removeHeader = function(name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); - }; - RedirectableRequest.prototype.setTimeout = function(msecs, callback) { - var self2 = this; - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } - function startTimer(socket) { - if (self2._timeout) { - clearTimeout(self2._timeout); - } - self2._timeout = setTimeout(function() { - self2.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - function clearTimer() { - if (self2._timeout) { - clearTimeout(self2._timeout); - self2._timeout = null; - } - self2.removeListener("abort", clearTimer); - self2.removeListener("error", clearTimer); - self2.removeListener("response", clearTimer); - self2.removeListener("close", clearTimer); - if (callback) { - self2.removeListener("timeout", callback); - } - if (!self2.socket) { - self2._currentRequest.removeListener("socket", startTimer); - } - } - if (callback) { - this.on("timeout", callback); - } - if (this.socket) { - startTimer(this.socket); - } else { - this._currentRequest.once("socket", startTimer); - } - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - this.on("close", clearTimer); - return this; - }; - [ - "flushHeaders", - "getHeader", - "setNoDelay", - "setSocketKeepAlive" - ].forEach(function(method) { - RedirectableRequest.prototype[method] = function(a, b) { - return this._currentRequest[method](a, b); - }; - }); - ["aborted", "connection", "socket"].forEach(function(property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function() { - return this._currentRequest[property]; - } - }); - }); - RedirectableRequest.prototype._sanitizeOptions = function(options) { - if (!options.headers) { - options.headers = {}; - } - if (options.host) { - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } - }; - RedirectableRequest.prototype._performRequest = function() { - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - throw new TypeError("Unsupported protocol " + protocol); - } - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; - } - var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); - } - this._currentUrl = /^\//.test(this._options.path) ? url2.format(this._options) : ( - // When making a request to a proxy, […] - // a client MUST send the target URI in absolute-form […]. - this._options.path - ); - if (this._isRedirect) { - var i = 0; - var self2 = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - if (request === self2._currentRequest) { - if (error) { - self2.emit("error", error); - } else if (i < buffers.length) { - var buffer = buffers[i++]; - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } else if (self2._ended) { - request.end(); - } - } - })(); - } - }; - RedirectableRequest.prototype._processResponse = function(response) { - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode - }); - } - var location = response.headers.location; - if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - this._requestBodyBuffers = []; - return; - } - destroyRequest(this._currentRequest); - response.destroy(); - if (++this._redirectCount > this._options.maxRedirects) { - throw new TooManyRedirectsError(); - } - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - // The Host header was set by nativeProtocol.request - Host: response.req.getHeader("host") - }, this._options.headers); - } - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || // RFC7231§6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource […] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) […] - statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); - var currentUrlParts = parseUrl(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url2.format(Object.assign(currentUrlParts, { host: currentHost })); - var redirectUrl = resolveUrl(location, currentUrl); - debug("redirecting to", redirectUrl.href); - this._isRedirect = true; - spreadUrlObject(redirectUrl, this._options); - if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) { - removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); - } - if (isFunction2(beforeRedirect)) { - var responseDetails = { - headers: response.headers, - statusCode - }; - var requestDetails = { - url: currentUrl, - method, - headers: requestHeaders - }; - beforeRedirect(this._options, responseDetails, requestDetails); - this._sanitizeOptions(this._options); - } - this._performRequest(); - }; - function wrap(protocols) { - var exports3 = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024 - }; - var nativeProtocols = {}; - Object.keys(protocols).forEach(function(scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports3[scheme] = Object.create(nativeProtocol); - function request(input, options, callback) { - if (isURL(input)) { - input = spreadUrlObject(input); - } else if (isString2(input)) { - input = spreadUrlObject(parseUrl(input)); - } else { - callback = options; - options = validateUrl(input); - input = { protocol }; - } - if (isFunction2(options)) { - callback = options; - options = null; - } - options = Object.assign({ - maxRedirects: exports3.maxRedirects, - maxBodyLength: exports3.maxBodyLength - }, input, options); - options.nativeProtocols = nativeProtocols; - if (!isString2(options.host) && !isString2(options.hostname)) { - options.hostname = "::1"; - } - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true } - }); - }); - return exports3; - } - function noop2() { - } - function parseUrl(input) { - var parsed; - if (useNativeURL) { - parsed = new URL2(input); - } else { - parsed = validateUrl(url2.parse(input)); - if (!isString2(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } - } - return parsed; - } - function resolveUrl(relative, base) { - return useNativeURL ? new URL2(relative, base) : parseUrl(url2.resolve(base, relative)); - } - function validateUrl(input) { - if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { - throw new InvalidUrlError({ input: input.href || input }); - } - if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { - throw new InvalidUrlError({ input: input.href || input }); - } - return input; - } - function spreadUrlObject(urlObject, target) { - var spread3 = target || {}; - for (var key of preservedUrlFields) { - spread3[key] = urlObject[key]; - } - if (spread3.hostname.startsWith("[")) { - spread3.hostname = spread3.hostname.slice(1, -1); - } - if (spread3.port !== "") { - spread3.port = Number(spread3.port); - } - spread3.path = spread3.search ? spread3.pathname + spread3.search : spread3.pathname; - return spread3; - } - function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim(); - } - function createErrorType(code, message, baseClass) { - function CustomError(properties) { - Error.captureStackTrace(this, this.constructor); - Object.assign(this, properties || {}); - this.code = code; - this.message = this.cause ? message + ": " + this.cause.message : message; - } - CustomError.prototype = new (baseClass || Error)(); - Object.defineProperties(CustomError.prototype, { - constructor: { - value: CustomError, - enumerable: false - }, - name: { - value: "Error [" + code + "]", - enumerable: false - } - }); - return CustomError; - } - function destroyRequest(request, error) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop2); - request.destroy(error); - } - function isSubdomain(subdomain, domain) { - assert(isString2(subdomain) && isString2(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); - } - function isString2(value) { - return typeof value === "string" || value instanceof String; - } - function isFunction2(value) { - return typeof value === "function"; - } - function isBuffer2(value) { - return typeof value === "object" && "length" in value; - } - function isURL(value) { - return URL2 && value instanceof URL2; - } - module2.exports = wrap({ http: http2, https: https2 }); - module2.exports.wrap = wrap; - } -}); - -// node_modules/es-object-atoms/index.js -var require_es_object_atoms = __commonJS({ - "node_modules/es-object-atoms/index.js"(exports2, module2) { - "use strict"; - module2.exports = Object; - } -}); - -// node_modules/es-errors/index.js -var require_es_errors = __commonJS({ - "node_modules/es-errors/index.js"(exports2, module2) { - "use strict"; - module2.exports = Error; - } -}); - -// node_modules/es-errors/eval.js -var require_eval = __commonJS({ - "node_modules/es-errors/eval.js"(exports2, module2) { - "use strict"; - module2.exports = EvalError; - } -}); - -// node_modules/es-errors/range.js -var require_range = __commonJS({ - "node_modules/es-errors/range.js"(exports2, module2) { - "use strict"; - module2.exports = RangeError; - } -}); - -// node_modules/es-errors/ref.js -var require_ref = __commonJS({ - "node_modules/es-errors/ref.js"(exports2, module2) { - "use strict"; - module2.exports = ReferenceError; - } -}); - -// node_modules/es-errors/syntax.js -var require_syntax = __commonJS({ - "node_modules/es-errors/syntax.js"(exports2, module2) { - "use strict"; - module2.exports = SyntaxError; - } -}); - -// node_modules/es-errors/type.js -var require_type = __commonJS({ - "node_modules/es-errors/type.js"(exports2, module2) { - "use strict"; - module2.exports = TypeError; - } -}); - -// node_modules/es-errors/uri.js -var require_uri = __commonJS({ - "node_modules/es-errors/uri.js"(exports2, module2) { - "use strict"; - module2.exports = URIError; - } -}); - -// node_modules/math-intrinsics/abs.js -var require_abs = __commonJS({ - "node_modules/math-intrinsics/abs.js"(exports2, module2) { - "use strict"; - module2.exports = Math.abs; - } -}); - -// node_modules/math-intrinsics/floor.js -var require_floor = __commonJS({ - "node_modules/math-intrinsics/floor.js"(exports2, module2) { - "use strict"; - module2.exports = Math.floor; - } -}); - -// node_modules/math-intrinsics/max.js -var require_max = __commonJS({ - "node_modules/math-intrinsics/max.js"(exports2, module2) { - "use strict"; - module2.exports = Math.max; - } -}); - -// node_modules/math-intrinsics/min.js -var require_min = __commonJS({ - "node_modules/math-intrinsics/min.js"(exports2, module2) { - "use strict"; - module2.exports = Math.min; - } -}); - -// node_modules/math-intrinsics/pow.js -var require_pow = __commonJS({ - "node_modules/math-intrinsics/pow.js"(exports2, module2) { - "use strict"; - module2.exports = Math.pow; - } -}); - -// node_modules/math-intrinsics/round.js -var require_round = __commonJS({ - "node_modules/math-intrinsics/round.js"(exports2, module2) { - "use strict"; - module2.exports = Math.round; - } -}); - -// node_modules/math-intrinsics/isNaN.js -var require_isNaN = __commonJS({ - "node_modules/math-intrinsics/isNaN.js"(exports2, module2) { - "use strict"; - module2.exports = Number.isNaN || function isNaN2(a) { - return a !== a; - }; - } -}); - -// node_modules/math-intrinsics/sign.js -var require_sign = __commonJS({ - "node_modules/math-intrinsics/sign.js"(exports2, module2) { - "use strict"; - var $isNaN = require_isNaN(); - module2.exports = function sign(number) { - if ($isNaN(number) || number === 0) { - return number; - } - return number < 0 ? -1 : 1; - }; - } -}); - -// node_modules/gopd/gOPD.js -var require_gOPD = __commonJS({ - "node_modules/gopd/gOPD.js"(exports2, module2) { - "use strict"; - module2.exports = Object.getOwnPropertyDescriptor; - } -}); - -// node_modules/gopd/index.js -var require_gopd = __commonJS({ - "node_modules/gopd/index.js"(exports2, module2) { - "use strict"; - var $gOPD = require_gOPD(); - if ($gOPD) { - try { - $gOPD([], "length"); - } catch (e) { - $gOPD = null; - } - } - module2.exports = $gOPD; - } -}); - -// node_modules/es-define-property/index.js -var require_es_define_property = __commonJS({ - "node_modules/es-define-property/index.js"(exports2, module2) { - "use strict"; - var $defineProperty = Object.defineProperty || false; - if ($defineProperty) { - try { - $defineProperty({}, "a", { value: 1 }); - } catch (e) { - $defineProperty = false; - } - } - module2.exports = $defineProperty; - } -}); - -// node_modules/has-symbols/shams.js -var require_shams = __commonJS({ - "node_modules/has-symbols/shams.js"(exports2, module2) { - "use strict"; - module2.exports = function hasSymbols() { - if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { - return false; - } - if (typeof Symbol.iterator === "symbol") { - return true; - } - var obj = {}; - var sym = Symbol("test"); - var symObj = Object(sym); - if (typeof sym === "string") { - return false; - } - if (Object.prototype.toString.call(sym) !== "[object Symbol]") { - return false; - } - if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { - return false; - } - var symVal = 42; - obj[sym] = symVal; - for (var _ in obj) { - return false; - } - if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { - return false; - } - if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { - return false; - } - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { - return false; - } - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { - return false; - } - if (typeof Object.getOwnPropertyDescriptor === "function") { - var descriptor = ( - /** @type {PropertyDescriptor} */ - Object.getOwnPropertyDescriptor(obj, sym) - ); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { - return false; - } - } - return true; - }; - } -}); - -// node_modules/has-symbols/index.js -var require_has_symbols = __commonJS({ - "node_modules/has-symbols/index.js"(exports2, module2) { - "use strict"; - var origSymbol = typeof Symbol !== "undefined" && Symbol; - var hasSymbolSham = require_shams(); - module2.exports = function hasNativeSymbols() { - if (typeof origSymbol !== "function") { - return false; - } - if (typeof Symbol !== "function") { - return false; - } - if (typeof origSymbol("foo") !== "symbol") { - return false; - } - if (typeof Symbol("bar") !== "symbol") { - return false; - } - return hasSymbolSham(); - }; - } -}); - -// node_modules/get-proto/Reflect.getPrototypeOf.js -var require_Reflect_getPrototypeOf = __commonJS({ - "node_modules/get-proto/Reflect.getPrototypeOf.js"(exports2, module2) { - "use strict"; - module2.exports = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null; - } -}); - -// node_modules/get-proto/Object.getPrototypeOf.js -var require_Object_getPrototypeOf = __commonJS({ - "node_modules/get-proto/Object.getPrototypeOf.js"(exports2, module2) { - "use strict"; - var $Object = require_es_object_atoms(); - module2.exports = $Object.getPrototypeOf || null; - } -}); - -// node_modules/function-bind/implementation.js -var require_implementation = __commonJS({ - "node_modules/function-bind/implementation.js"(exports2, module2) { - "use strict"; - var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; - var toStr = Object.prototype.toString; - var max = Math.max; - var funcType = "[object Function]"; - var concatty = function concatty2(a, b) { - var arr = []; - for (var i = 0; i < a.length; i += 1) { - arr[i] = a[i]; - } - for (var j = 0; j < b.length; j += 1) { - arr[j + a.length] = b[j]; - } - return arr; - }; - var slicy = function slicy2(arrLike, offset) { - var arr = []; - for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { - arr[j] = arrLike[i]; - } - return arr; - }; - var joiny = function(arr, joiner) { - var str = ""; - for (var i = 0; i < arr.length; i += 1) { - str += arr[i]; - if (i + 1 < arr.length) { - str += joiner; - } - } - return str; - }; - module2.exports = function bind2(that) { - var target = this; - if (typeof target !== "function" || toStr.apply(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slicy(arguments, 1); - var bound; - var binder = function() { - if (this instanceof bound) { - var result = target.apply( - this, - concatty(args, arguments) - ); - if (Object(result) === result) { - return result; - } - return this; - } - return target.apply( - that, - concatty(args, arguments) - ); - }; - var boundLength = max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs[i] = "$" + i; - } - bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); - if (target.prototype) { - var Empty = function Empty2() { - }; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - return bound; - }; - } -}); - -// node_modules/function-bind/index.js -var require_function_bind = __commonJS({ - "node_modules/function-bind/index.js"(exports2, module2) { - "use strict"; - var implementation = require_implementation(); - module2.exports = Function.prototype.bind || implementation; - } -}); - -// node_modules/call-bind-apply-helpers/functionCall.js -var require_functionCall = __commonJS({ - "node_modules/call-bind-apply-helpers/functionCall.js"(exports2, module2) { - "use strict"; - module2.exports = Function.prototype.call; - } -}); - -// node_modules/call-bind-apply-helpers/functionApply.js -var require_functionApply = __commonJS({ - "node_modules/call-bind-apply-helpers/functionApply.js"(exports2, module2) { - "use strict"; - module2.exports = Function.prototype.apply; - } -}); - -// node_modules/call-bind-apply-helpers/reflectApply.js -var require_reflectApply = __commonJS({ - "node_modules/call-bind-apply-helpers/reflectApply.js"(exports2, module2) { - "use strict"; - module2.exports = typeof Reflect !== "undefined" && Reflect && Reflect.apply; - } -}); - -// node_modules/call-bind-apply-helpers/actualApply.js -var require_actualApply = __commonJS({ - "node_modules/call-bind-apply-helpers/actualApply.js"(exports2, module2) { - "use strict"; - var bind2 = require_function_bind(); - var $apply = require_functionApply(); - var $call = require_functionCall(); - var $reflectApply = require_reflectApply(); - module2.exports = $reflectApply || bind2.call($call, $apply); - } -}); - -// node_modules/call-bind-apply-helpers/index.js -var require_call_bind_apply_helpers = __commonJS({ - "node_modules/call-bind-apply-helpers/index.js"(exports2, module2) { - "use strict"; - var bind2 = require_function_bind(); - var $TypeError = require_type(); - var $call = require_functionCall(); - var $actualApply = require_actualApply(); - module2.exports = function callBindBasic(args) { - if (args.length < 1 || typeof args[0] !== "function") { - throw new $TypeError("a function is required"); - } - return $actualApply(bind2, $call, args); - }; - } -}); - -// node_modules/dunder-proto/get.js -var require_get = __commonJS({ - "node_modules/dunder-proto/get.js"(exports2, module2) { - "use strict"; - var callBind = require_call_bind_apply_helpers(); - var gOPD = require_gopd(); - var hasProtoAccessor; - try { - hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ - [].__proto__ === Array.prototype; - } catch (e) { - if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") { - throw e; - } - } - var desc = !!hasProtoAccessor && gOPD && gOPD( - Object.prototype, - /** @type {keyof typeof Object.prototype} */ - "__proto__" - ); - var $Object = Object; - var $getPrototypeOf = $Object.getPrototypeOf; - module2.exports = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? ( - /** @type {import('./get')} */ - function getDunder(value) { - return $getPrototypeOf(value == null ? value : $Object(value)); - } - ) : false; - } -}); - -// node_modules/get-proto/index.js -var require_get_proto = __commonJS({ - "node_modules/get-proto/index.js"(exports2, module2) { - "use strict"; - var reflectGetProto = require_Reflect_getPrototypeOf(); - var originalGetProto = require_Object_getPrototypeOf(); - var getDunderProto = require_get(); - module2.exports = reflectGetProto ? function getProto(O) { - return reflectGetProto(O); - } : originalGetProto ? function getProto(O) { - if (!O || typeof O !== "object" && typeof O !== "function") { - throw new TypeError("getProto: not an object"); - } - return originalGetProto(O); - } : getDunderProto ? function getProto(O) { - return getDunderProto(O); - } : null; - } -}); - -// node_modules/hasown/index.js -var require_hasown = __commonJS({ - "node_modules/hasown/index.js"(exports2, module2) { - "use strict"; - var call = Function.prototype.call; - var $hasOwn = Object.prototype.hasOwnProperty; - var bind2 = require_function_bind(); - module2.exports = bind2.call(call, $hasOwn); - } -}); - -// node_modules/get-intrinsic/index.js -var require_get_intrinsic = __commonJS({ - "node_modules/get-intrinsic/index.js"(exports2, module2) { - "use strict"; - var undefined2; - var $Object = require_es_object_atoms(); - var $Error = require_es_errors(); - var $EvalError = require_eval(); - var $RangeError = require_range(); - var $ReferenceError = require_ref(); - var $SyntaxError = require_syntax(); - var $TypeError = require_type(); - var $URIError = require_uri(); - var abs = require_abs(); - var floor = require_floor(); - var max = require_max(); - var min = require_min(); - var pow = require_pow(); - var round = require_round(); - var sign = require_sign(); - var $Function = Function; - var getEvalledConstructor = function(expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); - } catch (e) { - } - }; - var $gOPD = require_gopd(); - var $defineProperty = require_es_define_property(); - var throwTypeError = function() { - throw new $TypeError(); - }; - var ThrowTypeError = $gOPD ? function() { - try { - arguments.callee; - return throwTypeError; - } catch (calleeThrows) { - try { - return $gOPD(arguments, "callee").get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - }() : throwTypeError; - var hasSymbols = require_has_symbols()(); - var getProto = require_get_proto(); - var $ObjectGPO = require_Object_getPrototypeOf(); - var $ReflectGPO = require_Reflect_getPrototypeOf(); - var $apply = require_functionApply(); - var $call = require_functionCall(); - var needsEval = {}; - var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array); - var INTRINSICS = { - __proto__: null, - "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, - "%Array%": Array, - "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, - "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2, - "%AsyncFromSyncIteratorPrototype%": undefined2, - "%AsyncFunction%": needsEval, - "%AsyncGenerator%": needsEval, - "%AsyncGeneratorFunction%": needsEval, - "%AsyncIteratorPrototype%": needsEval, - "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, - "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, - "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, - "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, - "%Boolean%": Boolean, - "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, - "%Date%": Date, - "%decodeURI%": decodeURI, - "%decodeURIComponent%": decodeURIComponent, - "%encodeURI%": encodeURI, - "%encodeURIComponent%": encodeURIComponent, - "%Error%": $Error, - "%eval%": eval, - // eslint-disable-line no-eval - "%EvalError%": $EvalError, - "%Float16Array%": typeof Float16Array === "undefined" ? undefined2 : Float16Array, - "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, - "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, - "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, - "%Function%": $Function, - "%GeneratorFunction%": needsEval, - "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, - "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, - "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, - "%isFinite%": isFinite, - "%isNaN%": isNaN, - "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2, - "%JSON%": typeof JSON === "object" ? JSON : undefined2, - "%Map%": typeof Map === "undefined" ? undefined2 : Map, - "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), - "%Math%": Math, - "%Number%": Number, - "%Object%": $Object, - "%Object.getOwnPropertyDescriptor%": $gOPD, - "%parseFloat%": parseFloat, - "%parseInt%": parseInt, - "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, - "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, - "%RangeError%": $RangeError, - "%ReferenceError%": $ReferenceError, - "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, - "%RegExp%": RegExp, - "%Set%": typeof Set === "undefined" ? undefined2 : Set, - "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), - "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, - "%String%": String, - "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2, - "%Symbol%": hasSymbols ? Symbol : undefined2, - "%SyntaxError%": $SyntaxError, - "%ThrowTypeError%": ThrowTypeError, - "%TypedArray%": TypedArray, - "%TypeError%": $TypeError, - "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, - "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, - "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, - "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, - "%URIError%": $URIError, - "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, - "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, - "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet, - "%Function.prototype.call%": $call, - "%Function.prototype.apply%": $apply, - "%Object.defineProperty%": $defineProperty, - "%Object.getPrototypeOf%": $ObjectGPO, - "%Math.abs%": abs, - "%Math.floor%": floor, - "%Math.max%": max, - "%Math.min%": min, - "%Math.pow%": pow, - "%Math.round%": round, - "%Math.sign%": sign, - "%Reflect.getPrototypeOf%": $ReflectGPO - }; - if (getProto) { - try { - null.error; - } catch (e) { - errorProto = getProto(getProto(e)); - INTRINSICS["%Error.prototype%"] = errorProto; - } - } - var errorProto; - var doEval = function doEval2(name) { - var value; - if (name === "%AsyncFunction%") { - value = getEvalledConstructor("async function () {}"); - } else if (name === "%GeneratorFunction%") { - value = getEvalledConstructor("function* () {}"); - } else if (name === "%AsyncGeneratorFunction%") { - value = getEvalledConstructor("async function* () {}"); - } else if (name === "%AsyncGenerator%") { - var fn = doEval2("%AsyncGeneratorFunction%"); - if (fn) { - value = fn.prototype; - } - } else if (name === "%AsyncIteratorPrototype%") { - var gen = doEval2("%AsyncGenerator%"); - if (gen && getProto) { - value = getProto(gen.prototype); - } - } - INTRINSICS[name] = value; - return value; - }; - var LEGACY_ALIASES = { - __proto__: null, - "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], - "%ArrayPrototype%": ["Array", "prototype"], - "%ArrayProto_entries%": ["Array", "prototype", "entries"], - "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], - "%ArrayProto_keys%": ["Array", "prototype", "keys"], - "%ArrayProto_values%": ["Array", "prototype", "values"], - "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], - "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], - "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], - "%BooleanPrototype%": ["Boolean", "prototype"], - "%DataViewPrototype%": ["DataView", "prototype"], - "%DatePrototype%": ["Date", "prototype"], - "%ErrorPrototype%": ["Error", "prototype"], - "%EvalErrorPrototype%": ["EvalError", "prototype"], - "%Float32ArrayPrototype%": ["Float32Array", "prototype"], - "%Float64ArrayPrototype%": ["Float64Array", "prototype"], - "%FunctionPrototype%": ["Function", "prototype"], - "%Generator%": ["GeneratorFunction", "prototype"], - "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], - "%Int8ArrayPrototype%": ["Int8Array", "prototype"], - "%Int16ArrayPrototype%": ["Int16Array", "prototype"], - "%Int32ArrayPrototype%": ["Int32Array", "prototype"], - "%JSONParse%": ["JSON", "parse"], - "%JSONStringify%": ["JSON", "stringify"], - "%MapPrototype%": ["Map", "prototype"], - "%NumberPrototype%": ["Number", "prototype"], - "%ObjectPrototype%": ["Object", "prototype"], - "%ObjProto_toString%": ["Object", "prototype", "toString"], - "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], - "%PromisePrototype%": ["Promise", "prototype"], - "%PromiseProto_then%": ["Promise", "prototype", "then"], - "%Promise_all%": ["Promise", "all"], - "%Promise_reject%": ["Promise", "reject"], - "%Promise_resolve%": ["Promise", "resolve"], - "%RangeErrorPrototype%": ["RangeError", "prototype"], - "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], - "%RegExpPrototype%": ["RegExp", "prototype"], - "%SetPrototype%": ["Set", "prototype"], - "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], - "%StringPrototype%": ["String", "prototype"], - "%SymbolPrototype%": ["Symbol", "prototype"], - "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], - "%TypedArrayPrototype%": ["TypedArray", "prototype"], - "%TypeErrorPrototype%": ["TypeError", "prototype"], - "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], - "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], - "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], - "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], - "%URIErrorPrototype%": ["URIError", "prototype"], - "%WeakMapPrototype%": ["WeakMap", "prototype"], - "%WeakSetPrototype%": ["WeakSet", "prototype"] - }; - var bind2 = require_function_bind(); - var hasOwn = require_hasown(); - var $concat = bind2.call($call, Array.prototype.concat); - var $spliceApply = bind2.call($apply, Array.prototype.splice); - var $replace = bind2.call($call, String.prototype.replace); - var $strSlice = bind2.call($call, String.prototype.slice); - var $exec = bind2.call($call, RegExp.prototype.exec); - var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; - var reEscapeChar = /\\(\\)?/g; - var stringToPath = function stringToPath2(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === "%" && last !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); - } else if (last === "%" && first !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); - } - var result = []; - $replace(string, rePropName, function(match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; - }); - return result; - }; - var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = "%" + alias[0] + "%"; - } - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === "undefined" && !allowMissing) { - throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); - } - return { - alias, - name: intrinsicName, - value - }; - } - throw new $SyntaxError("intrinsic " + name + " does not exist!"); - }; - module2.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== "string" || name.length === 0) { - throw new $TypeError("intrinsic name must be a non-empty string"); - } - if (arguments.length > 1 && typeof allowMissing !== "boolean") { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - if ($exec(/^%?[^%]*%?$/, name) === null) { - throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); - } - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; - var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) { - throw new $SyntaxError("property names with quotes must have matching quotes"); - } - if (part === "constructor" || !isOwn) { - skipFurtherCaching = true; - } - intrinsicBaseName += "." + part; - intrinsicRealName = "%" + intrinsicBaseName + "%"; - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); - } - return void undefined2; - } - if ($gOPD && i + 1 >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - if (isOwn && "get" in desc && !("originalValue" in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; - }; - } -}); - -// node_modules/define-data-property/index.js -var require_define_data_property = __commonJS({ - "node_modules/define-data-property/index.js"(exports2, module2) { - "use strict"; - var $defineProperty = require_es_define_property(); - var $SyntaxError = require_syntax(); - var $TypeError = require_type(); - var gopd = require_gopd(); - module2.exports = function defineDataProperty(obj, property, value) { - if (!obj || typeof obj !== "object" && typeof obj !== "function") { - throw new $TypeError("`obj` must be an object or a function`"); - } - if (typeof property !== "string" && typeof property !== "symbol") { - throw new $TypeError("`property` must be a string or a symbol`"); - } - if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) { - throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null"); - } - if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) { - throw new $TypeError("`nonWritable`, if provided, must be a boolean or null"); - } - if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) { - throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null"); - } - if (arguments.length > 6 && typeof arguments[6] !== "boolean") { - throw new $TypeError("`loose`, if provided, must be a boolean"); - } - var nonEnumerable = arguments.length > 3 ? arguments[3] : null; - var nonWritable = arguments.length > 4 ? arguments[4] : null; - var nonConfigurable = arguments.length > 5 ? arguments[5] : null; - var loose = arguments.length > 6 ? arguments[6] : false; - var desc = !!gopd && gopd(obj, property); - if ($defineProperty) { - $defineProperty(obj, property, { - configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, - enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, - value, - writable: nonWritable === null && desc ? desc.writable : !nonWritable - }); - } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) { - obj[property] = value; - } else { - throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); - } - }; - } -}); - -// node_modules/has-property-descriptors/index.js -var require_has_property_descriptors = __commonJS({ - "node_modules/has-property-descriptors/index.js"(exports2, module2) { - "use strict"; - var $defineProperty = require_es_define_property(); - var hasPropertyDescriptors = function hasPropertyDescriptors2() { - return !!$defineProperty; - }; - hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { - if (!$defineProperty) { - return null; - } - try { - return $defineProperty([], "length", { value: 1 }).length !== 1; - } catch (e) { - return true; - } - }; - module2.exports = hasPropertyDescriptors; - } -}); - -// node_modules/set-function-length/index.js -var require_set_function_length = __commonJS({ - "node_modules/set-function-length/index.js"(exports2, module2) { - "use strict"; - var GetIntrinsic = require_get_intrinsic(); - var define = require_define_data_property(); - var hasDescriptors = require_has_property_descriptors()(); - var gOPD = require_gopd(); - var $TypeError = require_type(); - var $floor = GetIntrinsic("%Math.floor%"); - module2.exports = function setFunctionLength(fn, length) { - if (typeof fn !== "function") { - throw new $TypeError("`fn` is not a function"); - } - if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) { - throw new $TypeError("`length` must be a positive 32-bit integer"); - } - var loose = arguments.length > 2 && !!arguments[2]; - var functionLengthIsConfigurable = true; - var functionLengthIsWritable = true; - if ("length" in fn && gOPD) { - var desc = gOPD(fn, "length"); - if (desc && !desc.configurable) { - functionLengthIsConfigurable = false; - } - if (desc && !desc.writable) { - functionLengthIsWritable = false; - } - } - if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { - if (hasDescriptors) { - define( - /** @type {Parameters[0]} */ - fn, - "length", - length, - true, - true - ); - } else { - define( - /** @type {Parameters[0]} */ - fn, - "length", - length - ); - } - } - return fn; - }; - } -}); - -// node_modules/call-bind/index.js -var require_call_bind = __commonJS({ - "node_modules/call-bind/index.js"(exports2, module2) { - "use strict"; - var bind2 = require_function_bind(); - var GetIntrinsic = require_get_intrinsic(); - var setFunctionLength = require_set_function_length(); - var $TypeError = require_type(); - var $apply = GetIntrinsic("%Function.prototype.apply%"); - var $call = GetIntrinsic("%Function.prototype.call%"); - var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind2.call($call, $apply); - var $defineProperty = require_es_define_property(); - var $max = GetIntrinsic("%Math.max%"); - module2.exports = function callBind(originalFunction) { - if (typeof originalFunction !== "function") { - throw new $TypeError("a function is required"); - } - var func = $reflectApply(bind2, $call, arguments); - return setFunctionLength( - func, - 1 + $max(0, originalFunction.length - (arguments.length - 1)), - true - ); - }; - var applyBind = function applyBind2() { - return $reflectApply(bind2, $apply, arguments); - }; - if ($defineProperty) { - $defineProperty(module2.exports, "apply", { value: applyBind }); - } else { - module2.exports.apply = applyBind; - } - } -}); - -// node_modules/call-bind/callBound.js -var require_callBound = __commonJS({ - "node_modules/call-bind/callBound.js"(exports2, module2) { - "use strict"; - var GetIntrinsic = require_get_intrinsic(); - var callBind = require_call_bind(); - var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf")); - module2.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) { - return callBind(intrinsic); - } - return intrinsic; - }; - } -}); - -// node_modules/object-inspect/util.inspect.js -var require_util_inspect = __commonJS({ - "node_modules/object-inspect/util.inspect.js"(exports2, module2) { - module2.exports = require("util").inspect; - } -}); - -// node_modules/object-inspect/index.js -var require_object_inspect = __commonJS({ - "node_modules/object-inspect/index.js"(exports2, module2) { - var hasMap = typeof Map === "function" && Map.prototype; - var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null; - var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null; - var mapForEach = hasMap && Map.prototype.forEach; - var hasSet = typeof Set === "function" && Set.prototype; - var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null; - var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null; - var setForEach = hasSet && Set.prototype.forEach; - var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype; - var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; - var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype; - var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; - var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype; - var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; - var booleanValueOf = Boolean.prototype.valueOf; - var objectToString = Object.prototype.toString; - var functionToString = Function.prototype.toString; - var $match = String.prototype.match; - var $slice = String.prototype.slice; - var $replace = String.prototype.replace; - var $toUpperCase = String.prototype.toUpperCase; - var $toLowerCase = String.prototype.toLowerCase; - var $test = RegExp.prototype.test; - var $concat = Array.prototype.concat; - var $join = Array.prototype.join; - var $arrSlice = Array.prototype.slice; - var $floor = Math.floor; - var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null; - var gOPS = Object.getOwnPropertySymbols; - var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null; - var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object"; - var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null; - var isEnumerable = Object.prototype.propertyIsEnumerable; - var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) { - return O.__proto__; - } : null); - function addNumericSeparator(num, str) { - if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str)) { - return str; - } - var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; - if (typeof num === "number") { - var int = num < 0 ? -$floor(-num) : $floor(num); - if (int !== num) { - var intStr = String(int); - var dec = $slice.call(str, intStr.length + 1); - return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, ""); - } - } - return $replace.call(str, sepRegex, "$&_"); - } - var utilInspect = require_util_inspect(); - var inspectCustom = utilInspect.custom; - var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; - module2.exports = function inspect_(obj, options, depth, seen) { - var opts = options || {}; - if (has(opts, "quoteStyle") && (opts.quoteStyle !== "single" && opts.quoteStyle !== "double")) { - throw new TypeError('option "quoteStyle" must be "single" or "double"'); - } - if (has(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) { - throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); - } - var customInspect = has(opts, "customInspect") ? opts.customInspect : true; - if (typeof customInspect !== "boolean" && customInspect !== "symbol") { - throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`"); - } - if (has(opts, "indent") && opts.indent !== null && opts.indent !== " " && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) { - throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); - } - if (has(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") { - throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); - } - var numericSeparator = opts.numericSeparator; - if (typeof obj === "undefined") { - return "undefined"; - } - if (obj === null) { - return "null"; - } - if (typeof obj === "boolean") { - return obj ? "true" : "false"; - } - if (typeof obj === "string") { - return inspectString(obj, opts); - } - if (typeof obj === "number") { - if (obj === 0) { - return Infinity / obj > 0 ? "0" : "-0"; - } - var str = String(obj); - return numericSeparator ? addNumericSeparator(obj, str) : str; - } - if (typeof obj === "bigint") { - var bigIntStr = String(obj) + "n"; - return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; - } - var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth; - if (typeof depth === "undefined") { - depth = 0; - } - if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") { - return isArray2(obj) ? "[Array]" : "[Object]"; - } - var indent = getIndent(opts, depth); - if (typeof seen === "undefined") { - seen = []; - } else if (indexOf(seen, obj) >= 0) { - return "[Circular]"; - } - function inspect(value, from, noIndent) { - if (from) { - seen = $arrSlice.call(seen); - seen.push(from); - } - if (noIndent) { - var newOpts = { - depth: opts.depth - }; - if (has(opts, "quoteStyle")) { - newOpts.quoteStyle = opts.quoteStyle; - } - return inspect_(value, newOpts, depth + 1, seen); - } - return inspect_(value, opts, depth + 1, seen); - } - if (typeof obj === "function" && !isRegExp2(obj)) { - var name = nameOf(obj); - var keys = arrObjKeys(obj, inspect); - return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : ""); - } - if (isSymbol(obj)) { - var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj); - return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString; - } - if (isElement(obj)) { - var s = "<" + $toLowerCase.call(String(obj.nodeName)); - var attrs = obj.attributes || []; - for (var i = 0; i < attrs.length; i++) { - s += " " + attrs[i].name + "=" + wrapQuotes(quote(attrs[i].value), "double", opts); - } - s += ">"; - if (obj.childNodes && obj.childNodes.length) { - s += "..."; - } - s += ""; - return s; - } - if (isArray2(obj)) { - if (obj.length === 0) { - return "[]"; - } - var xs = arrObjKeys(obj, inspect); - if (indent && !singleLineValues(xs)) { - return "[" + indentedJoin(xs, indent) + "]"; - } - return "[ " + $join.call(xs, ", ") + " ]"; - } - if (isError(obj)) { - var parts = arrObjKeys(obj, inspect); - if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) { - return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect(obj.cause), parts), ", ") + " }"; - } - if (parts.length === 0) { - return "[" + String(obj) + "]"; - } - return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }"; - } - if (typeof obj === "object" && customInspect) { - if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) { - return utilInspect(obj, { depth: maxDepth - depth }); - } else if (customInspect !== "symbol" && typeof obj.inspect === "function") { - return obj.inspect(); - } - } - if (isMap(obj)) { - var mapParts = []; - if (mapForEach) { - mapForEach.call(obj, function(value, key) { - mapParts.push(inspect(key, obj, true) + " => " + inspect(value, obj)); - }); - } - return collectionOf("Map", mapSize.call(obj), mapParts, indent); - } - if (isSet(obj)) { - var setParts = []; - if (setForEach) { - setForEach.call(obj, function(value) { - setParts.push(inspect(value, obj)); - }); - } - return collectionOf("Set", setSize.call(obj), setParts, indent); - } - if (isWeakMap(obj)) { - return weakCollectionOf("WeakMap"); - } - if (isWeakSet(obj)) { - return weakCollectionOf("WeakSet"); - } - if (isWeakRef(obj)) { - return weakCollectionOf("WeakRef"); - } - if (isNumber2(obj)) { - return markBoxed(inspect(Number(obj))); - } - if (isBigInt(obj)) { - return markBoxed(inspect(bigIntValueOf.call(obj))); - } - if (isBoolean2(obj)) { - return markBoxed(booleanValueOf.call(obj)); - } - if (isString2(obj)) { - return markBoxed(inspect(String(obj))); - } - if (typeof window !== "undefined" && obj === window) { - return "{ [object Window] }"; - } - if (typeof globalThis !== "undefined" && obj === globalThis || typeof global !== "undefined" && obj === global) { - return "{ [object globalThis] }"; - } - if (!isDate2(obj) && !isRegExp2(obj)) { - var ys = arrObjKeys(obj, inspect); - var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; - var protoTag = obj instanceof Object ? "" : "null prototype"; - var stringTag = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : ""; - var constructorTag = isPlainObject2 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : ""; - var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : ""); - if (ys.length === 0) { - return tag + "{}"; - } - if (indent) { - return tag + "{" + indentedJoin(ys, indent) + "}"; - } - return tag + "{ " + $join.call(ys, ", ") + " }"; - } - return String(obj); - }; - function wrapQuotes(s, defaultStyle, opts) { - var quoteChar = (opts.quoteStyle || defaultStyle) === "double" ? '"' : "'"; - return quoteChar + s + quoteChar; - } - function quote(s) { - return $replace.call(String(s), /"/g, """); - } - function isArray2(obj) { - return toStr(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isDate2(obj) { - return toStr(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isRegExp2(obj) { - return toStr(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isError(obj) { - return toStr(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isString2(obj) { - return toStr(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isNumber2(obj) { - return toStr(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isBoolean2(obj) { - return toStr(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isSymbol(obj) { - if (hasShammedSymbols) { - return obj && typeof obj === "object" && obj instanceof Symbol; - } - if (typeof obj === "symbol") { - return true; - } - if (!obj || typeof obj !== "object" || !symToString) { - return false; - } - try { - symToString.call(obj); - return true; - } catch (e) { - } - return false; - } - function isBigInt(obj) { - if (!obj || typeof obj !== "object" || !bigIntValueOf) { - return false; - } - try { - bigIntValueOf.call(obj); - return true; - } catch (e) { - } - return false; - } - var hasOwn = Object.prototype.hasOwnProperty || function(key) { - return key in this; - }; - function has(obj, key) { - return hasOwn.call(obj, key); - } - function toStr(obj) { - return objectToString.call(obj); - } - function nameOf(f) { - if (f.name) { - return f.name; - } - var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); - if (m) { - return m[1]; - } - return null; - } - function indexOf(xs, x) { - if (xs.indexOf) { - return xs.indexOf(x); - } - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) { - return i; - } - } - return -1; - } - function isMap(x) { - if (!mapSize || !x || typeof x !== "object") { - return false; - } - try { - mapSize.call(x); - try { - setSize.call(x); - } catch (s) { - return true; - } - return x instanceof Map; - } catch (e) { - } - return false; - } - function isWeakMap(x) { - if (!weakMapHas || !x || typeof x !== "object") { - return false; - } - try { - weakMapHas.call(x, weakMapHas); - try { - weakSetHas.call(x, weakSetHas); - } catch (s) { - return true; - } - return x instanceof WeakMap; - } catch (e) { - } - return false; - } - function isWeakRef(x) { - if (!weakRefDeref || !x || typeof x !== "object") { - return false; - } - try { - weakRefDeref.call(x); - return true; - } catch (e) { - } - return false; - } - function isSet(x) { - if (!setSize || !x || typeof x !== "object") { - return false; - } - try { - setSize.call(x); - try { - mapSize.call(x); - } catch (m) { - return true; - } - return x instanceof Set; - } catch (e) { - } - return false; - } - function isWeakSet(x) { - if (!weakSetHas || !x || typeof x !== "object") { - return false; - } - try { - weakSetHas.call(x, weakSetHas); - try { - weakMapHas.call(x, weakMapHas); - } catch (s) { - return true; - } - return x instanceof WeakSet; - } catch (e) { - } - return false; - } - function isElement(x) { - if (!x || typeof x !== "object") { - return false; - } - if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) { - return true; - } - return typeof x.nodeName === "string" && typeof x.getAttribute === "function"; - } - function inspectString(str, opts) { - if (str.length > opts.maxStringLength) { - var remaining = str.length - opts.maxStringLength; - var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : ""); - return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; - } - var s = $replace.call($replace.call(str, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, lowbyte); - return wrapQuotes(s, "single", opts); - } - function lowbyte(c) { - var n = c.charCodeAt(0); - var x = { - 8: "b", - 9: "t", - 10: "n", - 12: "f", - 13: "r" - }[n]; - if (x) { - return "\\" + x; - } - return "\\x" + (n < 16 ? "0" : "") + $toUpperCase.call(n.toString(16)); - } - function markBoxed(str) { - return "Object(" + str + ")"; - } - function weakCollectionOf(type) { - return type + " { ? }"; - } - function collectionOf(type, size, entries, indent) { - var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", "); - return type + " (" + size + ") {" + joinedEntries + "}"; - } - function singleLineValues(xs) { - for (var i = 0; i < xs.length; i++) { - if (indexOf(xs[i], "\n") >= 0) { - return false; - } - } - return true; - } - function getIndent(opts, depth) { - var baseIndent; - if (opts.indent === " ") { - baseIndent = " "; - } else if (typeof opts.indent === "number" && opts.indent > 0) { - baseIndent = $join.call(Array(opts.indent + 1), " "); - } else { - return null; - } - return { - base: baseIndent, - prev: $join.call(Array(depth + 1), baseIndent) - }; - } - function indentedJoin(xs, indent) { - if (xs.length === 0) { - return ""; - } - var lineJoiner = "\n" + indent.prev + indent.base; - return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev; - } - function arrObjKeys(obj, inspect) { - var isArr = isArray2(obj); - var xs = []; - if (isArr) { - xs.length = obj.length; - for (var i = 0; i < obj.length; i++) { - xs[i] = has(obj, i) ? inspect(obj[i], obj) : ""; - } - } - var syms = typeof gOPS === "function" ? gOPS(obj) : []; - var symMap; - if (hasShammedSymbols) { - symMap = {}; - for (var k = 0; k < syms.length; k++) { - symMap["$" + syms[k]] = syms[k]; - } - } - for (var key in obj) { - if (!has(obj, key)) { - continue; - } - if (isArr && String(Number(key)) === key && key < obj.length) { - continue; - } - if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) { - continue; - } else if ($test.call(/[^\w$]/, key)) { - xs.push(inspect(key, obj) + ": " + inspect(obj[key], obj)); - } else { - xs.push(key + ": " + inspect(obj[key], obj)); - } - } - if (typeof gOPS === "function") { - for (var j = 0; j < syms.length; j++) { - if (isEnumerable.call(obj, syms[j])) { - xs.push("[" + inspect(syms[j]) + "]: " + inspect(obj[syms[j]], obj)); - } - } - } - return xs; - } - } -}); - -// node_modules/side-channel/index.js -var require_side_channel = __commonJS({ - "node_modules/side-channel/index.js"(exports2, module2) { - "use strict"; - var GetIntrinsic = require_get_intrinsic(); - var callBound = require_callBound(); - var inspect = require_object_inspect(); - var $TypeError = require_type(); - var $WeakMap = GetIntrinsic("%WeakMap%", true); - var $Map = GetIntrinsic("%Map%", true); - var $weakMapGet = callBound("WeakMap.prototype.get", true); - var $weakMapSet = callBound("WeakMap.prototype.set", true); - var $weakMapHas = callBound("WeakMap.prototype.has", true); - var $mapGet = callBound("Map.prototype.get", true); - var $mapSet = callBound("Map.prototype.set", true); - var $mapHas = callBound("Map.prototype.has", true); - var listGetNode = function(list, key) { - var prev = list; - var curr; - for (; (curr = prev.next) !== null; prev = curr) { - if (curr.key === key) { - prev.next = curr.next; - curr.next = /** @type {NonNullable} */ - list.next; - list.next = curr; - return curr; - } - } - }; - var listGet = function(objects, key) { - var node = listGetNode(objects, key); - return node && node.value; - }; - var listSet = function(objects, key, value) { - var node = listGetNode(objects, key); - if (node) { - node.value = value; - } else { - objects.next = /** @type {import('.').ListNode} */ - { - // eslint-disable-line no-param-reassign, no-extra-parens - key, - next: objects.next, - value - }; - } - }; - var listHas = function(objects, key) { - return !!listGetNode(objects, key); - }; - module2.exports = function getSideChannel() { - var $wm; - var $m; - var $o; - var channel = { - assert: function(key) { - if (!channel.has(key)) { - throw new $TypeError("Side channel does not contain " + inspect(key)); - } - }, - get: function(key) { - if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { - if ($wm) { - return $weakMapGet($wm, key); - } - } else if ($Map) { - if ($m) { - return $mapGet($m, key); - } - } else { - if ($o) { - return listGet($o, key); - } - } - }, - has: function(key) { - if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { - if ($wm) { - return $weakMapHas($wm, key); - } - } else if ($Map) { - if ($m) { - return $mapHas($m, key); - } - } else { - if ($o) { - return listHas($o, key); - } - } - return false; - }, - set: function(key, value) { - if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { - if (!$wm) { - $wm = new $WeakMap(); - } - $weakMapSet($wm, key, value); - } else if ($Map) { - if (!$m) { - $m = new $Map(); - } - $mapSet($m, key, value); - } else { - if (!$o) { - $o = { key: {}, next: null }; - } - listSet($o, key, value); - } - } - }; - return channel; - }; - } -}); - -// node_modules/qs/lib/formats.js -var require_formats = __commonJS({ - "node_modules/qs/lib/formats.js"(exports2, module2) { - "use strict"; - var replace = String.prototype.replace; - var percentTwenties = /%20/g; - var Format = { - RFC1738: "RFC1738", - RFC3986: "RFC3986" - }; - module2.exports = { - "default": Format.RFC3986, - formatters: { - RFC1738: function(value) { - return replace.call(value, percentTwenties, "+"); - }, - RFC3986: function(value) { - return String(value); - } - }, - RFC1738: Format.RFC1738, - RFC3986: Format.RFC3986 - }; - } -}); - -// node_modules/qs/lib/utils.js -var require_utils = __commonJS({ - "node_modules/qs/lib/utils.js"(exports2, module2) { - "use strict"; - var formats = require_formats(); - var has = Object.prototype.hasOwnProperty; - var isArray2 = Array.isArray; - var hexTable = function() { - var array = []; - for (var i = 0; i < 256; ++i) { - array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase()); - } - return array; - }(); - var compactQueue = function compactQueue2(queue) { - while (queue.length > 1) { - var item = queue.pop(); - var obj = item.obj[item.prop]; - if (isArray2(obj)) { - var compacted = []; - for (var j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== "undefined") { - compacted.push(obj[j]); - } - } - item.obj[item.prop] = compacted; - } - } - }; - var arrayToObject2 = function arrayToObject3(source, options) { - var obj = options && options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; - for (var i = 0; i < source.length; ++i) { - if (typeof source[i] !== "undefined") { - obj[i] = source[i]; - } - } - return obj; - }; - var merge2 = function merge3(target, source, options) { - if (!source) { - return target; - } - if (typeof source !== "object") { - if (isArray2(target)) { - target.push(source); - } else if (target && typeof target === "object") { - if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; - } - return target; - } - if (!target || typeof target !== "object") { - return [target].concat(source); - } - var mergeTarget = target; - if (isArray2(target) && !isArray2(source)) { - mergeTarget = arrayToObject2(target, options); - } - if (isArray2(target) && isArray2(source)) { - source.forEach(function(item, i) { - if (has.call(target, i)) { - var targetItem = target[i]; - if (targetItem && typeof targetItem === "object" && item && typeof item === "object") { - target[i] = merge3(targetItem, item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - return Object.keys(source).reduce(function(acc, key) { - var value = source[key]; - if (has.call(acc, key)) { - acc[key] = merge3(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); - }; - var assign = function assignSingleSource(target, source) { - return Object.keys(source).reduce(function(acc, key) { - acc[key] = source[key]; - return acc; - }, target); - }; - var decode = function(str, decoder, charset) { - var strWithoutPlus = str.replace(/\+/g, " "); - if (charset === "iso-8859-1") { - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); - } - try { - return decodeURIComponent(strWithoutPlus); - } catch (e) { - return strWithoutPlus; - } - }; - var limit = 1024; - var encode3 = function encode4(str, defaultEncoder, charset, kind, format) { - if (str.length === 0) { - return str; - } - var string = str; - if (typeof str === "symbol") { - string = Symbol.prototype.toString.call(str); - } else if (typeof str !== "string") { - string = String(str); - } - if (charset === "iso-8859-1") { - return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) { - return "%26%23" + parseInt($0.slice(2), 16) + "%3B"; - }); - } - var out = ""; - for (var j = 0; j < string.length; j += limit) { - var segment = string.length >= limit ? string.slice(j, j + limit) : string; - var arr = []; - for (var i = 0; i < segment.length; ++i) { - var c = segment.charCodeAt(i); - if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (c === 40 || c === 41)) { - arr[arr.length] = segment.charAt(i); - continue; - } - if (c < 128) { - arr[arr.length] = hexTable[c]; - continue; - } - if (c < 2048) { - arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | c & 63]; - continue; - } - if (c < 55296 || c >= 57344) { - arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63]; - continue; - } - i += 1; - c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023); - arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63]; - } - out += arr.join(""); - } - return out; - }; - var compact = function compact2(value) { - var queue = [{ obj: { o: value }, prop: "o" }]; - var refs = []; - for (var i = 0; i < queue.length; ++i) { - var item = queue[i]; - var obj = item.obj[item.prop]; - var keys = Object.keys(obj); - for (var j = 0; j < keys.length; ++j) { - var key = keys[j]; - var val = obj[key]; - if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj, prop: key }); - refs.push(val); - } - } - } - compactQueue(queue); - return value; - }; - var isRegExp2 = function isRegExp3(obj) { - return Object.prototype.toString.call(obj) === "[object RegExp]"; - }; - var isBuffer2 = function isBuffer3(obj) { - if (!obj || typeof obj !== "object") { - return false; - } - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); - }; - var combine = function combine2(a, b) { - return [].concat(a, b); - }; - var maybeMap = function maybeMap2(val, fn) { - if (isArray2(val)) { - var mapped = []; - for (var i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i])); - } - return mapped; - } - return fn(val); - }; - module2.exports = { - arrayToObject: arrayToObject2, - assign, - combine, - compact, - decode, - encode: encode3, - isBuffer: isBuffer2, - isRegExp: isRegExp2, - maybeMap, - merge: merge2 - }; - } -}); - -// node_modules/qs/lib/stringify.js -var require_stringify = __commonJS({ - "node_modules/qs/lib/stringify.js"(exports2, module2) { - "use strict"; - var getSideChannel = require_side_channel(); - var utils = require_utils(); - var formats = require_formats(); - var has = Object.prototype.hasOwnProperty; - var arrayPrefixGenerators = { - brackets: function brackets(prefix) { - return prefix + "[]"; - }, - comma: "comma", - indices: function indices(prefix, key) { - return prefix + "[" + key + "]"; - }, - repeat: function repeat(prefix) { - return prefix; - } - }; - var isArray2 = Array.isArray; - var push = Array.prototype.push; - var pushToArray = function(arr, valueOrArray) { - push.apply(arr, isArray2(valueOrArray) ? valueOrArray : [valueOrArray]); - }; - var toISO = Date.prototype.toISOString; - var defaultFormat = formats["default"]; - var defaults2 = { - addQueryPrefix: false, - allowDots: false, - allowEmptyArrays: false, - arrayFormat: "indices", - charset: "utf-8", - charsetSentinel: false, - delimiter: "&", - encode: true, - encodeDotInKeys: false, - encoder: utils.encode, - encodeValuesOnly: false, - format: defaultFormat, - formatter: formats.formatters[defaultFormat], - // deprecated - indices: false, - serializeDate: function serializeDate(date) { - return toISO.call(date); - }, - skipNulls: false, - strictNullHandling: false - }; - var isNonNullishPrimitive = function isNonNullishPrimitive2(v) { - return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint"; - }; - var sentinel = {}; - var stringify = function stringify2(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter2, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { - var obj = object; - var tmpSc = sideChannel; - var step = 0; - var findFlag = false; - while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) { - var pos = tmpSc.get(object); - step += 1; - if (typeof pos !== "undefined") { - if (pos === step) { - throw new RangeError("Cyclic object value"); - } else { - findFlag = true; - } - } - if (typeof tmpSc.get(sentinel) === "undefined") { - step = 0; - } - } - if (typeof filter2 === "function") { - obj = filter2(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate(obj); - } else if (generateArrayPrefix === "comma" && isArray2(obj)) { - obj = utils.maybeMap(obj, function(value2) { - if (value2 instanceof Date) { - return serializeDate(value2); - } - return value2; - }); - } - if (obj === null) { - if (strictNullHandling) { - return encoder && !encodeValuesOnly ? encoder(prefix, defaults2.encoder, charset, "key", format) : prefix; - } - obj = ""; - } - if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { - if (encoder) { - var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults2.encoder, charset, "key", format); - return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults2.encoder, charset, "value", format))]; - } - return [formatter(prefix) + "=" + formatter(String(obj))]; - } - var values = []; - if (typeof obj === "undefined") { - return values; - } - var objKeys; - if (generateArrayPrefix === "comma" && isArray2(obj)) { - if (encodeValuesOnly && encoder) { - obj = utils.maybeMap(obj, encoder); - } - objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }]; - } else if (isArray2(filter2)) { - objKeys = filter2; - } else { - var keys = Object.keys(obj); - objKeys = sort ? keys.sort(sort) : keys; - } - var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, "%2E") : prefix; - var adjustedPrefix = commaRoundTrip && isArray2(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix; - if (allowEmptyArrays && isArray2(obj) && obj.length === 0) { - return adjustedPrefix + "[]"; - } - for (var j = 0; j < objKeys.length; ++j) { - var key = objKeys[j]; - var value = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key]; - if (skipNulls && value === null) { - continue; - } - var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key; - var keyPrefix = isArray2(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]"); - sideChannel.set(object, step); - var valueSideChannel = getSideChannel(); - valueSideChannel.set(sentinel, sideChannel); - pushToArray(values, stringify2( - value, - keyPrefix, - generateArrayPrefix, - commaRoundTrip, - allowEmptyArrays, - strictNullHandling, - skipNulls, - encodeDotInKeys, - generateArrayPrefix === "comma" && encodeValuesOnly && isArray2(obj) ? null : encoder, - filter2, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - valueSideChannel - )); - } - return values; - }; - var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) { - if (!opts) { - return defaults2; - } - if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { - throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); - } - if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") { - throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); - } - if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") { - throw new TypeError("Encoder has to be a function."); - } - var charset = opts.charset || defaults2.charset; - if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { - throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); - } - var format = formats["default"]; - if (typeof opts.format !== "undefined") { - if (!has.call(formats.formatters, opts.format)) { - throw new TypeError("Unknown format option provided."); - } - format = opts.format; - } - var formatter = formats.formatters[format]; - var filter2 = defaults2.filter; - if (typeof opts.filter === "function" || isArray2(opts.filter)) { - filter2 = opts.filter; - } - var arrayFormat; - if (opts.arrayFormat in arrayPrefixGenerators) { - arrayFormat = opts.arrayFormat; - } else if ("indices" in opts) { - arrayFormat = opts.indices ? "indices" : "repeat"; - } else { - arrayFormat = defaults2.arrayFormat; - } - if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") { - throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); - } - var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots; - return { - addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults2.addQueryPrefix, - allowDots, - allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, - arrayFormat, - charset, - charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, - commaRoundTrip: opts.commaRoundTrip, - delimiter: typeof opts.delimiter === "undefined" ? defaults2.delimiter : opts.delimiter, - encode: typeof opts.encode === "boolean" ? opts.encode : defaults2.encode, - encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults2.encodeDotInKeys, - encoder: typeof opts.encoder === "function" ? opts.encoder : defaults2.encoder, - encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults2.encodeValuesOnly, - filter: filter2, - format, - formatter, - serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults2.serializeDate, - skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults2.skipNulls, - sort: typeof opts.sort === "function" ? opts.sort : null, - strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling - }; - }; - module2.exports = function(object, opts) { - var obj = object; - var options = normalizeStringifyOptions(opts); - var objKeys; - var filter2; - if (typeof options.filter === "function") { - filter2 = options.filter; - obj = filter2("", obj); - } else if (isArray2(options.filter)) { - filter2 = options.filter; - objKeys = filter2; - } - var keys = []; - if (typeof obj !== "object" || obj === null) { - return ""; - } - var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; - var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip; - if (!objKeys) { - objKeys = Object.keys(obj); - } - if (options.sort) { - objKeys.sort(options.sort); - } - var sideChannel = getSideChannel(); - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - if (options.skipNulls && obj[key] === null) { - continue; - } - pushToArray(keys, stringify( - obj[key], - key, - generateArrayPrefix, - commaRoundTrip, - options.allowEmptyArrays, - options.strictNullHandling, - options.skipNulls, - options.encodeDotInKeys, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel - )); - } - var joined = keys.join(options.delimiter); - var prefix = options.addQueryPrefix === true ? "?" : ""; - if (options.charsetSentinel) { - if (options.charset === "iso-8859-1") { - prefix += "utf8=%26%2310003%3B&"; - } else { - prefix += "utf8=%E2%9C%93&"; - } - } - return joined.length > 0 ? prefix + joined : ""; - }; - } -}); - -// node_modules/qs/lib/parse.js -var require_parse = __commonJS({ - "node_modules/qs/lib/parse.js"(exports2, module2) { - "use strict"; - var utils = require_utils(); - var has = Object.prototype.hasOwnProperty; - var isArray2 = Array.isArray; - var defaults2 = { - allowDots: false, - allowEmptyArrays: false, - allowPrototypes: false, - allowSparse: false, - arrayLimit: 20, - charset: "utf-8", - charsetSentinel: false, - comma: false, - decodeDotInKeys: false, - decoder: utils.decode, - delimiter: "&", - depth: 5, - duplicates: "combine", - ignoreQueryPrefix: false, - interpretNumericEntities: false, - parameterLimit: 1e3, - parseArrays: true, - plainObjects: false, - strictDepth: false, - strictNullHandling: false - }; - var interpretNumericEntities = function(str) { - return str.replace(/&#(\d+);/g, function($0, numberStr) { - return String.fromCharCode(parseInt(numberStr, 10)); - }); - }; - var parseArrayValue = function(val, options) { - if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) { - return val.split(","); - } - return val; - }; - var isoSentinel = "utf8=%26%2310003%3B"; - var charsetSentinel = "utf8=%E2%9C%93"; - var parseValues = function parseQueryStringValues(str, options) { - var obj = { __proto__: null }; - var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str; - cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]"); - var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit; - var parts = cleanStr.split(options.delimiter, limit); - var skipIndex = -1; - var i; - var charset = options.charset; - if (options.charsetSentinel) { - for (i = 0; i < parts.length; ++i) { - if (parts[i].indexOf("utf8=") === 0) { - if (parts[i] === charsetSentinel) { - charset = "utf-8"; - } else if (parts[i] === isoSentinel) { - charset = "iso-8859-1"; - } - skipIndex = i; - i = parts.length; - } - } - } - for (i = 0; i < parts.length; ++i) { - if (i === skipIndex) { - continue; - } - var part = parts[i]; - var bracketEqualsPos = part.indexOf("]="); - var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1; - var key, val; - if (pos === -1) { - key = options.decoder(part, defaults2.decoder, charset, "key"); - val = options.strictNullHandling ? null : ""; - } else { - key = options.decoder(part.slice(0, pos), defaults2.decoder, charset, "key"); - val = utils.maybeMap( - parseArrayValue(part.slice(pos + 1), options), - function(encodedVal) { - return options.decoder(encodedVal, defaults2.decoder, charset, "value"); - } - ); - } - if (val && options.interpretNumericEntities && charset === "iso-8859-1") { - val = interpretNumericEntities(val); - } - if (part.indexOf("[]=") > -1) { - val = isArray2(val) ? [val] : val; - } - var existing = has.call(obj, key); - if (existing && options.duplicates === "combine") { - obj[key] = utils.combine(obj[key], val); - } else if (!existing || options.duplicates === "last") { - obj[key] = val; - } - } - return obj; - }; - var parseObject = function(chain, val, options, valuesParsed) { - var leaf = valuesParsed ? val : parseArrayValue(val, options); - for (var i = chain.length - 1; i >= 0; --i) { - var obj; - var root = chain[i]; - if (root === "[]" && options.parseArrays) { - obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf); - } else { - obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; - var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root; - var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot; - var index = parseInt(decodedRoot, 10); - if (!options.parseArrays && decodedRoot === "") { - obj = { 0: leaf }; - } else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) { - obj = []; - obj[index] = leaf; - } else if (decodedRoot !== "__proto__") { - obj[decodedRoot] = leaf; - } - } - leaf = obj; - } - return leaf; - }; - var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { - if (!givenKey) { - return; - } - var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey; - var brackets = /(\[[^[\]]*])/; - var child = /(\[[^[\]]*])/g; - var segment = options.depth > 0 && brackets.exec(key); - var parent = segment ? key.slice(0, segment.index) : key; - var keys = []; - if (parent) { - if (!options.plainObjects && has.call(Object.prototype, parent)) { - if (!options.allowPrototypes) { - return; - } - } - keys.push(parent); - } - var i = 0; - while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { - i += 1; - if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { - if (!options.allowPrototypes) { - return; - } - } - keys.push(segment[1]); - } - if (segment) { - if (options.strictDepth === true) { - throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true"); - } - keys.push("[" + key.slice(segment.index) + "]"); - } - return parseObject(keys, val, options, valuesParsed); - }; - var normalizeParseOptions = function normalizeParseOptions2(opts) { - if (!opts) { - return defaults2; - } - if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { - throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); - } - if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") { - throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided"); - } - if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") { - throw new TypeError("Decoder has to be a function."); - } - if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { - throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); - } - var charset = typeof opts.charset === "undefined" ? defaults2.charset : opts.charset; - var duplicates = typeof opts.duplicates === "undefined" ? defaults2.duplicates : opts.duplicates; - if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") { - throw new TypeError("The duplicates option must be either combine, first, or last"); - } - var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots; - return { - allowDots, - allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, - allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults2.allowPrototypes, - allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults2.allowSparse, - arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults2.arrayLimit, - charset, - charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, - comma: typeof opts.comma === "boolean" ? opts.comma : defaults2.comma, - decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults2.decodeDotInKeys, - decoder: typeof opts.decoder === "function" ? opts.decoder : defaults2.decoder, - delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults2.delimiter, - // eslint-disable-next-line no-implicit-coercion, no-extra-parens - depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults2.depth, - duplicates, - ignoreQueryPrefix: opts.ignoreQueryPrefix === true, - interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults2.interpretNumericEntities, - parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults2.parameterLimit, - parseArrays: opts.parseArrays !== false, - plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults2.plainObjects, - strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults2.strictDepth, - strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling - }; - }; - module2.exports = function(str, opts) { - var options = normalizeParseOptions(opts); - if (str === "" || str === null || typeof str === "undefined") { - return options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; - } - var tempObj = typeof str === "string" ? parseValues(str, options) : str; - var obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; - var keys = Object.keys(tempObj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var newObj = parseKeys(key, tempObj[key], options, typeof str === "string"); - obj = utils.merge(obj, newObj, options); - } - if (options.allowSparse === true) { - return obj; - } - return utils.compact(obj); - }; - } -}); - -// node_modules/qs/lib/index.js -var require_lib = __commonJS({ - "node_modules/qs/lib/index.js"(exports2, module2) { - "use strict"; - var stringify = require_stringify(); - var parse = require_parse(); - var formats = require_formats(); - module2.exports = { - formats, - parse, - stringify - }; - } -}); - -// api.ts -var api_exports = {}; -__export(api_exports, { - APIS: () => APIS, - AccountApi: () => AccountApi, - AccountCreateRequest: () => AccountCreateRequest, - AccountCreateResponse: () => AccountCreateResponse, - AccountGetResponse: () => AccountGetResponse, - AccountResponse: () => AccountResponse, - AccountResponseQuotas: () => AccountResponseQuotas, - AccountResponseUsage: () => AccountResponseUsage, - AccountUpdateRequest: () => AccountUpdateRequest, - AccountVerifyRequest: () => AccountVerifyRequest, - AccountVerifyResponse: () => AccountVerifyResponse, - AccountVerifyResponseAccount: () => AccountVerifyResponseAccount, - ApiAppApi: () => ApiAppApi, - ApiAppCreateRequest: () => ApiAppCreateRequest, - ApiAppGetResponse: () => ApiAppGetResponse, - ApiAppListResponse: () => ApiAppListResponse, - ApiAppResponse: () => ApiAppResponse, - ApiAppResponseOAuth: () => ApiAppResponseOAuth, - ApiAppResponseOptions: () => ApiAppResponseOptions, - ApiAppResponseOwnerAccount: () => ApiAppResponseOwnerAccount, - ApiAppResponseWhiteLabelingOptions: () => ApiAppResponseWhiteLabelingOptions, - ApiAppUpdateRequest: () => ApiAppUpdateRequest, - ApiKeyAuth: () => ApiKeyAuth, - BulkSendJobApi: () => BulkSendJobApi, - BulkSendJobGetResponse: () => BulkSendJobGetResponse, - BulkSendJobGetResponseSignatureRequests: () => BulkSendJobGetResponseSignatureRequests, - BulkSendJobListResponse: () => BulkSendJobListResponse, - BulkSendJobResponse: () => BulkSendJobResponse, - BulkSendJobSendResponse: () => BulkSendJobSendResponse, - EmbeddedApi: () => EmbeddedApi, - EmbeddedEditUrlRequest: () => EmbeddedEditUrlRequest, - EmbeddedEditUrlResponse: () => EmbeddedEditUrlResponse, - EmbeddedEditUrlResponseEmbedded: () => EmbeddedEditUrlResponseEmbedded, - EmbeddedSignUrlResponse: () => EmbeddedSignUrlResponse, - EmbeddedSignUrlResponseEmbedded: () => EmbeddedSignUrlResponseEmbedded, - ErrorResponse: () => ErrorResponse, - ErrorResponseError: () => ErrorResponseError, - EventCallbackHelper: () => EventCallbackHelper, - EventCallbackRequest: () => EventCallbackRequest, - EventCallbackRequestEvent: () => EventCallbackRequestEvent, - EventCallbackRequestEventMetadata: () => EventCallbackRequestEventMetadata, - FaxApi: () => FaxApi, - FaxGetResponse: () => FaxGetResponse, - FaxLineAddUserRequest: () => FaxLineAddUserRequest, - FaxLineApi: () => FaxLineApi, - FaxLineAreaCodeGetCountryEnum: () => FaxLineAreaCodeGetCountryEnum, - FaxLineAreaCodeGetProvinceEnum: () => FaxLineAreaCodeGetProvinceEnum, - FaxLineAreaCodeGetResponse: () => FaxLineAreaCodeGetResponse, - FaxLineAreaCodeGetStateEnum: () => FaxLineAreaCodeGetStateEnum, - FaxLineCreateRequest: () => FaxLineCreateRequest, - FaxLineDeleteRequest: () => FaxLineDeleteRequest, - FaxLineListResponse: () => FaxLineListResponse, - FaxLineRemoveUserRequest: () => FaxLineRemoveUserRequest, - FaxLineResponse: () => FaxLineResponse, - FaxLineResponseFaxLine: () => FaxLineResponseFaxLine, - FaxListResponse: () => FaxListResponse, - FaxResponse: () => FaxResponse, - FaxResponseTransmission: () => FaxResponseTransmission, - FaxSendRequest: () => FaxSendRequest, - FileResponse: () => FileResponse, - FileResponseDataUri: () => FileResponseDataUri, - HttpBasicAuth: () => HttpBasicAuth, - HttpBearerAuth: () => HttpBearerAuth, - HttpError: () => HttpError, - ListInfoResponse: () => ListInfoResponse, - OAuth: () => OAuth, - OAuthApi: () => OAuthApi, - OAuthTokenGenerateRequest: () => OAuthTokenGenerateRequest, - OAuthTokenRefreshRequest: () => OAuthTokenRefreshRequest, - OAuthTokenResponse: () => OAuthTokenResponse, - ObjectSerializer: () => ObjectSerializer, - ReportApi: () => ReportApi, - ReportCreateRequest: () => ReportCreateRequest, - ReportCreateResponse: () => ReportCreateResponse, - ReportResponse: () => ReportResponse, - SignatureRequestApi: () => SignatureRequestApi, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest: () => SignatureRequestBulkCreateEmbeddedWithTemplateRequest, - SignatureRequestBulkSendWithTemplateRequest: () => SignatureRequestBulkSendWithTemplateRequest, - SignatureRequestCreateEmbeddedRequest: () => SignatureRequestCreateEmbeddedRequest, - SignatureRequestCreateEmbeddedWithTemplateRequest: () => SignatureRequestCreateEmbeddedWithTemplateRequest, - SignatureRequestEditEmbeddedRequest: () => SignatureRequestEditEmbeddedRequest, - SignatureRequestEditEmbeddedWithTemplateRequest: () => SignatureRequestEditEmbeddedWithTemplateRequest, - SignatureRequestEditRequest: () => SignatureRequestEditRequest, - SignatureRequestEditWithTemplateRequest: () => SignatureRequestEditWithTemplateRequest, - SignatureRequestGetResponse: () => SignatureRequestGetResponse, - SignatureRequestListResponse: () => SignatureRequestListResponse, - SignatureRequestRemindRequest: () => SignatureRequestRemindRequest, - SignatureRequestResponse: () => SignatureRequestResponse, - SignatureRequestResponseAttachment: () => SignatureRequestResponseAttachment, - SignatureRequestResponseCustomFieldBase: () => SignatureRequestResponseCustomFieldBase, - SignatureRequestResponseCustomFieldCheckbox: () => SignatureRequestResponseCustomFieldCheckbox, - SignatureRequestResponseCustomFieldText: () => SignatureRequestResponseCustomFieldText, - SignatureRequestResponseCustomFieldTypeEnum: () => SignatureRequestResponseCustomFieldTypeEnum, - SignatureRequestResponseDataBase: () => SignatureRequestResponseDataBase, - SignatureRequestResponseDataTypeEnum: () => SignatureRequestResponseDataTypeEnum, - SignatureRequestResponseDataValueCheckbox: () => SignatureRequestResponseDataValueCheckbox, - SignatureRequestResponseDataValueCheckboxMerge: () => SignatureRequestResponseDataValueCheckboxMerge, - SignatureRequestResponseDataValueDateSigned: () => SignatureRequestResponseDataValueDateSigned, - SignatureRequestResponseDataValueDropdown: () => SignatureRequestResponseDataValueDropdown, - SignatureRequestResponseDataValueInitials: () => SignatureRequestResponseDataValueInitials, - SignatureRequestResponseDataValueRadio: () => SignatureRequestResponseDataValueRadio, - SignatureRequestResponseDataValueSignature: () => SignatureRequestResponseDataValueSignature, - SignatureRequestResponseDataValueText: () => SignatureRequestResponseDataValueText, - SignatureRequestResponseDataValueTextMerge: () => SignatureRequestResponseDataValueTextMerge, - SignatureRequestResponseSignatures: () => SignatureRequestResponseSignatures, - SignatureRequestSendRequest: () => SignatureRequestSendRequest, - SignatureRequestSendWithTemplateRequest: () => SignatureRequestSendWithTemplateRequest, - SignatureRequestUpdateRequest: () => SignatureRequestUpdateRequest, - SubAttachment: () => SubAttachment, - SubBulkSignerList: () => SubBulkSignerList, - SubBulkSignerListCustomField: () => SubBulkSignerListCustomField, - SubCC: () => SubCC, - SubCustomField: () => SubCustomField, - SubEditorOptions: () => SubEditorOptions, - SubFieldOptions: () => SubFieldOptions, - SubFormFieldGroup: () => SubFormFieldGroup, - SubFormFieldRule: () => SubFormFieldRule, - SubFormFieldRuleAction: () => SubFormFieldRuleAction, - SubFormFieldRuleTrigger: () => SubFormFieldRuleTrigger, - SubFormFieldsPerDocumentBase: () => SubFormFieldsPerDocumentBase, - SubFormFieldsPerDocumentCheckbox: () => SubFormFieldsPerDocumentCheckbox, - SubFormFieldsPerDocumentCheckboxMerge: () => SubFormFieldsPerDocumentCheckboxMerge, - SubFormFieldsPerDocumentDateSigned: () => SubFormFieldsPerDocumentDateSigned, - SubFormFieldsPerDocumentDropdown: () => SubFormFieldsPerDocumentDropdown, - SubFormFieldsPerDocumentFontEnum: () => SubFormFieldsPerDocumentFontEnum, - SubFormFieldsPerDocumentHyperlink: () => SubFormFieldsPerDocumentHyperlink, - SubFormFieldsPerDocumentInitials: () => SubFormFieldsPerDocumentInitials, - SubFormFieldsPerDocumentRadio: () => SubFormFieldsPerDocumentRadio, - SubFormFieldsPerDocumentSignature: () => SubFormFieldsPerDocumentSignature, - SubFormFieldsPerDocumentText: () => SubFormFieldsPerDocumentText, - SubFormFieldsPerDocumentTextMerge: () => SubFormFieldsPerDocumentTextMerge, - SubFormFieldsPerDocumentTypeEnum: () => SubFormFieldsPerDocumentTypeEnum, - SubMergeField: () => SubMergeField, - SubOAuth: () => SubOAuth, - SubOptions: () => SubOptions, - SubSignatureRequestGroupedSigners: () => SubSignatureRequestGroupedSigners, - SubSignatureRequestSigner: () => SubSignatureRequestSigner, - SubSignatureRequestTemplateSigner: () => SubSignatureRequestTemplateSigner, - SubSigningOptions: () => SubSigningOptions, - SubTeamResponse: () => SubTeamResponse, - SubTemplateRole: () => SubTemplateRole, - SubUnclaimedDraftSigner: () => SubUnclaimedDraftSigner, - SubUnclaimedDraftTemplateSigner: () => SubUnclaimedDraftTemplateSigner, - SubWhiteLabelingOptions: () => SubWhiteLabelingOptions, - TeamAddMemberRequest: () => TeamAddMemberRequest, - TeamApi: () => TeamApi, - TeamCreateRequest: () => TeamCreateRequest, - TeamGetInfoResponse: () => TeamGetInfoResponse, - TeamGetResponse: () => TeamGetResponse, - TeamInfoResponse: () => TeamInfoResponse, - TeamInviteResponse: () => TeamInviteResponse, - TeamInvitesResponse: () => TeamInvitesResponse, - TeamMemberResponse: () => TeamMemberResponse, - TeamMembersResponse: () => TeamMembersResponse, - TeamParentResponse: () => TeamParentResponse, - TeamRemoveMemberRequest: () => TeamRemoveMemberRequest, - TeamResponse: () => TeamResponse, - TeamSubTeamsResponse: () => TeamSubTeamsResponse, - TeamUpdateRequest: () => TeamUpdateRequest, - TemplateAddUserRequest: () => TemplateAddUserRequest, - TemplateApi: () => TemplateApi, - TemplateCreateEmbeddedDraftRequest: () => TemplateCreateEmbeddedDraftRequest, - TemplateCreateEmbeddedDraftResponse: () => TemplateCreateEmbeddedDraftResponse, - TemplateCreateEmbeddedDraftResponseTemplate: () => TemplateCreateEmbeddedDraftResponseTemplate, - TemplateCreateRequest: () => TemplateCreateRequest, - TemplateCreateResponse: () => TemplateCreateResponse, - TemplateCreateResponseTemplate: () => TemplateCreateResponseTemplate, - TemplateEditResponse: () => TemplateEditResponse, - TemplateGetResponse: () => TemplateGetResponse, - TemplateListResponse: () => TemplateListResponse, - TemplateRemoveUserRequest: () => TemplateRemoveUserRequest, - TemplateResponse: () => TemplateResponse, - TemplateResponseAccount: () => TemplateResponseAccount, - TemplateResponseAccountQuota: () => TemplateResponseAccountQuota, - TemplateResponseCCRole: () => TemplateResponseCCRole, - TemplateResponseDocument: () => TemplateResponseDocument, - TemplateResponseDocumentCustomFieldBase: () => TemplateResponseDocumentCustomFieldBase, - TemplateResponseDocumentCustomFieldCheckbox: () => TemplateResponseDocumentCustomFieldCheckbox, - TemplateResponseDocumentCustomFieldText: () => TemplateResponseDocumentCustomFieldText, - TemplateResponseDocumentFieldGroup: () => TemplateResponseDocumentFieldGroup, - TemplateResponseDocumentFieldGroupRule: () => TemplateResponseDocumentFieldGroupRule, - TemplateResponseDocumentFormFieldBase: () => TemplateResponseDocumentFormFieldBase, - TemplateResponseDocumentFormFieldCheckbox: () => TemplateResponseDocumentFormFieldCheckbox, - TemplateResponseDocumentFormFieldDateSigned: () => TemplateResponseDocumentFormFieldDateSigned, - TemplateResponseDocumentFormFieldDropdown: () => TemplateResponseDocumentFormFieldDropdown, - TemplateResponseDocumentFormFieldHyperlink: () => TemplateResponseDocumentFormFieldHyperlink, - TemplateResponseDocumentFormFieldInitials: () => TemplateResponseDocumentFormFieldInitials, - TemplateResponseDocumentFormFieldRadio: () => TemplateResponseDocumentFormFieldRadio, - TemplateResponseDocumentFormFieldSignature: () => TemplateResponseDocumentFormFieldSignature, - TemplateResponseDocumentFormFieldText: () => TemplateResponseDocumentFormFieldText, - TemplateResponseDocumentStaticFieldBase: () => TemplateResponseDocumentStaticFieldBase, - TemplateResponseDocumentStaticFieldCheckbox: () => TemplateResponseDocumentStaticFieldCheckbox, - TemplateResponseDocumentStaticFieldDateSigned: () => TemplateResponseDocumentStaticFieldDateSigned, - TemplateResponseDocumentStaticFieldDropdown: () => TemplateResponseDocumentStaticFieldDropdown, - TemplateResponseDocumentStaticFieldHyperlink: () => TemplateResponseDocumentStaticFieldHyperlink, - TemplateResponseDocumentStaticFieldInitials: () => TemplateResponseDocumentStaticFieldInitials, - TemplateResponseDocumentStaticFieldRadio: () => TemplateResponseDocumentStaticFieldRadio, - TemplateResponseDocumentStaticFieldSignature: () => TemplateResponseDocumentStaticFieldSignature, - TemplateResponseDocumentStaticFieldText: () => TemplateResponseDocumentStaticFieldText, - TemplateResponseFieldAvgTextLength: () => TemplateResponseFieldAvgTextLength, - TemplateResponseSignerRole: () => TemplateResponseSignerRole, - TemplateUpdateFilesRequest: () => TemplateUpdateFilesRequest, - TemplateUpdateFilesResponse: () => TemplateUpdateFilesResponse, - TemplateUpdateFilesResponseTemplate: () => TemplateUpdateFilesResponseTemplate, - USER_AGENT: () => USER_AGENT, - UnclaimedDraftApi: () => UnclaimedDraftApi, - UnclaimedDraftCreateEmbeddedRequest: () => UnclaimedDraftCreateEmbeddedRequest, - UnclaimedDraftCreateEmbeddedWithTemplateRequest: () => UnclaimedDraftCreateEmbeddedWithTemplateRequest, - UnclaimedDraftCreateRequest: () => UnclaimedDraftCreateRequest, - UnclaimedDraftCreateResponse: () => UnclaimedDraftCreateResponse, - UnclaimedDraftEditAndResendRequest: () => UnclaimedDraftEditAndResendRequest, - UnclaimedDraftResponse: () => UnclaimedDraftResponse, - VoidAuth: () => VoidAuth, - WarningResponse: () => WarningResponse, - enumsMap: () => enumsMap, - generateFormData: () => generateFormData, - queryParamsSerializer: () => queryParamsSerializer, - toFormData: () => toFormData3, - typeMap: () => typeMap -}); -module.exports = __toCommonJS(api_exports); - -// node_modules/axios/lib/helpers/bind.js -function bind(fn, thisArg) { - return function wrap() { - return fn.apply(thisArg, arguments); - }; -} - -// node_modules/axios/lib/utils.js -var { toString } = Object.prototype; -var { getPrototypeOf } = Object; -var kindOf = /* @__PURE__ */ ((cache) => (thing) => { - const str = toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); -})(/* @__PURE__ */ Object.create(null)); -var kindOfTest = (type) => { - type = type.toLowerCase(); - return (thing) => kindOf(thing) === type; -}; -var typeOfTest = (type) => (thing) => typeof thing === type; -var { isArray } = Array; -var isUndefined = typeOfTest("undefined"); -function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); -} -var isArrayBuffer = kindOfTest("ArrayBuffer"); -function isArrayBufferView(val) { - let result; - if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { - result = ArrayBuffer.isView(val); - } else { - result = val && val.buffer && isArrayBuffer(val.buffer); - } - return result; -} -var isString = typeOfTest("string"); -var isFunction = typeOfTest("function"); -var isNumber = typeOfTest("number"); -var isObject = (thing) => thing !== null && typeof thing === "object"; -var isBoolean = (thing) => thing === true || thing === false; -var isPlainObject = (val) => { - if (kindOf(val) !== "object") { - return false; - } - const prototype3 = getPrototypeOf(val); - return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); -}; -var isDate = kindOfTest("Date"); -var isFile = kindOfTest("File"); -var isBlob = kindOfTest("Blob"); -var isFileList = kindOfTest("FileList"); -var isStream = (val) => isObject(val) && isFunction(val.pipe); -var isFormData = (thing) => { - let kind; - return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance - kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]")); -}; -var isURLSearchParams = kindOfTest("URLSearchParams"); -var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); -var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); -function forEach(obj, fn, { allOwnKeys = false } = {}) { - if (obj === null || typeof obj === "undefined") { - return; - } - let i; - let l; - if (typeof obj !== "object") { - obj = [obj]; - } - if (isArray(obj)) { - for (i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - fn.call(null, obj[key], key, obj); - } - } -} -function findKey(obj, key) { - key = key.toLowerCase(); - const keys = Object.keys(obj); - let i = keys.length; - let _key; - while (i-- > 0) { - _key = keys[i]; - if (key === _key.toLowerCase()) { - return _key; - } - } - return null; -} -var _global = (() => { - if (typeof globalThis !== "undefined") return globalThis; - return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; -})(); -var isContextDefined = (context) => !isUndefined(context) && context !== _global; -function merge() { - const { caseless } = isContextDefined(this) && this || {}; - const result = {}; - const assignValue = (val, key) => { - const targetKey = caseless && findKey(result, key) || key; - if (isPlainObject(result[targetKey]) && isPlainObject(val)) { - result[targetKey] = merge(result[targetKey], val); - } else if (isPlainObject(val)) { - result[targetKey] = merge({}, val); - } else if (isArray(val)) { - result[targetKey] = val.slice(); - } else { - result[targetKey] = val; - } - }; - for (let i = 0, l = arguments.length; i < l; i++) { - arguments[i] && forEach(arguments[i], assignValue); - } - return result; -} -var extend = (a, b, thisArg, { allOwnKeys } = {}) => { - forEach(b, (val, key) => { - if (thisArg && isFunction(val)) { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }, { allOwnKeys }); - return a; -}; -var stripBOM = (content) => { - if (content.charCodeAt(0) === 65279) { - content = content.slice(1); - } - return content; -}; -var inherits = (constructor, superConstructor, props, descriptors2) => { - constructor.prototype = Object.create(superConstructor.prototype, descriptors2); - constructor.prototype.constructor = constructor; - Object.defineProperty(constructor, "super", { - value: superConstructor.prototype - }); - props && Object.assign(constructor.prototype, props); -}; -var toFlatObject = (sourceObj, destObj, filter2, propFilter) => { - let props; - let i; - let prop; - const merged = {}; - destObj = destObj || {}; - if (sourceObj == null) return destObj; - do { - props = Object.getOwnPropertyNames(sourceObj); - i = props.length; - while (i-- > 0) { - prop = props[i]; - if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; - } - } - sourceObj = filter2 !== false && getPrototypeOf(sourceObj); - } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype); - return destObj; -}; -var endsWith = (str, searchString, position) => { - str = String(str); - if (position === void 0 || position > str.length) { - position = str.length; - } - position -= searchString.length; - const lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; -}; -var toArray = (thing) => { - if (!thing) return null; - if (isArray(thing)) return thing; - let i = thing.length; - if (!isNumber(i)) return null; - const arr = new Array(i); - while (i-- > 0) { - arr[i] = thing[i]; - } - return arr; -}; -var isTypedArray = /* @__PURE__ */ ((TypedArray) => { - return (thing) => { - return TypedArray && thing instanceof TypedArray; - }; -})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); -var forEachEntry = (obj, fn) => { - const generator = obj && obj[Symbol.iterator]; - const iterator = generator.call(obj); - let result; - while ((result = iterator.next()) && !result.done) { - const pair = result.value; - fn.call(obj, pair[0], pair[1]); - } -}; -var matchAll = (regExp, str) => { - let matches; - const arr = []; - while ((matches = regExp.exec(str)) !== null) { - arr.push(matches); - } - return arr; -}; -var isHTMLForm = kindOfTest("HTMLFormElement"); -var toCamelCase = (str) => { - return str.toLowerCase().replace( - /[-_\s]([a-z\d])(\w*)/g, - function replacer(m, p1, p2) { - return p1.toUpperCase() + p2; - } - ); -}; -var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); -var isRegExp = kindOfTest("RegExp"); -var reduceDescriptors = (obj, reducer) => { - const descriptors2 = Object.getOwnPropertyDescriptors(obj); - const reducedDescriptors = {}; - forEach(descriptors2, (descriptor, name) => { - let ret; - if ((ret = reducer(descriptor, name, obj)) !== false) { - reducedDescriptors[name] = ret || descriptor; - } - }); - Object.defineProperties(obj, reducedDescriptors); -}; -var freezeMethods = (obj) => { - reduceDescriptors(obj, (descriptor, name) => { - if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) { - return false; - } - const value = obj[name]; - if (!isFunction(value)) return; - descriptor.enumerable = false; - if ("writable" in descriptor) { - descriptor.writable = false; - return; - } - if (!descriptor.set) { - descriptor.set = () => { - throw Error("Can not rewrite read-only method '" + name + "'"); - }; - } - }); -}; -var toObjectSet = (arrayOrString, delimiter) => { - const obj = {}; - const define = (arr) => { - arr.forEach((value) => { - obj[value] = true; - }); - }; - isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); - return obj; -}; -var noop = () => { -}; -var toFiniteNumber = (value, defaultValue) => { - return value != null && Number.isFinite(value = +value) ? value : defaultValue; -}; -function isSpecCompliantForm(thing) { - return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]); -} -var toJSONObject = (obj) => { - const stack = new Array(10); - const visit = (source, i) => { - if (isObject(source)) { - if (stack.indexOf(source) >= 0) { - return; - } - if (!("toJSON" in source)) { - stack[i] = source; - const target = isArray(source) ? [] : {}; - forEach(source, (value, key) => { - const reducedValue = visit(value, i + 1); - !isUndefined(reducedValue) && (target[key] = reducedValue); - }); - stack[i] = void 0; - return target; - } - } - return source; - }; - return visit(obj, 0); -}; -var isAsyncFn = kindOfTest("AsyncFunction"); -var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); -var _setImmediate = ((setImmediateSupported, postMessageSupported) => { - if (setImmediateSupported) { - return setImmediate; - } - return postMessageSupported ? ((token, callbacks) => { - _global.addEventListener("message", ({ source, data }) => { - if (source === _global && data === token) { - callbacks.length && callbacks.shift()(); - } - }, false); - return (cb) => { - callbacks.push(cb); - _global.postMessage(token, "*"); - }; - })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); -})( - typeof setImmediate === "function", - isFunction(_global.postMessage) -); -var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; -var utils_default = { - isArray, - isArrayBuffer, - isBuffer, - isFormData, - isArrayBufferView, - isString, - isNumber, - isBoolean, - isObject, - isPlainObject, - isReadableStream, - isRequest, - isResponse, - isHeaders, - isUndefined, - isDate, - isFile, - isBlob, - isRegExp, - isFunction, - isStream, - isURLSearchParams, - isTypedArray, - isFileList, - forEach, - merge, - extend, - trim, - stripBOM, - inherits, - toFlatObject, - kindOf, - kindOfTest, - endsWith, - toArray, - forEachEntry, - matchAll, - isHTMLForm, - hasOwnProperty, - hasOwnProp: hasOwnProperty, - // an alias to avoid ESLint no-prototype-builtins detection - reduceDescriptors, - freezeMethods, - toObjectSet, - toCamelCase, - noop, - toFiniteNumber, - findKey, - global: _global, - isContextDefined, - isSpecCompliantForm, - toJSONObject, - isAsyncFn, - isThenable, - setImmediate: _setImmediate, - asap -}; - -// node_modules/axios/lib/core/AxiosError.js -function AxiosError(message, code, config, request, response) { - Error.call(this); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - this.stack = new Error().stack; - } - this.message = message; - this.name = "AxiosError"; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - if (response) { - this.response = response; - this.status = response.status ? response.status : null; - } -} -utils_default.inherits(AxiosError, Error, { - toJSON: function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: utils_default.toJSONObject(this.config), - code: this.code, - status: this.status - }; - } -}); -var prototype = AxiosError.prototype; -var descriptors = {}; -[ - "ERR_BAD_OPTION_VALUE", - "ERR_BAD_OPTION", - "ECONNABORTED", - "ETIMEDOUT", - "ERR_NETWORK", - "ERR_FR_TOO_MANY_REDIRECTS", - "ERR_DEPRECATED", - "ERR_BAD_RESPONSE", - "ERR_BAD_REQUEST", - "ERR_CANCELED", - "ERR_NOT_SUPPORT", - "ERR_INVALID_URL" - // eslint-disable-next-line func-names -].forEach((code) => { - descriptors[code] = { value: code }; -}); -Object.defineProperties(AxiosError, descriptors); -Object.defineProperty(prototype, "isAxiosError", { value: true }); -AxiosError.from = (error, code, config, request, response, customProps) => { - const axiosError = Object.create(prototype); - utils_default.toFlatObject(error, axiosError, function filter2(obj) { - return obj !== Error.prototype; - }, (prop) => { - return prop !== "isAxiosError"; - }); - AxiosError.call(axiosError, error.message, code, config, request, response); - axiosError.cause = error; - axiosError.name = error.name; - customProps && Object.assign(axiosError, customProps); - return axiosError; -}; -var AxiosError_default = AxiosError; - -// node_modules/axios/lib/platform/node/classes/FormData.js -var import_form_data = __toESM(require_form_data(), 1); -var FormData_default = import_form_data.default; - -// node_modules/axios/lib/helpers/toFormData.js -function isVisitable(thing) { - return utils_default.isPlainObject(thing) || utils_default.isArray(thing); -} -function removeBrackets(key) { - return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key; -} -function renderKey(path, key, dots) { - if (!path) return key; - return path.concat(key).map(function each(token, i) { - token = removeBrackets(token); - return !dots && i ? "[" + token + "]" : token; - }).join(dots ? "." : ""); -} -function isFlatArray(arr) { - return utils_default.isArray(arr) && !arr.some(isVisitable); -} -var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) { - return /^is[A-Z]/.test(prop); -}); -function toFormData(obj, formData2, options) { - if (!utils_default.isObject(obj)) { - throw new TypeError("target must be an object"); - } - formData2 = formData2 || new (FormData_default || FormData)(); - options = utils_default.toFlatObject(options, { - metaTokens: true, - dots: false, - indexes: false - }, false, function defined(option, source) { - return !utils_default.isUndefined(source[option]); - }); - const metaTokens = options.metaTokens; - const visitor = options.visitor || defaultVisitor; - const dots = options.dots; - const indexes = options.indexes; - const _Blob = options.Blob || typeof Blob !== "undefined" && Blob; - const useBlob = _Blob && utils_default.isSpecCompliantForm(formData2); - if (!utils_default.isFunction(visitor)) { - throw new TypeError("visitor must be a function"); - } - function convertValue(value) { - if (value === null) return ""; - if (utils_default.isDate(value)) { - return value.toISOString(); - } - if (!useBlob && utils_default.isBlob(value)) { - throw new AxiosError_default("Blob is not supported. Use a Buffer instead."); - } - if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) { - return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); - } - return value; - } - function defaultVisitor(value, key, path) { - let arr = value; - if (value && !path && typeof value === "object") { - if (utils_default.endsWith(key, "{}")) { - key = metaTokens ? key : key.slice(0, -2); - value = JSON.stringify(value); - } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) { - key = removeBrackets(key); - arr.forEach(function each(el, index) { - !(utils_default.isUndefined(el) || el === null) && formData2.append( - // eslint-disable-next-line no-nested-ternary - indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]", - convertValue(el) - ); - }); - return false; - } - } - if (isVisitable(value)) { - return true; - } - formData2.append(renderKey(path, key, dots), convertValue(value)); - return false; - } - const stack = []; - const exposedHelpers = Object.assign(predicates, { - defaultVisitor, - convertValue, - isVisitable - }); - function build(value, path) { - if (utils_default.isUndefined(value)) return; - if (stack.indexOf(value) !== -1) { - throw Error("Circular reference detected in " + path.join(".")); - } - stack.push(value); - utils_default.forEach(value, function each(el, key) { - const result = !(utils_default.isUndefined(el) || el === null) && visitor.call( - formData2, - el, - utils_default.isString(key) ? key.trim() : key, - path, - exposedHelpers - ); - if (result === true) { - build(el, path ? path.concat(key) : [key]); - } - }); - stack.pop(); - } - if (!utils_default.isObject(obj)) { - throw new TypeError("data must be an object"); - } - build(obj); - return formData2; -} -var toFormData_default = toFormData; - -// node_modules/axios/lib/helpers/AxiosURLSearchParams.js -function encode(str) { - const charMap = { - "!": "%21", - "'": "%27", - "(": "%28", - ")": "%29", - "~": "%7E", - "%20": "+", - "%00": "\0" - }; - return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { - return charMap[match]; - }); -} -function AxiosURLSearchParams(params, options) { - this._pairs = []; - params && toFormData_default(params, this, options); -} -var prototype2 = AxiosURLSearchParams.prototype; -prototype2.append = function append(name, value) { - this._pairs.push([name, value]); -}; -prototype2.toString = function toString2(encoder) { - const _encode = encoder ? function(value) { - return encoder.call(this, value, encode); - } : encode; - return this._pairs.map(function each(pair) { - return _encode(pair[0]) + "=" + _encode(pair[1]); - }, "").join("&"); -}; -var AxiosURLSearchParams_default = AxiosURLSearchParams; - -// node_modules/axios/lib/helpers/buildURL.js -function encode2(val) { - return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); -} -function buildURL(url2, params, options) { - if (!params) { - return url2; - } - const _encode = options && options.encode || encode2; - if (utils_default.isFunction(options)) { - options = { - serialize: options - }; - } - const serializeFn = options && options.serialize; - let serializedParams; - if (serializeFn) { - serializedParams = serializeFn(params, options); - } else { - serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, options).toString(_encode); - } - if (serializedParams) { - const hashmarkIndex = url2.indexOf("#"); - if (hashmarkIndex !== -1) { - url2 = url2.slice(0, hashmarkIndex); - } - url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams; - } - return url2; -} - -// node_modules/axios/lib/core/InterceptorManager.js -var InterceptorManager = class { - constructor() { - this.handlers = []; - } - /** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ - use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled, - rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; - } - /** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - * - * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise - */ - eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } - } - /** - * Clear all interceptors from the stack - * - * @returns {void} - */ - clear() { - if (this.handlers) { - this.handlers = []; - } - } - /** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - * - * @returns {void} - */ - forEach(fn) { - utils_default.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); - } -}; -var InterceptorManager_default = InterceptorManager; - -// node_modules/axios/lib/defaults/transitional.js -var transitional_default = { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false -}; - -// node_modules/axios/lib/platform/node/index.js -var import_crypto = __toESM(require("crypto"), 1); - -// node_modules/axios/lib/platform/node/classes/URLSearchParams.js -var import_url = __toESM(require("url"), 1); -var URLSearchParams_default = import_url.default.URLSearchParams; - -// node_modules/axios/lib/platform/node/index.js -var ALPHA = "abcdefghijklmnopqrstuvwxyz"; -var DIGIT = "0123456789"; -var ALPHABET = { - DIGIT, - ALPHA, - ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT -}; -var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { - let str = ""; - const { length } = alphabet; - const randomValues = new Uint32Array(size); - import_crypto.default.randomFillSync(randomValues); - for (let i = 0; i < size; i++) { - str += alphabet[randomValues[i] % length]; - } - return str; -}; -var node_default = { - isNode: true, - classes: { - URLSearchParams: URLSearchParams_default, - FormData: FormData_default, - Blob: typeof Blob !== "undefined" && Blob || null - }, - ALPHABET, - generateString, - protocols: ["http", "https", "file", "data"] -}; - -// node_modules/axios/lib/platform/common/utils.js -var utils_exports = {}; -__export(utils_exports, { - hasBrowserEnv: () => hasBrowserEnv, - hasStandardBrowserEnv: () => hasStandardBrowserEnv, - hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv, - navigator: () => _navigator, - origin: () => origin -}); -var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; -var _navigator = typeof navigator === "object" && navigator || void 0; -var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0); -var hasStandardBrowserWebWorkerEnv = (() => { - return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef - self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; -})(); -var origin = hasBrowserEnv && window.location.href || "http://localhost"; - -// node_modules/axios/lib/platform/index.js -var platform_default = { - ...utils_exports, - ...node_default -}; - -// node_modules/axios/lib/helpers/toURLEncodedForm.js -function toURLEncodedForm(data, options) { - return toFormData_default(data, new platform_default.classes.URLSearchParams(), Object.assign({ - visitor: function(value, key, path, helpers) { - if (platform_default.isNode && utils_default.isBuffer(value)) { - this.append(key, value.toString("base64")); - return false; - } - return helpers.defaultVisitor.apply(this, arguments); - } - }, options)); -} - -// node_modules/axios/lib/helpers/formDataToJSON.js -function parsePropPath(name) { - return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => { - return match[0] === "[]" ? "" : match[1] || match[0]; - }); -} -function arrayToObject(arr) { - const obj = {}; - const keys = Object.keys(arr); - let i; - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - obj[key] = arr[key]; - } - return obj; -} -function formDataToJSON(formData2) { - function buildPath(path, value, target, index) { - let name = path[index++]; - if (name === "__proto__") return true; - const isNumericKey = Number.isFinite(+name); - const isLast = index >= path.length; - name = !name && utils_default.isArray(target) ? target.length : name; - if (isLast) { - if (utils_default.hasOwnProp(target, name)) { - target[name] = [target[name], value]; - } else { - target[name] = value; - } - return !isNumericKey; - } - if (!target[name] || !utils_default.isObject(target[name])) { - target[name] = []; - } - const result = buildPath(path, value, target[name], index); - if (result && utils_default.isArray(target[name])) { - target[name] = arrayToObject(target[name]); - } - return !isNumericKey; - } - if (utils_default.isFormData(formData2) && utils_default.isFunction(formData2.entries)) { - const obj = {}; - utils_default.forEachEntry(formData2, (name, value) => { - buildPath(parsePropPath(name), value, obj, 0); - }); - return obj; - } - return null; -} -var formDataToJSON_default = formDataToJSON; - -// node_modules/axios/lib/defaults/index.js -function stringifySafely(rawValue, parser, encoder) { - if (utils_default.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils_default.trim(rawValue); - } catch (e) { - if (e.name !== "SyntaxError") { - throw e; - } - } - } - return (encoder || JSON.stringify)(rawValue); -} -var defaults = { - transitional: transitional_default, - adapter: ["xhr", "http", "fetch"], - transformRequest: [function transformRequest(data, headers) { - const contentType = headers.getContentType() || ""; - const hasJSONContentType = contentType.indexOf("application/json") > -1; - const isObjectPayload = utils_default.isObject(data); - if (isObjectPayload && utils_default.isHTMLForm(data)) { - data = new FormData(data); - } - const isFormData2 = utils_default.isFormData(data); - if (isFormData2) { - return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data; - } - if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) { - return data; - } - if (utils_default.isArrayBufferView(data)) { - return data.buffer; - } - if (utils_default.isURLSearchParams(data)) { - headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); - return data.toString(); - } - let isFileList2; - if (isObjectPayload) { - if (contentType.indexOf("application/x-www-form-urlencoded") > -1) { - return toURLEncodedForm(data, this.formSerializer).toString(); - } - if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { - const _FormData = this.env && this.env.FormData; - return toFormData_default( - isFileList2 ? { "files[]": data } : data, - _FormData && new _FormData(), - this.formSerializer - ); - } - } - if (isObjectPayload || hasJSONContentType) { - headers.setContentType("application/json", false); - return stringifySafely(data); - } - return data; - }], - transformResponse: [function transformResponse(data) { - const transitional2 = this.transitional || defaults.transitional; - const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing; - const JSONRequested = this.responseType === "json"; - if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) { - return data; - } - if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { - const silentJSONParsing = transitional2 && transitional2.silentJSONParsing; - const strictJSONParsing = !silentJSONParsing && JSONRequested; - try { - return JSON.parse(data); - } catch (e) { - if (strictJSONParsing) { - if (e.name === "SyntaxError") { - throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response); - } - throw e; - } - } - } - return data; - }], - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - xsrfCookieName: "XSRF-TOKEN", - xsrfHeaderName: "X-XSRF-TOKEN", - maxContentLength: -1, - maxBodyLength: -1, - env: { - FormData: platform_default.classes.FormData, - Blob: platform_default.classes.Blob - }, - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, - headers: { - common: { - "Accept": "application/json, text/plain, */*", - "Content-Type": void 0 - } - } -}; -utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => { - defaults.headers[method] = {}; -}); -var defaults_default = defaults; - -// node_modules/axios/lib/helpers/parseHeaders.js -var ignoreDuplicateOf = utils_default.toObjectSet([ - "age", - "authorization", - "content-length", - "content-type", - "etag", - "expires", - "from", - "host", - "if-modified-since", - "if-unmodified-since", - "last-modified", - "location", - "max-forwards", - "proxy-authorization", - "referer", - "retry-after", - "user-agent" -]); -var parseHeaders_default = (rawHeaders) => { - const parsed = {}; - let key; - let val; - let i; - rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { - i = line.indexOf(":"); - key = line.substring(0, i).trim().toLowerCase(); - val = line.substring(i + 1).trim(); - if (!key || parsed[key] && ignoreDuplicateOf[key]) { - return; - } - if (key === "set-cookie") { - if (parsed[key]) { - parsed[key].push(val); - } else { - parsed[key] = [val]; - } - } else { - parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; - } - }); - return parsed; -}; - -// node_modules/axios/lib/core/AxiosHeaders.js -var $internals = Symbol("internals"); -function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); -} -function normalizeValue(value) { - if (value === false || value == null) { - return value; - } - return utils_default.isArray(value) ? value.map(normalizeValue) : String(value); -} -function parseTokens(str) { - const tokens = /* @__PURE__ */ Object.create(null); - const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let match; - while (match = tokensRE.exec(str)) { - tokens[match[1]] = match[2]; - } - return tokens; -} -var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); -function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) { - if (utils_default.isFunction(filter2)) { - return filter2.call(this, value, header); - } - if (isHeaderNameFilter) { - value = header; - } - if (!utils_default.isString(value)) return; - if (utils_default.isString(filter2)) { - return value.indexOf(filter2) !== -1; - } - if (utils_default.isRegExp(filter2)) { - return filter2.test(value); - } -} -function formatHeader(header) { - return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { - return char.toUpperCase() + str; - }); -} -function buildAccessors(obj, header) { - const accessorName = utils_default.toCamelCase(" " + header); - ["get", "set", "has"].forEach((methodName) => { - Object.defineProperty(obj, methodName + accessorName, { - value: function(arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true - }); - }); -} -var AxiosHeaders = class { - constructor(headers) { - headers && this.set(headers); - } - set(header, valueOrRewrite, rewrite) { - const self2 = this; - function setHeader(_value, _header, _rewrite) { - const lHeader = normalizeHeader(_header); - if (!lHeader) { - throw new Error("header name must be a non-empty string"); - } - const key = utils_default.findKey(self2, lHeader); - if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) { - self2[key || _header] = normalizeValue(_value); - } - } - const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); - if (utils_default.isPlainObject(header) || header instanceof this.constructor) { - setHeaders(header, valueOrRewrite); - } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { - setHeaders(parseHeaders_default(header), valueOrRewrite); - } else if (utils_default.isHeaders(header)) { - for (const [key, value] of header.entries()) { - setHeader(value, key, rewrite); - } - } else { - header != null && setHeader(valueOrRewrite, header, rewrite); - } - return this; - } - get(header, parser) { - header = normalizeHeader(header); - if (header) { - const key = utils_default.findKey(this, header); - if (key) { - const value = this[key]; - if (!parser) { - return value; - } - if (parser === true) { - return parseTokens(value); - } - if (utils_default.isFunction(parser)) { - return parser.call(this, value, key); - } - if (utils_default.isRegExp(parser)) { - return parser.exec(value); - } - throw new TypeError("parser must be boolean|regexp|function"); - } - } - } - has(header, matcher) { - header = normalizeHeader(header); - if (header) { - const key = utils_default.findKey(this, header); - return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); - } - return false; - } - delete(header, matcher) { - const self2 = this; - let deleted = false; - function deleteHeader(_header) { - _header = normalizeHeader(_header); - if (_header) { - const key = utils_default.findKey(self2, _header); - if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) { - delete self2[key]; - deleted = true; - } - } - } - if (utils_default.isArray(header)) { - header.forEach(deleteHeader); - } else { - deleteHeader(header); - } - return deleted; - } - clear(matcher) { - const keys = Object.keys(this); - let i = keys.length; - let deleted = false; - while (i--) { - const key = keys[i]; - if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { - delete this[key]; - deleted = true; - } - } - return deleted; - } - normalize(format) { - const self2 = this; - const headers = {}; - utils_default.forEach(this, (value, header) => { - const key = utils_default.findKey(headers, header); - if (key) { - self2[key] = normalizeValue(value); - delete self2[header]; - return; - } - const normalized = format ? formatHeader(header) : String(header).trim(); - if (normalized !== header) { - delete self2[header]; - } - self2[normalized] = normalizeValue(value); - headers[normalized] = true; - }); - return this; - } - concat(...targets) { - return this.constructor.concat(this, ...targets); - } - toJSON(asStrings) { - const obj = /* @__PURE__ */ Object.create(null); - utils_default.forEach(this, (value, header) => { - value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value); - }); - return obj; - } - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - toString() { - return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); - } - get [Symbol.toStringTag]() { - return "AxiosHeaders"; - } - static from(thing) { - return thing instanceof this ? thing : new this(thing); - } - static concat(first, ...targets) { - const computed = new this(first); - targets.forEach((target) => computed.set(target)); - return computed; - } - static accessor(header) { - const internals = this[$internals] = this[$internals] = { - accessors: {} - }; - const accessors = internals.accessors; - const prototype3 = this.prototype; - function defineAccessor(_header) { - const lHeader = normalizeHeader(_header); - if (!accessors[lHeader]) { - buildAccessors(prototype3, _header); - accessors[lHeader] = true; - } - } - utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); - return this; - } -}; -AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); -utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { - let mapped = key[0].toUpperCase() + key.slice(1); - return { - get: () => value, - set(headerValue) { - this[mapped] = headerValue; - } - }; -}); -utils_default.freezeMethods(AxiosHeaders); -var AxiosHeaders_default = AxiosHeaders; - -// node_modules/axios/lib/core/transformData.js -function transformData(fns, response) { - const config = this || defaults_default; - const context = response || config; - const headers = AxiosHeaders_default.from(context.headers); - let data = context.data; - utils_default.forEach(fns, function transform(fn) { - data = fn.call(config, data, headers.normalize(), response ? response.status : void 0); - }); - headers.normalize(); - return data; -} - -// node_modules/axios/lib/cancel/isCancel.js -function isCancel(value) { - return !!(value && value.__CANCEL__); -} - -// node_modules/axios/lib/cancel/CanceledError.js -function CanceledError(message, config, request) { - AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request); - this.name = "CanceledError"; -} -utils_default.inherits(CanceledError, AxiosError_default, { - __CANCEL__: true -}); -var CanceledError_default = CanceledError; - -// node_modules/axios/lib/core/settle.js -function settle(resolve, reject, response) { - const validateStatus2 = response.config.validateStatus; - if (!response.status || !validateStatus2 || validateStatus2(response.status)) { - resolve(response); - } else { - reject(new AxiosError_default( - "Request failed with status code " + response.status, - [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], - response.config, - response.request, - response - )); - } -} - -// node_modules/axios/lib/helpers/isAbsoluteURL.js -function isAbsoluteURL(url2) { - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2); -} - -// node_modules/axios/lib/helpers/combineURLs.js -function combineURLs(baseURL, relativeURL) { - return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; -} - -// node_modules/axios/lib/core/buildFullPath.js -function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { - let isRelativeUrl = !isAbsoluteURL(requestedURL); - if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -} - -// node_modules/axios/lib/adapters/http.js -var import_proxy_from_env = __toESM(require_proxy_from_env(), 1); -var import_http = __toESM(require("http"), 1); -var import_https = __toESM(require("https"), 1); -var import_util2 = __toESM(require("util"), 1); -var import_follow_redirects = __toESM(require_follow_redirects(), 1); -var import_zlib = __toESM(require("zlib"), 1); - -// node_modules/axios/lib/env/data.js -var VERSION = "1.8.4"; - -// node_modules/axios/lib/helpers/parseProtocol.js -function parseProtocol(url2) { - const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2); - return match && match[1] || ""; -} - -// node_modules/axios/lib/helpers/fromDataURI.js -var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; -function fromDataURI(uri, asBlob, options) { - const _Blob = options && options.Blob || platform_default.classes.Blob; - const protocol = parseProtocol(uri); - if (asBlob === void 0 && _Blob) { - asBlob = true; - } - if (protocol === "data") { - uri = protocol.length ? uri.slice(protocol.length + 1) : uri; - const match = DATA_URL_PATTERN.exec(uri); - if (!match) { - throw new AxiosError_default("Invalid URL", AxiosError_default.ERR_INVALID_URL); - } - const mime = match[1]; - const isBase64 = match[2]; - const body = match[3]; - const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8"); - if (asBlob) { - if (!_Blob) { - throw new AxiosError_default("Blob is not supported", AxiosError_default.ERR_NOT_SUPPORT); - } - return new _Blob([buffer], { type: mime }); - } - return buffer; - } - throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT); -} - -// node_modules/axios/lib/adapters/http.js -var import_stream4 = __toESM(require("stream"), 1); - -// node_modules/axios/lib/helpers/AxiosTransformStream.js -var import_stream = __toESM(require("stream"), 1); -var kInternals = Symbol("internals"); -var AxiosTransformStream = class extends import_stream.default.Transform { - constructor(options) { - options = utils_default.toFlatObject(options, { - maxRate: 0, - chunkSize: 64 * 1024, - minChunkSize: 100, - timeWindow: 500, - ticksRate: 2, - samplesCount: 15 - }, null, (prop, source) => { - return !utils_default.isUndefined(source[prop]); - }); - super({ - readableHighWaterMark: options.chunkSize - }); - const internals = this[kInternals] = { - timeWindow: options.timeWindow, - chunkSize: options.chunkSize, - maxRate: options.maxRate, - minChunkSize: options.minChunkSize, - bytesSeen: 0, - isCaptured: false, - notifiedBytesLoaded: 0, - ts: Date.now(), - bytes: 0, - onReadCallback: null - }; - this.on("newListener", (event) => { - if (event === "progress") { - if (!internals.isCaptured) { - internals.isCaptured = true; - } - } - }); - } - _read(size) { - const internals = this[kInternals]; - if (internals.onReadCallback) { - internals.onReadCallback(); - } - return super._read(size); - } - _transform(chunk, encoding, callback) { - const internals = this[kInternals]; - const maxRate = internals.maxRate; - const readableHighWaterMark = this.readableHighWaterMark; - const timeWindow = internals.timeWindow; - const divider = 1e3 / timeWindow; - const bytesThreshold = maxRate / divider; - const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; - const pushChunk = (_chunk, _callback) => { - const bytes = Buffer.byteLength(_chunk); - internals.bytesSeen += bytes; - internals.bytes += bytes; - internals.isCaptured && this.emit("progress", internals.bytesSeen); - if (this.push(_chunk)) { - process.nextTick(_callback); - } else { - internals.onReadCallback = () => { - internals.onReadCallback = null; - process.nextTick(_callback); - }; - } - }; - const transformChunk = (_chunk, _callback) => { - const chunkSize = Buffer.byteLength(_chunk); - let chunkRemainder = null; - let maxChunkSize = readableHighWaterMark; - let bytesLeft; - let passed = 0; - if (maxRate) { - const now = Date.now(); - if (!internals.ts || (passed = now - internals.ts) >= timeWindow) { - internals.ts = now; - bytesLeft = bytesThreshold - internals.bytes; - internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; - passed = 0; - } - bytesLeft = bytesThreshold - internals.bytes; - } - if (maxRate) { - if (bytesLeft <= 0) { - return setTimeout(() => { - _callback(null, _chunk); - }, timeWindow - passed); - } - if (bytesLeft < maxChunkSize) { - maxChunkSize = bytesLeft; - } - } - if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) { - chunkRemainder = _chunk.subarray(maxChunkSize); - _chunk = _chunk.subarray(0, maxChunkSize); - } - pushChunk(_chunk, chunkRemainder ? () => { - process.nextTick(_callback, null, chunkRemainder); - } : _callback); - }; - transformChunk(chunk, function transformNextChunk(err, _chunk) { - if (err) { - return callback(err); - } - if (_chunk) { - transformChunk(_chunk, transformNextChunk); - } else { - callback(null); - } - }); - } -}; -var AxiosTransformStream_default = AxiosTransformStream; - -// node_modules/axios/lib/adapters/http.js -var import_events = require("events"); - -// node_modules/axios/lib/helpers/formDataToStream.js -var import_util = __toESM(require("util"), 1); -var import_stream2 = require("stream"); - -// node_modules/axios/lib/helpers/readBlob.js -var { asyncIterator } = Symbol; -var readBlob = async function* (blob) { - if (blob.stream) { - yield* blob.stream(); - } else if (blob.arrayBuffer) { - yield await blob.arrayBuffer(); - } else if (blob[asyncIterator]) { - yield* blob[asyncIterator](); - } else { - yield blob; - } -}; -var readBlob_default = readBlob; - -// node_modules/axios/lib/helpers/formDataToStream.js -var BOUNDARY_ALPHABET = platform_default.ALPHABET.ALPHA_DIGIT + "-_"; -var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new import_util.default.TextEncoder(); -var CRLF = "\r\n"; -var CRLF_BYTES = textEncoder.encode(CRLF); -var CRLF_BYTES_COUNT = 2; -var FormDataPart = class { - constructor(name, value) { - const { escapeName } = this.constructor; - const isStringValue = utils_default.isString(value); - let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`; - if (isStringValue) { - value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); - } else { - headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`; - } - this.headers = textEncoder.encode(headers + CRLF); - this.contentLength = isStringValue ? value.byteLength : value.size; - this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; - this.name = name; - this.value = value; - } - async *encode() { - yield this.headers; - const { value } = this; - if (utils_default.isTypedArray(value)) { - yield value; - } else { - yield* readBlob_default(value); - } - yield CRLF_BYTES; - } - static escapeName(name) { - return String(name).replace(/[\r\n"]/g, (match) => ({ - "\r": "%0D", - "\n": "%0A", - '"': "%22" - })[match]); - } -}; -var formDataToStream = (form, headersHandler, options) => { - const { - tag = "form-data-boundary", - size = 25, - boundary = tag + "-" + platform_default.generateString(size, BOUNDARY_ALPHABET) - } = options || {}; - if (!utils_default.isFormData(form)) { - throw TypeError("FormData instance required"); - } - if (boundary.length < 1 || boundary.length > 70) { - throw Error("boundary must be 10-70 characters long"); - } - const boundaryBytes = textEncoder.encode("--" + boundary + CRLF); - const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF + CRLF); - let contentLength = footerBytes.byteLength; - const parts = Array.from(form.entries()).map(([name, value]) => { - const part = new FormDataPart(name, value); - contentLength += part.size; - return part; - }); - contentLength += boundaryBytes.byteLength * parts.length; - contentLength = utils_default.toFiniteNumber(contentLength); - const computedHeaders = { - "Content-Type": `multipart/form-data; boundary=${boundary}` - }; - if (Number.isFinite(contentLength)) { - computedHeaders["Content-Length"] = contentLength; - } - headersHandler && headersHandler(computedHeaders); - return import_stream2.Readable.from(async function* () { - for (const part of parts) { - yield boundaryBytes; - yield* part.encode(); - } - yield footerBytes; - }()); -}; -var formDataToStream_default = formDataToStream; - -// node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js -var import_stream3 = __toESM(require("stream"), 1); -var ZlibHeaderTransformStream = class extends import_stream3.default.Transform { - __transform(chunk, encoding, callback) { - this.push(chunk); - callback(); - } - _transform(chunk, encoding, callback) { - if (chunk.length !== 0) { - this._transform = this.__transform; - if (chunk[0] !== 120) { - const header = Buffer.alloc(2); - header[0] = 120; - header[1] = 156; - this.push(header, encoding); - } - } - this.__transform(chunk, encoding, callback); - } -}; -var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream; - -// node_modules/axios/lib/helpers/callbackify.js -var callbackify = (fn, reducer) => { - return utils_default.isAsyncFn(fn) ? function(...args) { - const cb = args.pop(); - fn.apply(this, args).then((value) => { - try { - reducer ? cb(null, ...reducer(value)) : cb(null, value); - } catch (err) { - cb(err); - } - }, cb); - } : fn; -}; -var callbackify_default = callbackify; - -// node_modules/axios/lib/helpers/speedometer.js -function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - const bytes = new Array(samplesCount); - const timestamps = new Array(samplesCount); - let head = 0; - let tail = 0; - let firstSampleTS; - min = min !== void 0 ? min : 1e3; - return function push(chunkLength) { - const now = Date.now(); - const startedAt = timestamps[tail]; - if (!firstSampleTS) { - firstSampleTS = now; - } - bytes[head] = chunkLength; - timestamps[head] = now; - let i = tail; - let bytesCount = 0; - while (i !== head) { - bytesCount += bytes[i++]; - i = i % samplesCount; - } - head = (head + 1) % samplesCount; - if (head === tail) { - tail = (tail + 1) % samplesCount; - } - if (now - firstSampleTS < min) { - return; - } - const passed = startedAt && now - startedAt; - return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; - }; -} -var speedometer_default = speedometer; - -// node_modules/axios/lib/helpers/throttle.js -function throttle(fn, freq) { - let timestamp = 0; - let threshold = 1e3 / freq; - let lastArgs; - let timer; - const invoke = (args, now = Date.now()) => { - timestamp = now; - lastArgs = null; - if (timer) { - clearTimeout(timer); - timer = null; - } - fn.apply(null, args); - }; - const throttled = (...args) => { - const now = Date.now(); - const passed = now - timestamp; - if (passed >= threshold) { - invoke(args, now); - } else { - lastArgs = args; - if (!timer) { - timer = setTimeout(() => { - timer = null; - invoke(lastArgs); - }, threshold - passed); - } - } - }; - const flush = () => lastArgs && invoke(lastArgs); - return [throttled, flush]; -} -var throttle_default = throttle; - -// node_modules/axios/lib/helpers/progressEventReducer.js -var progressEventReducer = (listener, isDownloadStream, freq = 3) => { - let bytesNotified = 0; - const _speedometer = speedometer_default(50, 250); - return throttle_default((e) => { - const loaded = e.loaded; - const total = e.lengthComputable ? e.total : void 0; - const progressBytes = loaded - bytesNotified; - const rate = _speedometer(progressBytes); - const inRange = loaded <= total; - bytesNotified = loaded; - const data = { - loaded, - total, - progress: total ? loaded / total : void 0, - bytes: progressBytes, - rate: rate ? rate : void 0, - estimated: rate && total && inRange ? (total - loaded) / rate : void 0, - event: e, - lengthComputable: total != null, - [isDownloadStream ? "download" : "upload"]: true - }; - listener(data); - }, freq); -}; -var progressEventDecorator = (total, throttled) => { - const lengthComputable = total != null; - return [(loaded) => throttled[0]({ - lengthComputable, - total, - loaded - }), throttled[1]]; -}; -var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args)); - -// node_modules/axios/lib/adapters/http.js -var zlibOptions = { - flush: import_zlib.default.constants.Z_SYNC_FLUSH, - finishFlush: import_zlib.default.constants.Z_SYNC_FLUSH -}; -var brotliOptions = { - flush: import_zlib.default.constants.BROTLI_OPERATION_FLUSH, - finishFlush: import_zlib.default.constants.BROTLI_OPERATION_FLUSH -}; -var isBrotliSupported = utils_default.isFunction(import_zlib.default.createBrotliDecompress); -var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default; -var isHttps = /https:?/; -var supportedProtocols = platform_default.protocols.map((protocol) => { - return protocol + ":"; -}); -var flushOnFinish = (stream4, [throttled, flush]) => { - stream4.on("end", flush).on("error", flush); - return throttled; -}; -function dispatchBeforeRedirect(options, responseDetails) { - if (options.beforeRedirects.proxy) { - options.beforeRedirects.proxy(options); - } - if (options.beforeRedirects.config) { - options.beforeRedirects.config(options, responseDetails); - } -} -function setProxy(options, configProxy, location) { - let proxy = configProxy; - if (!proxy && proxy !== false) { - const proxyUrl = import_proxy_from_env.default.getProxyForUrl(location); - if (proxyUrl) { - proxy = new URL(proxyUrl); - } - } - if (proxy) { - if (proxy.username) { - proxy.auth = (proxy.username || "") + ":" + (proxy.password || ""); - } - if (proxy.auth) { - if (proxy.auth.username || proxy.auth.password) { - proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || ""); - } - const base64 = Buffer.from(proxy.auth, "utf8").toString("base64"); - options.headers["Proxy-Authorization"] = "Basic " + base64; - } - options.headers.host = options.hostname + (options.port ? ":" + options.port : ""); - const proxyHost = proxy.hostname || proxy.host; - options.hostname = proxyHost; - options.host = proxyHost; - options.port = proxy.port; - options.path = location; - if (proxy.protocol) { - options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`; - } - } - options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { - setProxy(redirectOptions, configProxy, redirectOptions.href); - }; -} -var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process"; -var wrapAsync = (asyncExecutor) => { - return new Promise((resolve, reject) => { - let onDone; - let isDone; - const done = (value, isRejected) => { - if (isDone) return; - isDone = true; - onDone && onDone(value, isRejected); - }; - const _resolve = (value) => { - done(value); - resolve(value); - }; - const _reject = (reason) => { - done(reason, true); - reject(reason); - }; - asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject); - }); -}; -var resolveFamily = ({ address, family }) => { - if (!utils_default.isString(address)) { - throw TypeError("address must be a string"); - } - return { - address, - family: family || (address.indexOf(".") < 0 ? 6 : 4) - }; -}; -var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family }); -var http_default = isHttpAdapterSupported && function httpAdapter(config) { - return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { - let { data, lookup, family } = config; - const { responseType, responseEncoding } = config; - const method = config.method.toUpperCase(); - let isDone; - let rejected = false; - let req; - if (lookup) { - const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]); - lookup = (hostname, opt, cb) => { - _lookup(hostname, opt, (err, arg0, arg1) => { - if (err) { - return cb(err); - } - const addresses = utils_default.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; - opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); - }); - }; - } - const emitter = new import_events.EventEmitter(); - const onFinished = () => { - if (config.cancelToken) { - config.cancelToken.unsubscribe(abort); - } - if (config.signal) { - config.signal.removeEventListener("abort", abort); - } - emitter.removeAllListeners(); - }; - onDone((value, isRejected) => { - isDone = true; - if (isRejected) { - rejected = true; - onFinished(); - } - }); - function abort(reason) { - emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason); - } - emitter.once("abort", reject); - if (config.cancelToken || config.signal) { - config.cancelToken && config.cancelToken.subscribe(abort); - if (config.signal) { - config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort); - } - } - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); - const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0); - const protocol = parsed.protocol || supportedProtocols[0]; - if (protocol === "data:") { - let convertedData; - if (method !== "GET") { - return settle(resolve, reject, { - status: 405, - statusText: "method not allowed", - headers: {}, - config - }); - } - try { - convertedData = fromDataURI(config.url, responseType === "blob", { - Blob: config.env && config.env.Blob - }); - } catch (err) { - throw AxiosError_default.from(err, AxiosError_default.ERR_BAD_REQUEST, config); - } - if (responseType === "text") { - convertedData = convertedData.toString(responseEncoding); - if (!responseEncoding || responseEncoding === "utf8") { - convertedData = utils_default.stripBOM(convertedData); - } - } else if (responseType === "stream") { - convertedData = import_stream4.default.Readable.from(convertedData); - } - return settle(resolve, reject, { - data: convertedData, - status: 200, - statusText: "OK", - headers: new AxiosHeaders_default(), - config - }); - } - if (supportedProtocols.indexOf(protocol) === -1) { - return reject(new AxiosError_default( - "Unsupported protocol " + protocol, - AxiosError_default.ERR_BAD_REQUEST, - config - )); - } - const headers = AxiosHeaders_default.from(config.headers).normalize(); - headers.set("User-Agent", "axios/" + VERSION, false); - const { onUploadProgress, onDownloadProgress } = config; - const maxRate = config.maxRate; - let maxUploadRate = void 0; - let maxDownloadRate = void 0; - if (utils_default.isSpecCompliantForm(data)) { - const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); - data = formDataToStream_default(data, (formHeaders) => { - headers.set(formHeaders); - }, { - tag: `axios-${VERSION}-boundary`, - boundary: userBoundary && userBoundary[1] || void 0 - }); - } else if (utils_default.isFormData(data) && utils_default.isFunction(data.getHeaders)) { - headers.set(data.getHeaders()); - if (!headers.hasContentLength()) { - try { - const knownLength = await import_util2.default.promisify(data.getLength).call(data); - Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); - } catch (e) { - } - } - } else if (utils_default.isBlob(data) || utils_default.isFile(data)) { - data.size && headers.setContentType(data.type || "application/octet-stream"); - headers.setContentLength(data.size || 0); - data = import_stream4.default.Readable.from(readBlob_default(data)); - } else if (data && !utils_default.isStream(data)) { - if (Buffer.isBuffer(data)) { - } else if (utils_default.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils_default.isString(data)) { - data = Buffer.from(data, "utf-8"); - } else { - return reject(new AxiosError_default( - "Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", - AxiosError_default.ERR_BAD_REQUEST, - config - )); - } - headers.setContentLength(data.length, false); - if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { - return reject(new AxiosError_default( - "Request body larger than maxBodyLength limit", - AxiosError_default.ERR_BAD_REQUEST, - config - )); - } - } - const contentLength = utils_default.toFiniteNumber(headers.getContentLength()); - if (utils_default.isArray(maxRate)) { - maxUploadRate = maxRate[0]; - maxDownloadRate = maxRate[1]; - } else { - maxUploadRate = maxDownloadRate = maxRate; - } - if (data && (onUploadProgress || maxUploadRate)) { - if (!utils_default.isStream(data)) { - data = import_stream4.default.Readable.from(data, { objectMode: false }); - } - data = import_stream4.default.pipeline([data, new AxiosTransformStream_default({ - maxRate: utils_default.toFiniteNumber(maxUploadRate) - })], utils_default.noop); - onUploadProgress && data.on("progress", flushOnFinish( - data, - progressEventDecorator( - contentLength, - progressEventReducer(asyncDecorator(onUploadProgress), false, 3) - ) - )); - } - let auth = void 0; - if (config.auth) { - const username = config.auth.username || ""; - const password = config.auth.password || ""; - auth = username + ":" + password; - } - if (!auth && parsed.username) { - const urlUsername = parsed.username; - const urlPassword = parsed.password; - auth = urlUsername + ":" + urlPassword; - } - auth && headers.delete("authorization"); - let path; - try { - path = buildURL( - parsed.pathname + parsed.search, - config.params, - config.paramsSerializer - ).replace(/^\?/, ""); - } catch (err) { - const customErr = new Error(err.message); - customErr.config = config; - customErr.url = config.url; - customErr.exists = true; - return reject(customErr); - } - headers.set( - "Accept-Encoding", - "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), - false - ); - const options = { - path, - method, - headers: headers.toJSON(), - agents: { http: config.httpAgent, https: config.httpsAgent }, - auth, - protocol, - family, - beforeRedirect: dispatchBeforeRedirect, - beforeRedirects: {} - }; - !utils_default.isUndefined(lookup) && (options.lookup = lookup); - if (config.socketPath) { - options.socketPath = config.socketPath; - } else { - options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; - options.port = parsed.port; - setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path); - } - let transport; - const isHttpsRequest = isHttps.test(options.protocol); - options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; - if (config.transport) { - transport = config.transport; - } else if (config.maxRedirects === 0) { - transport = isHttpsRequest ? import_https.default : import_http.default; - } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; - } - if (config.beforeRedirect) { - options.beforeRedirects.config = config.beforeRedirect; - } - transport = isHttpsRequest ? httpsFollow : httpFollow; - } - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; - } else { - options.maxBodyLength = Infinity; - } - if (config.insecureHTTPParser) { - options.insecureHTTPParser = config.insecureHTTPParser; - } - req = transport.request(options, function handleResponse(res) { - if (req.destroyed) return; - const streams = [res]; - const responseLength = +res.headers["content-length"]; - if (onDownloadProgress || maxDownloadRate) { - const transformStream = new AxiosTransformStream_default({ - maxRate: utils_default.toFiniteNumber(maxDownloadRate) - }); - onDownloadProgress && transformStream.on("progress", flushOnFinish( - transformStream, - progressEventDecorator( - responseLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) - ) - )); - streams.push(transformStream); - } - let responseStream = res; - const lastRequest = res.req || req; - if (config.decompress !== false && res.headers["content-encoding"]) { - if (method === "HEAD" || res.statusCode === 204) { - delete res.headers["content-encoding"]; - } - switch ((res.headers["content-encoding"] || "").toLowerCase()) { - /*eslint default-case:0*/ - case "gzip": - case "x-gzip": - case "compress": - case "x-compress": - streams.push(import_zlib.default.createUnzip(zlibOptions)); - delete res.headers["content-encoding"]; - break; - case "deflate": - streams.push(new ZlibHeaderTransformStream_default()); - streams.push(import_zlib.default.createUnzip(zlibOptions)); - delete res.headers["content-encoding"]; - break; - case "br": - if (isBrotliSupported) { - streams.push(import_zlib.default.createBrotliDecompress(brotliOptions)); - delete res.headers["content-encoding"]; - } - } - } - responseStream = streams.length > 1 ? import_stream4.default.pipeline(streams, utils_default.noop) : streams[0]; - const offListeners = import_stream4.default.finished(responseStream, () => { - offListeners(); - onFinished(); - }); - const response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: new AxiosHeaders_default(res.headers), - config, - request: lastRequest - }; - if (responseType === "stream") { - response.data = responseStream; - settle(resolve, reject, response); - } else { - const responseBuffer = []; - let totalResponseBytes = 0; - responseStream.on("data", function handleStreamData(chunk) { - responseBuffer.push(chunk); - totalResponseBytes += chunk.length; - if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { - rejected = true; - responseStream.destroy(); - reject(new AxiosError_default( - "maxContentLength size of " + config.maxContentLength + " exceeded", - AxiosError_default.ERR_BAD_RESPONSE, - config, - lastRequest - )); - } - }); - responseStream.on("aborted", function handlerStreamAborted() { - if (rejected) { - return; - } - const err = new AxiosError_default( - "stream has been aborted", - AxiosError_default.ERR_BAD_RESPONSE, - config, - lastRequest - ); - responseStream.destroy(err); - reject(err); - }); - responseStream.on("error", function handleStreamError(err) { - if (req.destroyed) return; - reject(AxiosError_default.from(err, null, config, lastRequest)); - }); - responseStream.on("end", function handleStreamEnd() { - try { - let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); - if (responseType !== "arraybuffer") { - responseData = responseData.toString(responseEncoding); - if (!responseEncoding || responseEncoding === "utf8") { - responseData = utils_default.stripBOM(responseData); - } - } - response.data = responseData; - } catch (err) { - return reject(AxiosError_default.from(err, null, config, response.request, response)); - } - settle(resolve, reject, response); - }); - } - emitter.once("abort", (err) => { - if (!responseStream.destroyed) { - responseStream.emit("error", err); - responseStream.destroy(); - } - }); - }); - emitter.once("abort", (err) => { - reject(err); - req.destroy(err); - }); - req.on("error", function handleRequestError(err) { - reject(AxiosError_default.from(err, null, config, req)); - }); - req.on("socket", function handleRequestSocket(socket) { - socket.setKeepAlive(true, 1e3 * 60); - }); - if (config.timeout) { - const timeout = parseInt(config.timeout, 10); - if (Number.isNaN(timeout)) { - reject(new AxiosError_default( - "error trying to parse `config.timeout` to int", - AxiosError_default.ERR_BAD_OPTION_VALUE, - config, - req - )); - return; - } - req.setTimeout(timeout, function handleRequestTimeout() { - if (isDone) return; - let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded"; - const transitional2 = config.transitional || transitional_default; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - reject(new AxiosError_default( - timeoutErrorMessage, - transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED, - config, - req - )); - abort(); - }); - } - if (utils_default.isStream(data)) { - let ended = false; - let errored = false; - data.on("end", () => { - ended = true; - }); - data.once("error", (err) => { - errored = true; - req.destroy(err); - }); - data.on("close", () => { - if (!ended && !errored) { - abort(new CanceledError_default("Request stream has been aborted", config, req)); - } - }); - data.pipe(req); - } else { - req.end(data); - } - }); -}; - -// node_modules/axios/lib/helpers/isURLSameOrigin.js -var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => { - url2 = new URL(url2, platform_default.origin); - return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port); -})( - new URL(platform_default.origin), - platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent) -) : () => true; - -// node_modules/axios/lib/helpers/cookies.js -var cookies_default = platform_default.hasStandardBrowserEnv ? ( - // Standard browser envs support document.cookie - { - write(name, value, expires, path, domain, secure) { - const cookie = [name + "=" + encodeURIComponent(value)]; - utils_default.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString()); - utils_default.isString(path) && cookie.push("path=" + path); - utils_default.isString(domain) && cookie.push("domain=" + domain); - secure === true && cookie.push("secure"); - document.cookie = cookie.join("; "); - }, - read(name) { - const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)")); - return match ? decodeURIComponent(match[3]) : null; - }, - remove(name) { - this.write(name, "", Date.now() - 864e5); - } - } -) : ( - // Non-standard browser env (web workers, react-native) lack needed support. - { - write() { - }, - read() { - return null; - }, - remove() { - } - } -); - -// node_modules/axios/lib/core/mergeConfig.js -var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing; -function mergeConfig(config1, config2) { - config2 = config2 || {}; - const config = {}; - function getMergedValue(target, source, prop, caseless) { - if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) { - return utils_default.merge.call({ caseless }, target, source); - } else if (utils_default.isPlainObject(source)) { - return utils_default.merge({}, source); - } else if (utils_default.isArray(source)) { - return source.slice(); - } - return source; - } - function mergeDeepProperties(a, b, prop, caseless) { - if (!utils_default.isUndefined(b)) { - return getMergedValue(a, b, prop, caseless); - } else if (!utils_default.isUndefined(a)) { - return getMergedValue(void 0, a, prop, caseless); - } - } - function valueFromConfig2(a, b) { - if (!utils_default.isUndefined(b)) { - return getMergedValue(void 0, b); - } - } - function defaultToConfig2(a, b) { - if (!utils_default.isUndefined(b)) { - return getMergedValue(void 0, b); - } else if (!utils_default.isUndefined(a)) { - return getMergedValue(void 0, a); - } - } - function mergeDirectKeys(a, b, prop) { - if (prop in config2) { - return getMergedValue(a, b); - } else if (prop in config1) { - return getMergedValue(void 0, a); - } - } - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) - }; - utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { - const merge2 = mergeMap[prop] || mergeDeepProperties; - const configValue = merge2(config1[prop], config2[prop], prop); - utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue); - }); - return config; -} - -// node_modules/axios/lib/helpers/resolveConfig.js -var resolveConfig_default = (config) => { - const newConfig = mergeConfig({}, config); - let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; - newConfig.headers = headers = AxiosHeaders_default.from(headers); - newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); - if (auth) { - headers.set( - "Authorization", - "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")) - ); - } - let contentType; - if (utils_default.isFormData(data)) { - if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) { - headers.setContentType(void 0); - } else if ((contentType = headers.getContentType()) !== false) { - const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : []; - headers.setContentType([type || "multipart/form-data", ...tokens].join("; ")); - } - } - if (platform_default.hasStandardBrowserEnv) { - withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); - if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) { - const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName); - if (xsrfValue) { - headers.set(xsrfHeaderName, xsrfValue); - } - } - } - return newConfig; -}; - -// node_modules/axios/lib/adapters/xhr.js -var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; -var xhr_default = isXHRAdapterSupported && function(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - const _config = resolveConfig_default(config); - let requestData = _config.data; - const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize(); - let { responseType, onUploadProgress, onDownloadProgress } = _config; - let onCanceled; - let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; - function done() { - flushUpload && flushUpload(); - flushDownload && flushDownload(); - _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); - _config.signal && _config.signal.removeEventListener("abort", onCanceled); - } - let request = new XMLHttpRequest(); - request.open(_config.method.toUpperCase(), _config.url, true); - request.timeout = _config.timeout; - function onloadend() { - if (!request) { - return; - } - const responseHeaders = AxiosHeaders_default.from( - "getAllResponseHeaders" in request && request.getAllResponseHeaders() - ); - const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; - const response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config, - request - }; - settle(function _resolve(value) { - resolve(value); - done(); - }, function _reject(err) { - reject(err); - done(); - }, response); - request = null; - } - if ("onloadend" in request) { - request.onloadend = onloadend; - } else { - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { - return; - } - setTimeout(onloadend); - }; - } - request.onabort = function handleAbort() { - if (!request) { - return; - } - reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request)); - request = null; - }; - request.onerror = function handleError() { - reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request)); - request = null; - }; - request.ontimeout = function handleTimeout() { - let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; - const transitional2 = _config.transitional || transitional_default; - if (_config.timeoutErrorMessage) { - timeoutErrorMessage = _config.timeoutErrorMessage; - } - reject(new AxiosError_default( - timeoutErrorMessage, - transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED, - config, - request - )); - request = null; - }; - requestData === void 0 && requestHeaders.setContentType(null); - if ("setRequestHeader" in request) { - utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { - request.setRequestHeader(key, val); - }); - } - if (!utils_default.isUndefined(_config.withCredentials)) { - request.withCredentials = !!_config.withCredentials; - } - if (responseType && responseType !== "json") { - request.responseType = _config.responseType; - } - if (onDownloadProgress) { - [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); - request.addEventListener("progress", downloadThrottled); - } - if (onUploadProgress && request.upload) { - [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); - request.upload.addEventListener("progress", uploadThrottled); - request.upload.addEventListener("loadend", flushUpload); - } - if (_config.cancelToken || _config.signal) { - onCanceled = (cancel) => { - if (!request) { - return; - } - reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel); - request.abort(); - request = null; - }; - _config.cancelToken && _config.cancelToken.subscribe(onCanceled); - if (_config.signal) { - _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); - } - } - const protocol = parseProtocol(_config.url); - if (protocol && platform_default.protocols.indexOf(protocol) === -1) { - reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config)); - return; - } - request.send(requestData || null); - }); -}; - -// node_modules/axios/lib/helpers/composeSignals.js -var composeSignals = (signals, timeout) => { - const { length } = signals = signals ? signals.filter(Boolean) : []; - if (timeout || length) { - let controller = new AbortController(); - let aborted; - const onabort = function(reason) { - if (!aborted) { - aborted = true; - unsubscribe(); - const err = reason instanceof Error ? reason : this.reason; - controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err)); - } - }; - let timer = timeout && setTimeout(() => { - timer = null; - onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT)); - }, timeout); - const unsubscribe = () => { - if (signals) { - timer && clearTimeout(timer); - timer = null; - signals.forEach((signal2) => { - signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort); - }); - signals = null; - } - }; - signals.forEach((signal2) => signal2.addEventListener("abort", onabort)); - const { signal } = controller; - signal.unsubscribe = () => utils_default.asap(unsubscribe); - return signal; - } -}; -var composeSignals_default = composeSignals; - -// node_modules/axios/lib/helpers/trackStream.js -var streamChunk = function* (chunk, chunkSize) { - let len = chunk.byteLength; - if (!chunkSize || len < chunkSize) { - yield chunk; - return; - } - let pos = 0; - let end; - while (pos < len) { - end = pos + chunkSize; - yield chunk.slice(pos, end); - pos = end; - } -}; -var readBytes = async function* (iterable, chunkSize) { - for await (const chunk of readStream(iterable)) { - yield* streamChunk(chunk, chunkSize); - } -}; -var readStream = async function* (stream4) { - if (stream4[Symbol.asyncIterator]) { - yield* stream4; - return; - } - const reader = stream4.getReader(); - try { - for (; ; ) { - const { done, value } = await reader.read(); - if (done) { - break; - } - yield value; - } - } finally { - await reader.cancel(); - } -}; -var trackStream = (stream4, chunkSize, onProgress, onFinish) => { - const iterator = readBytes(stream4, chunkSize); - let bytes = 0; - let done; - let _onFinish = (e) => { - if (!done) { - done = true; - onFinish && onFinish(e); - } - }; - return new ReadableStream({ - async pull(controller) { - try { - const { done: done2, value } = await iterator.next(); - if (done2) { - _onFinish(); - controller.close(); - return; - } - let len = value.byteLength; - if (onProgress) { - let loadedBytes = bytes += len; - onProgress(loadedBytes); - } - controller.enqueue(new Uint8Array(value)); - } catch (err) { - _onFinish(err); - throw err; - } - }, - cancel(reason) { - _onFinish(reason); - return iterator.return(); - } - }, { - highWaterMark: 2 - }); -}; - -// node_modules/axios/lib/adapters/fetch.js -var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function"; -var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function"; -var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer())); -var test = (fn, ...args) => { - try { - return !!fn(...args); - } catch (e) { - return false; - } -}; -var supportsRequestStream = isReadableStreamSupported && test(() => { - let duplexAccessed = false; - const hasContentType = new Request(platform_default.origin, { - body: new ReadableStream(), - method: "POST", - get duplex() { - duplexAccessed = true; - return "half"; - } - }).headers.has("Content-Type"); - return duplexAccessed && !hasContentType; -}); -var DEFAULT_CHUNK_SIZE = 64 * 1024; -var supportsResponseStream = isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body)); -var resolvers = { - stream: supportsResponseStream && ((res) => res.body) -}; -isFetchSupported && ((res) => { - ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => { - !resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => { - throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config); - }); - }); -})(new Response()); -var getBodyLength = async (body) => { - if (body == null) { - return 0; - } - if (utils_default.isBlob(body)) { - return body.size; - } - if (utils_default.isSpecCompliantForm(body)) { - const _request = new Request(platform_default.origin, { - method: "POST", - body - }); - return (await _request.arrayBuffer()).byteLength; - } - if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) { - return body.byteLength; - } - if (utils_default.isURLSearchParams(body)) { - body = body + ""; - } - if (utils_default.isString(body)) { - return (await encodeText(body)).byteLength; - } -}; -var resolveBodyLength = async (headers, body) => { - const length = utils_default.toFiniteNumber(headers.getContentLength()); - return length == null ? getBodyLength(body) : length; -}; -var fetch_default = isFetchSupported && (async (config) => { - let { - url: url2, - method, - data, - signal, - cancelToken, - timeout, - onDownloadProgress, - onUploadProgress, - responseType, - headers, - withCredentials = "same-origin", - fetchOptions - } = resolveConfig_default(config); - responseType = responseType ? (responseType + "").toLowerCase() : "text"; - let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout); - let request; - const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { - composedSignal.unsubscribe(); - }); - let requestContentLength; - try { - if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) { - let _request = new Request(url2, { - method: "POST", - body: data, - duplex: "half" - }); - let contentTypeHeader; - if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { - headers.setContentType(contentTypeHeader); - } - if (_request.body) { - const [onProgress, flush] = progressEventDecorator( - requestContentLength, - progressEventReducer(asyncDecorator(onUploadProgress)) - ); - data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); - } - } - if (!utils_default.isString(withCredentials)) { - withCredentials = withCredentials ? "include" : "omit"; - } - const isCredentialsSupported = "credentials" in Request.prototype; - request = new Request(url2, { - ...fetchOptions, - signal: composedSignal, - method: method.toUpperCase(), - headers: headers.normalize().toJSON(), - body: data, - duplex: "half", - credentials: isCredentialsSupported ? withCredentials : void 0 - }); - let response = await fetch(request); - const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); - if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { - const options = {}; - ["status", "statusText", "headers"].forEach((prop) => { - options[prop] = response[prop]; - }); - const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length")); - const [onProgress, flush] = onDownloadProgress && progressEventDecorator( - responseContentLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true) - ) || []; - response = new Response( - trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { - flush && flush(); - unsubscribe && unsubscribe(); - }), - options - ); - } - responseType = responseType || "text"; - let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config); - !isStreamResponse && unsubscribe && unsubscribe(); - return await new Promise((resolve, reject) => { - settle(resolve, reject, { - data: responseData, - headers: AxiosHeaders_default.from(response.headers), - status: response.status, - statusText: response.statusText, - config, - request - }); - }); - } catch (err) { - unsubscribe && unsubscribe(); - if (err && err.name === "TypeError" && /fetch/i.test(err.message)) { - throw Object.assign( - new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request), - { - cause: err.cause || err - } - ); - } - throw AxiosError_default.from(err, err && err.code, config, request); - } -}); - -// node_modules/axios/lib/adapters/adapters.js -var knownAdapters = { - http: http_default, - xhr: xhr_default, - fetch: fetch_default -}; -utils_default.forEach(knownAdapters, (fn, value) => { - if (fn) { - try { - Object.defineProperty(fn, "name", { value }); - } catch (e) { - } - Object.defineProperty(fn, "adapterName", { value }); - } -}); -var renderReason = (reason) => `- ${reason}`; -var isResolvedHandle = (adapter) => utils_default.isFunction(adapter) || adapter === null || adapter === false; -var adapters_default = { - getAdapter: (adapters) => { - adapters = utils_default.isArray(adapters) ? adapters : [adapters]; - const { length } = adapters; - let nameOrAdapter; - let adapter; - const rejectedReasons = {}; - for (let i = 0; i < length; i++) { - nameOrAdapter = adapters[i]; - let id; - adapter = nameOrAdapter; - if (!isResolvedHandle(nameOrAdapter)) { - adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; - if (adapter === void 0) { - throw new AxiosError_default(`Unknown adapter '${id}'`); - } - } - if (adapter) { - break; - } - rejectedReasons[id || "#" + i] = adapter; - } - if (!adapter) { - const reasons = Object.entries(rejectedReasons).map( - ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build") - ); - let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; - throw new AxiosError_default( - `There is no suitable adapter to dispatch the request ` + s, - "ERR_NOT_SUPPORT" - ); - } - return adapter; - }, - adapters: knownAdapters -}; - -// node_modules/axios/lib/core/dispatchRequest.js -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } - if (config.signal && config.signal.aborted) { - throw new CanceledError_default(null, config); - } -} -function dispatchRequest(config) { - throwIfCancellationRequested(config); - config.headers = AxiosHeaders_default.from(config.headers); - config.data = transformData.call( - config, - config.transformRequest - ); - if (["post", "put", "patch"].indexOf(config.method) !== -1) { - config.headers.setContentType("application/x-www-form-urlencoded", false); - } - const adapter = adapters_default.getAdapter(config.adapter || defaults_default.adapter); - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - response.data = transformData.call( - config, - config.transformResponse, - response - ); - response.headers = AxiosHeaders_default.from(response.headers); - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - if (reason && reason.response) { - reason.response.data = transformData.call( - config, - config.transformResponse, - reason.response - ); - reason.response.headers = AxiosHeaders_default.from(reason.response.headers); - } - } - return Promise.reject(reason); - }); -} - -// node_modules/axios/lib/helpers/validator.js -var validators = {}; -["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => { - validators[type] = function validator(thing) { - return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type; - }; -}); -var deprecatedWarnings = {}; -validators.transitional = function transitional(validator, version, message) { - function formatMessage(opt, desc) { - return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : ""); - } - return (value, opt, opts) => { - if (validator === false) { - throw new AxiosError_default( - formatMessage(opt, " has been removed" + (version ? " in " + version : "")), - AxiosError_default.ERR_DEPRECATED - ); - } - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - console.warn( - formatMessage( - opt, - " has been deprecated since v" + version + " and will be removed in the near future" - ) - ); - } - return validator ? validator(value, opt, opts) : true; - }; -}; -validators.spelling = function spelling(correctSpelling) { - return (value, opt) => { - console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); - return true; - }; -}; -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== "object") { - throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE); - } - const keys = Object.keys(options); - let i = keys.length; - while (i-- > 0) { - const opt = keys[i]; - const validator = schema[opt]; - if (validator) { - const value = options[opt]; - const result = value === void 0 || validator(value, opt, options); - if (result !== true) { - throw new AxiosError_default("option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE); - } - continue; - } - if (allowUnknown !== true) { - throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION); - } - } -} -var validator_default = { - assertOptions, - validators -}; - -// node_modules/axios/lib/core/Axios.js -var validators2 = validator_default.validators; -var Axios = class { - constructor(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager_default(), - response: new InterceptorManager_default() - }; - } - /** - * Dispatch a request - * - * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) - * @param {?Object} config - * - * @returns {Promise} The Promise to be fulfilled - */ - async request(configOrUrl, config) { - try { - return await this._request(configOrUrl, config); - } catch (err) { - if (err instanceof Error) { - let dummy = {}; - Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); - const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; - try { - if (!err.stack) { - err.stack = stack; - } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { - err.stack += "\n" + stack; - } - } catch (e) { - } - } - throw err; - } - } - _request(configOrUrl, config) { - if (typeof configOrUrl === "string") { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; - } - config = mergeConfig(this.defaults, config); - const { transitional: transitional2, paramsSerializer, headers } = config; - if (transitional2 !== void 0) { - validator_default.assertOptions(transitional2, { - silentJSONParsing: validators2.transitional(validators2.boolean), - forcedJSONParsing: validators2.transitional(validators2.boolean), - clarifyTimeoutError: validators2.transitional(validators2.boolean) - }, false); - } - if (paramsSerializer != null) { - if (utils_default.isFunction(paramsSerializer)) { - config.paramsSerializer = { - serialize: paramsSerializer - }; - } else { - validator_default.assertOptions(paramsSerializer, { - encode: validators2.function, - serialize: validators2.function - }, true); - } - } - if (config.allowAbsoluteUrls !== void 0) { - } else if (this.defaults.allowAbsoluteUrls !== void 0) { - config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; - } else { - config.allowAbsoluteUrls = true; - } - validator_default.assertOptions(config, { - baseUrl: validators2.spelling("baseURL"), - withXsrfToken: validators2.spelling("withXSRFToken") - }, true); - config.method = (config.method || this.defaults.method || "get").toLowerCase(); - let contextHeaders = headers && utils_default.merge( - headers.common, - headers[config.method] - ); - headers && utils_default.forEach( - ["delete", "get", "head", "post", "put", "patch", "common"], - (method) => { - delete headers[method]; - } - ); - config.headers = AxiosHeaders_default.concat(contextHeaders, headers); - const requestInterceptorChain = []; - let synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) { - return; - } - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - const responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - let promise; - let i = 0; - let len; - if (!synchronousRequestInterceptors) { - const chain = [dispatchRequest.bind(this), void 0]; - chain.unshift.apply(chain, requestInterceptorChain); - chain.push.apply(chain, responseInterceptorChain); - len = chain.length; - promise = Promise.resolve(config); - while (i < len) { - promise = promise.then(chain[i++], chain[i++]); - } - return promise; - } - len = requestInterceptorChain.length; - let newConfig = config; - i = 0; - while (i < len) { - const onFulfilled = requestInterceptorChain[i++]; - const onRejected = requestInterceptorChain[i++]; - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected.call(this, error); - break; - } - } - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error) { - return Promise.reject(error); - } - i = 0; - len = responseInterceptorChain.length; - while (i < len) { - promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); - } - return promise; - } - getUri(config) { - config = mergeConfig(this.defaults, config); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); - return buildURL(fullPath, config.params, config.paramsSerializer); - } -}; -utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) { - Axios.prototype[method] = function(url2, config) { - return this.request(mergeConfig(config || {}, { - method, - url: url2, - data: (config || {}).data - })); - }; -}); -utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { - function generateHTTPMethod(isForm) { - return function httpMethod(url2, data, config) { - return this.request(mergeConfig(config || {}, { - method, - headers: isForm ? { - "Content-Type": "multipart/form-data" - } : {}, - url: url2, - data - })); - }; - } - Axios.prototype[method] = generateHTTPMethod(); - Axios.prototype[method + "Form"] = generateHTTPMethod(true); -}); -var Axios_default = Axios; - -// node_modules/axios/lib/cancel/CancelToken.js -var CancelToken = class _CancelToken { - constructor(executor) { - if (typeof executor !== "function") { - throw new TypeError("executor must be a function."); - } - let resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - const token = this; - this.promise.then((cancel) => { - if (!token._listeners) return; - let i = token._listeners.length; - while (i-- > 0) { - token._listeners[i](cancel); - } - token._listeners = null; - }); - this.promise.then = (onfulfilled) => { - let _resolve; - const promise = new Promise((resolve) => { - token.subscribe(resolve); - _resolve = resolve; - }).then(onfulfilled); - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; - return promise; - }; - executor(function cancel(message, config, request) { - if (token.reason) { - return; - } - token.reason = new CanceledError_default(message, config, request); - resolvePromise(token.reason); - }); - } - /** - * Throws a `CanceledError` if cancellation has been requested. - */ - throwIfRequested() { - if (this.reason) { - throw this.reason; - } - } - /** - * Subscribe to the cancel signal - */ - subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; - } - } - /** - * Unsubscribe from the cancel signal - */ - unsubscribe(listener) { - if (!this._listeners) { - return; - } - const index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); - } - } - toAbortSignal() { - const controller = new AbortController(); - const abort = (err) => { - controller.abort(err); - }; - this.subscribe(abort); - controller.signal.unsubscribe = () => this.unsubscribe(abort); - return controller.signal; - } - /** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ - static source() { - let cancel; - const token = new _CancelToken(function executor(c) { - cancel = c; - }); - return { - token, - cancel - }; - } -}; -var CancelToken_default = CancelToken; - -// node_modules/axios/lib/helpers/spread.js -function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -} - -// node_modules/axios/lib/helpers/isAxiosError.js -function isAxiosError(payload) { - return utils_default.isObject(payload) && payload.isAxiosError === true; -} - -// node_modules/axios/lib/helpers/HttpStatusCode.js -var HttpStatusCode = { - Continue: 100, - SwitchingProtocols: 101, - Processing: 102, - EarlyHints: 103, - Ok: 200, - Created: 201, - Accepted: 202, - NonAuthoritativeInformation: 203, - NoContent: 204, - ResetContent: 205, - PartialContent: 206, - MultiStatus: 207, - AlreadyReported: 208, - ImUsed: 226, - MultipleChoices: 300, - MovedPermanently: 301, - Found: 302, - SeeOther: 303, - NotModified: 304, - UseProxy: 305, - Unused: 306, - TemporaryRedirect: 307, - PermanentRedirect: 308, - BadRequest: 400, - Unauthorized: 401, - PaymentRequired: 402, - Forbidden: 403, - NotFound: 404, - MethodNotAllowed: 405, - NotAcceptable: 406, - ProxyAuthenticationRequired: 407, - RequestTimeout: 408, - Conflict: 409, - Gone: 410, - LengthRequired: 411, - PreconditionFailed: 412, - PayloadTooLarge: 413, - UriTooLong: 414, - UnsupportedMediaType: 415, - RangeNotSatisfiable: 416, - ExpectationFailed: 417, - ImATeapot: 418, - MisdirectedRequest: 421, - UnprocessableEntity: 422, - Locked: 423, - FailedDependency: 424, - TooEarly: 425, - UpgradeRequired: 426, - PreconditionRequired: 428, - TooManyRequests: 429, - RequestHeaderFieldsTooLarge: 431, - UnavailableForLegalReasons: 451, - InternalServerError: 500, - NotImplemented: 501, - BadGateway: 502, - ServiceUnavailable: 503, - GatewayTimeout: 504, - HttpVersionNotSupported: 505, - VariantAlsoNegotiates: 506, - InsufficientStorage: 507, - LoopDetected: 508, - NotExtended: 510, - NetworkAuthenticationRequired: 511 -}; -Object.entries(HttpStatusCode).forEach(([key, value]) => { - HttpStatusCode[value] = key; -}); -var HttpStatusCode_default = HttpStatusCode; - -// node_modules/axios/lib/axios.js -function createInstance(defaultConfig) { - const context = new Axios_default(defaultConfig); - const instance = bind(Axios_default.prototype.request, context); - utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true }); - utils_default.extend(instance, context, null, { allOwnKeys: true }); - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; - return instance; -} -var axios = createInstance(defaults_default); -axios.Axios = Axios_default; -axios.CanceledError = CanceledError_default; -axios.CancelToken = CancelToken_default; -axios.isCancel = isCancel; -axios.VERSION = VERSION; -axios.toFormData = toFormData_default; -axios.AxiosError = AxiosError_default; -axios.Cancel = axios.CanceledError; -axios.all = function all(promises) { - return Promise.all(promises); -}; -axios.spread = spread; -axios.isAxiosError = isAxiosError; -axios.mergeConfig = mergeConfig; -axios.AxiosHeaders = AxiosHeaders_default; -axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing); -axios.getAdapter = adapters_default.getAdapter; -axios.HttpStatusCode = HttpStatusCode_default; -axios.default = axios; -var axios_default = axios; - -// node_modules/axios/index.js -var { - Axios: Axios2, - AxiosError: AxiosError2, - CanceledError: CanceledError2, - isCancel: isCancel2, - CancelToken: CancelToken2, - VERSION: VERSION2, - all: all2, - Cancel, - isAxiosError: isAxiosError2, - spread: spread2, - toFormData: toFormData2, - AxiosHeaders: AxiosHeaders2, - HttpStatusCode: HttpStatusCode2, - formToJSON, - getAdapter, - mergeConfig: mergeConfig2 -} = axios_default; - -// model/accountCreateRequest.ts -var AccountCreateRequest = class _AccountCreateRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "clientSecret", - baseName: "client_secret", - type: "string" - }, - { - name: "locale", - baseName: "locale", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _AccountCreateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "AccountCreateRequest"); - } -}; - -// model/accountCreateResponse.ts -var AccountCreateResponse = class _AccountCreateResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "account", - baseName: "account", - type: "AccountResponse" - }, - { - name: "oauthData", - baseName: "oauth_data", - type: "OAuthTokenResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _AccountCreateResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "AccountCreateResponse"); - } -}; - -// model/accountGetResponse.ts -var AccountGetResponse = class _AccountGetResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "account", - baseName: "account", - type: "AccountResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _AccountGetResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "AccountGetResponse"); - } -}; - -// model/accountResponse.ts -var AccountResponse = class _AccountResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "accountId", - baseName: "account_id", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "isLocked", - baseName: "is_locked", - type: "boolean" - }, - { - name: "isPaidHs", - baseName: "is_paid_hs", - type: "boolean" - }, - { - name: "isPaidHf", - baseName: "is_paid_hf", - type: "boolean" - }, - { - name: "quotas", - baseName: "quotas", - type: "AccountResponseQuotas" - }, - { - name: "callbackUrl", - baseName: "callback_url", - type: "string" - }, - { - name: "roleCode", - baseName: "role_code", - type: "string" - }, - { - name: "teamId", - baseName: "team_id", - type: "string" - }, - { - name: "locale", - baseName: "locale", - type: "string" - }, - { - name: "usage", - baseName: "usage", - type: "AccountResponseUsage" - } - ]; - } - static getAttributeTypeMap() { - return _AccountResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "AccountResponse"); - } -}; - -// model/accountResponseQuotas.ts -var AccountResponseQuotas = class _AccountResponseQuotas { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "apiSignatureRequestsLeft", - baseName: "api_signature_requests_left", - type: "number" - }, - { - name: "documentsLeft", - baseName: "documents_left", - type: "number" - }, - { - name: "templatesTotal", - baseName: "templates_total", - type: "number" - }, - { - name: "templatesLeft", - baseName: "templates_left", - type: "number" - }, - { - name: "smsVerificationsLeft", - baseName: "sms_verifications_left", - type: "number" - }, - { - name: "numFaxPagesLeft", - baseName: "num_fax_pages_left", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _AccountResponseQuotas.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "AccountResponseQuotas"); - } -}; - -// model/accountResponseUsage.ts -var AccountResponseUsage = class _AccountResponseUsage { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "faxPagesSent", - baseName: "fax_pages_sent", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _AccountResponseUsage.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "AccountResponseUsage"); - } -}; - -// model/accountUpdateRequest.ts -var AccountUpdateRequest = class _AccountUpdateRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "accountId", - baseName: "account_id", - type: "string" - }, - { - name: "callbackUrl", - baseName: "callback_url", - type: "string" - }, - { - name: "locale", - baseName: "locale", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _AccountUpdateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "AccountUpdateRequest"); - } -}; - -// model/accountVerifyRequest.ts -var AccountVerifyRequest = class _AccountVerifyRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "emailAddress", - baseName: "email_address", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _AccountVerifyRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "AccountVerifyRequest"); - } -}; - -// model/accountVerifyResponse.ts -var AccountVerifyResponse = class _AccountVerifyResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "account", - baseName: "account", - type: "AccountVerifyResponseAccount" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _AccountVerifyResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "AccountVerifyResponse"); - } -}; - -// model/accountVerifyResponseAccount.ts -var AccountVerifyResponseAccount = class _AccountVerifyResponseAccount { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "emailAddress", - baseName: "email_address", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _AccountVerifyResponseAccount.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "AccountVerifyResponseAccount"); - } -}; - -// model/apiAppCreateRequest.ts -var ApiAppCreateRequest = class _ApiAppCreateRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "domains", - baseName: "domains", - type: "Array" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "callbackUrl", - baseName: "callback_url", - type: "string" - }, - { - name: "customLogoFile", - baseName: "custom_logo_file", - type: "RequestFile" - }, - { - name: "oauth", - baseName: "oauth", - type: "SubOAuth" - }, - { - name: "options", - baseName: "options", - type: "SubOptions" - }, - { - name: "whiteLabelingOptions", - baseName: "white_labeling_options", - type: "SubWhiteLabelingOptions" - } - ]; - } - static getAttributeTypeMap() { - return _ApiAppCreateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ApiAppCreateRequest"); - } -}; - -// model/apiAppGetResponse.ts -var ApiAppGetResponse = class _ApiAppGetResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "apiApp", - baseName: "api_app", - type: "ApiAppResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _ApiAppGetResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ApiAppGetResponse"); - } -}; - -// model/apiAppListResponse.ts -var ApiAppListResponse = class _ApiAppListResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "apiApps", - baseName: "api_apps", - type: "Array" - }, - { - name: "listInfo", - baseName: "list_info", - type: "ListInfoResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _ApiAppListResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ApiAppListResponse"); - } -}; - -// model/apiAppResponse.ts -var ApiAppResponse = class _ApiAppResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "callbackUrl", - baseName: "callback_url", - type: "string" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "createdAt", - baseName: "created_at", - type: "number" - }, - { - name: "domains", - baseName: "domains", - type: "Array" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "isApproved", - baseName: "is_approved", - type: "boolean" - }, - { - name: "oauth", - baseName: "oauth", - type: "ApiAppResponseOAuth" - }, - { - name: "options", - baseName: "options", - type: "ApiAppResponseOptions" - }, - { - name: "ownerAccount", - baseName: "owner_account", - type: "ApiAppResponseOwnerAccount" - }, - { - name: "whiteLabelingOptions", - baseName: "white_labeling_options", - type: "ApiAppResponseWhiteLabelingOptions" - } - ]; - } - static getAttributeTypeMap() { - return _ApiAppResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ApiAppResponse"); - } -}; - -// model/apiAppResponseOAuth.ts -var ApiAppResponseOAuth = class _ApiAppResponseOAuth { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "callbackUrl", - baseName: "callback_url", - type: "string" - }, - { - name: "secret", - baseName: "secret", - type: "string" - }, - { - name: "scopes", - baseName: "scopes", - type: "Array" - }, - { - name: "chargesUsers", - baseName: "charges_users", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _ApiAppResponseOAuth.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ApiAppResponseOAuth"); - } -}; - -// model/apiAppResponseOptions.ts -var ApiAppResponseOptions = class _ApiAppResponseOptions { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "canInsertEverywhere", - baseName: "can_insert_everywhere", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _ApiAppResponseOptions.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ApiAppResponseOptions"); - } -}; - -// model/apiAppResponseOwnerAccount.ts -var ApiAppResponseOwnerAccount = class _ApiAppResponseOwnerAccount { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "accountId", - baseName: "account_id", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _ApiAppResponseOwnerAccount.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ApiAppResponseOwnerAccount"); - } -}; - -// model/apiAppResponseWhiteLabelingOptions.ts -var ApiAppResponseWhiteLabelingOptions = class _ApiAppResponseWhiteLabelingOptions { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "headerBackgroundColor", - baseName: "header_background_color", - type: "string" - }, - { - name: "legalVersion", - baseName: "legal_version", - type: "string" - }, - { - name: "linkColor", - baseName: "link_color", - type: "string" - }, - { - name: "pageBackgroundColor", - baseName: "page_background_color", - type: "string" - }, - { - name: "primaryButtonColor", - baseName: "primary_button_color", - type: "string" - }, - { - name: "primaryButtonColorHover", - baseName: "primary_button_color_hover", - type: "string" - }, - { - name: "primaryButtonTextColor", - baseName: "primary_button_text_color", - type: "string" - }, - { - name: "primaryButtonTextColorHover", - baseName: "primary_button_text_color_hover", - type: "string" - }, - { - name: "secondaryButtonColor", - baseName: "secondary_button_color", - type: "string" - }, - { - name: "secondaryButtonColorHover", - baseName: "secondary_button_color_hover", - type: "string" - }, - { - name: "secondaryButtonTextColor", - baseName: "secondary_button_text_color", - type: "string" - }, - { - name: "secondaryButtonTextColorHover", - baseName: "secondary_button_text_color_hover", - type: "string" - }, - { - name: "textColor1", - baseName: "text_color1", - type: "string" - }, - { - name: "textColor2", - baseName: "text_color2", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _ApiAppResponseWhiteLabelingOptions.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "ApiAppResponseWhiteLabelingOptions" - ); - } -}; - -// model/apiAppUpdateRequest.ts -var ApiAppUpdateRequest = class _ApiAppUpdateRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "callbackUrl", - baseName: "callback_url", - type: "string" - }, - { - name: "customLogoFile", - baseName: "custom_logo_file", - type: "RequestFile" - }, - { - name: "domains", - baseName: "domains", - type: "Array" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "oauth", - baseName: "oauth", - type: "SubOAuth" - }, - { - name: "options", - baseName: "options", - type: "SubOptions" - }, - { - name: "whiteLabelingOptions", - baseName: "white_labeling_options", - type: "SubWhiteLabelingOptions" - } - ]; - } - static getAttributeTypeMap() { - return _ApiAppUpdateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ApiAppUpdateRequest"); - } -}; - -// model/bulkSendJobGetResponse.ts -var BulkSendJobGetResponse = class _BulkSendJobGetResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "bulkSendJob", - baseName: "bulk_send_job", - type: "BulkSendJobResponse" - }, - { - name: "listInfo", - baseName: "list_info", - type: "ListInfoResponse" - }, - { - name: "signatureRequests", - baseName: "signature_requests", - type: "Array" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _BulkSendJobGetResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "BulkSendJobGetResponse"); - } -}; - -// model/bulkSendJobGetResponseSignatureRequests.ts -var BulkSendJobGetResponseSignatureRequests = class _BulkSendJobGetResponseSignatureRequests { - constructor() { - /** - * Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. - */ - this["testMode"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "signatureRequestId", - baseName: "signature_request_id", - type: "string" - }, - { - name: "requesterEmailAddress", - baseName: "requester_email_address", - type: "string" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "originalTitle", - baseName: "original_title", - type: "string" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "createdAt", - baseName: "created_at", - type: "number" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - }, - { - name: "isComplete", - baseName: "is_complete", - type: "boolean" - }, - { - name: "isDeclined", - baseName: "is_declined", - type: "boolean" - }, - { - name: "hasError", - baseName: "has_error", - type: "boolean" - }, - { - name: "filesUrl", - baseName: "files_url", - type: "string" - }, - { - name: "signingUrl", - baseName: "signing_url", - type: "string" - }, - { - name: "detailsUrl", - baseName: "details_url", - type: "string" - }, - { - name: "ccEmailAddresses", - baseName: "cc_email_addresses", - type: "Array" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "finalCopyUri", - baseName: "final_copy_uri", - type: "string" - }, - { - name: "templateIds", - baseName: "template_ids", - type: "Array" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "attachments", - baseName: "attachments", - type: "Array" - }, - { - name: "responseData", - baseName: "response_data", - type: "Array" - }, - { - name: "signatures", - baseName: "signatures", - type: "Array" - }, - { - name: "bulkSendJobId", - baseName: "bulk_send_job_id", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _BulkSendJobGetResponseSignatureRequests.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "BulkSendJobGetResponseSignatureRequests" - ); - } -}; - -// model/bulkSendJobListResponse.ts -var BulkSendJobListResponse = class _BulkSendJobListResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "bulkSendJobs", - baseName: "bulk_send_jobs", - type: "Array" - }, - { - name: "listInfo", - baseName: "list_info", - type: "ListInfoResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _BulkSendJobListResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "BulkSendJobListResponse"); - } -}; - -// model/bulkSendJobResponse.ts -var BulkSendJobResponse = class _BulkSendJobResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "bulkSendJobId", - baseName: "bulk_send_job_id", - type: "string" - }, - { - name: "total", - baseName: "total", - type: "number" - }, - { - name: "isCreator", - baseName: "is_creator", - type: "boolean" - }, - { - name: "createdAt", - baseName: "created_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _BulkSendJobResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "BulkSendJobResponse"); - } -}; - -// model/bulkSendJobSendResponse.ts -var BulkSendJobSendResponse = class _BulkSendJobSendResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "bulkSendJob", - baseName: "bulk_send_job", - type: "BulkSendJobResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _BulkSendJobSendResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "BulkSendJobSendResponse"); - } -}; - -// model/embeddedEditUrlRequest.ts -var EmbeddedEditUrlRequest = class _EmbeddedEditUrlRequest { - constructor() { - /** - * This allows the requester to enable/disable to add or change CC roles when editing the template. - */ - this["allowEditCcs"] = false; - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. - */ - this["allowFormView"] = false; - /** - * Provide users the ability to review/edit the template signer roles. - */ - this["forceSignerRoles"] = false; - /** - * Provide users the ability to review/edit the template subject and message. - */ - this["forceSubjectMessage"] = false; - /** - * This allows the requester to enable the preview experience (i.e. does not allow the requester\'s end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set). - */ - this["previewOnly"] = false; - /** - * This allows the requester to enable the editor/preview experience. - */ - this["showPreview"] = false; - /** - * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. - */ - this["showProgressStepper"] = true; - /** - * Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "allowEditCcs", - baseName: "allow_edit_ccs", - type: "boolean" - }, - { - name: "allowFormView", - baseName: "allow_form_view", - type: "boolean" - }, - { - name: "ccRoles", - baseName: "cc_roles", - type: "Array" - }, - { - name: "editorOptions", - baseName: "editor_options", - type: "SubEditorOptions" - }, - { - name: "forceSignerRoles", - baseName: "force_signer_roles", - type: "boolean" - }, - { - name: "forceSubjectMessage", - baseName: "force_subject_message", - type: "boolean" - }, - { - name: "mergeFields", - baseName: "merge_fields", - type: "Array" - }, - { - name: "previewOnly", - baseName: "preview_only", - type: "boolean" - }, - { - name: "showPreview", - baseName: "show_preview", - type: "boolean" - }, - { - name: "showProgressStepper", - baseName: "show_progress_stepper", - type: "boolean" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _EmbeddedEditUrlRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "EmbeddedEditUrlRequest"); - } -}; - -// model/embeddedEditUrlResponse.ts -var EmbeddedEditUrlResponse = class _EmbeddedEditUrlResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "embedded", - baseName: "embedded", - type: "EmbeddedEditUrlResponseEmbedded" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _EmbeddedEditUrlResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "EmbeddedEditUrlResponse"); - } -}; - -// model/embeddedEditUrlResponseEmbedded.ts -var EmbeddedEditUrlResponseEmbedded = class _EmbeddedEditUrlResponseEmbedded { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "editUrl", - baseName: "edit_url", - type: "string" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _EmbeddedEditUrlResponseEmbedded.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "EmbeddedEditUrlResponseEmbedded" - ); - } -}; - -// model/embeddedSignUrlResponse.ts -var EmbeddedSignUrlResponse = class _EmbeddedSignUrlResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "embedded", - baseName: "embedded", - type: "EmbeddedSignUrlResponseEmbedded" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _EmbeddedSignUrlResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "EmbeddedSignUrlResponse"); - } -}; - -// model/embeddedSignUrlResponseEmbedded.ts -var EmbeddedSignUrlResponseEmbedded = class _EmbeddedSignUrlResponseEmbedded { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "signUrl", - baseName: "sign_url", - type: "string" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _EmbeddedSignUrlResponseEmbedded.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "EmbeddedSignUrlResponseEmbedded" - ); - } -}; - -// model/errorResponse.ts -var ErrorResponse = class _ErrorResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "error", - baseName: "error", - type: "ErrorResponseError" - } - ]; - } - static getAttributeTypeMap() { - return _ErrorResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ErrorResponse"); - } -}; - -// model/errorResponseError.ts -var ErrorResponseError = class _ErrorResponseError { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "errorMsg", - baseName: "error_msg", - type: "string" - }, - { - name: "errorName", - baseName: "error_name", - type: "string" - }, - { - name: "errorPath", - baseName: "error_path", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _ErrorResponseError.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ErrorResponseError"); - } -}; - -// model/eventCallbackHelper.ts -var crypto2 = __toESM(require("crypto")); -var EventCallbackHelper = class _EventCallbackHelper { - static { - this.EVENT_TYPE_ACCOUNT_CALLBACK = "account_callback"; - } - static { - this.EVENT_TYPE_APP_CALLBACK = "app_callback"; - } - static { - /** - * Verify that callback came from HelloSign.com - */ - this.isValid = (apiKey, eventCallback) => { - const hmac = crypto2.createHmac("sha256", apiKey); - hmac.update( - `${eventCallback.event.eventTime}${eventCallback.event.eventType}` - ); - return eventCallback.event.eventHash === hmac.digest("hex").toString(); - }; - } - static { - /** - * Identifies the callback type, one of "account_callback" or "app_callback". - * "app_callback" will always include a value for "reported_for_app_id" - */ - this.getCallbackType = (eventCallback) => { - if (!eventCallback.event.eventMetadata || !eventCallback.event.eventMetadata.reportedForAppId) { - return _EventCallbackHelper.EVENT_TYPE_ACCOUNT_CALLBACK; - } - return _EventCallbackHelper.EVENT_TYPE_APP_CALLBACK; - }; - } -}; - -// model/eventCallbackRequest.ts -var EventCallbackRequest = class _EventCallbackRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "event", - baseName: "event", - type: "EventCallbackRequestEvent" - }, - { - name: "account", - baseName: "account", - type: "AccountResponse" - }, - { - name: "signatureRequest", - baseName: "signature_request", - type: "SignatureRequestResponse" - }, - { - name: "template", - baseName: "template", - type: "TemplateResponse" - } - ]; - } - static getAttributeTypeMap() { - return _EventCallbackRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "EventCallbackRequest"); - } -}; - -// model/eventCallbackRequestEvent.ts -var EventCallbackRequestEvent = class _EventCallbackRequestEvent { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "eventTime", - baseName: "event_time", - type: "string" - }, - { - name: "eventType", - baseName: "event_type", - type: "EventCallbackRequestEvent.EventTypeEnum" - }, - { - name: "eventHash", - baseName: "event_hash", - type: "string" - }, - { - name: "eventMetadata", - baseName: "event_metadata", - type: "EventCallbackRequestEventMetadata" - } - ]; - } - static getAttributeTypeMap() { - return _EventCallbackRequestEvent.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "EventCallbackRequestEvent"); - } -}; -((EventCallbackRequestEvent2) => { - let EventTypeEnum; - ((EventTypeEnum2) => { - EventTypeEnum2["AccountConfirmed"] = "account_confirmed"; - EventTypeEnum2["UnknownError"] = "unknown_error"; - EventTypeEnum2["FileError"] = "file_error"; - EventTypeEnum2["SignUrlInvalid"] = "sign_url_invalid"; - EventTypeEnum2["SignatureRequestViewed"] = "signature_request_viewed"; - EventTypeEnum2["SignatureRequestSigned"] = "signature_request_signed"; - EventTypeEnum2["SignatureRequestSent"] = "signature_request_sent"; - EventTypeEnum2["SignatureRequestAllSigned"] = "signature_request_all_signed"; - EventTypeEnum2["SignatureRequestEmailBounce"] = "signature_request_email_bounce"; - EventTypeEnum2["SignatureRequestRemind"] = "signature_request_remind"; - EventTypeEnum2["SignatureRequestIncompleteQes"] = "signature_request_incomplete_qes"; - EventTypeEnum2["SignatureRequestDestroyed"] = "signature_request_destroyed"; - EventTypeEnum2["SignatureRequestCanceled"] = "signature_request_canceled"; - EventTypeEnum2["SignatureRequestDownloadable"] = "signature_request_downloadable"; - EventTypeEnum2["SignatureRequestDeclined"] = "signature_request_declined"; - EventTypeEnum2["SignatureRequestReassigned"] = "signature_request_reassigned"; - EventTypeEnum2["SignatureRequestInvalid"] = "signature_request_invalid"; - EventTypeEnum2["SignatureRequestPrepared"] = "signature_request_prepared"; - EventTypeEnum2["SignatureRequestExpired"] = "signature_request_expired"; - EventTypeEnum2["TemplateCreated"] = "template_created"; - EventTypeEnum2["TemplateError"] = "template_error"; - EventTypeEnum2["CallbackTest"] = "callback_test"; - EventTypeEnum2["SignatureRequestSignerRemoved"] = "signature_request_signer_removed"; - })(EventTypeEnum = EventCallbackRequestEvent2.EventTypeEnum || (EventCallbackRequestEvent2.EventTypeEnum = {})); -})(EventCallbackRequestEvent || (EventCallbackRequestEvent = {})); - -// model/eventCallbackRequestEventMetadata.ts -var EventCallbackRequestEventMetadata = class _EventCallbackRequestEventMetadata { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "relatedSignatureId", - baseName: "related_signature_id", - type: "string" - }, - { - name: "reportedForAccountId", - baseName: "reported_for_account_id", - type: "string" - }, - { - name: "reportedForAppId", - baseName: "reported_for_app_id", - type: "string" - }, - { - name: "eventMessage", - baseName: "event_message", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _EventCallbackRequestEventMetadata.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "EventCallbackRequestEventMetadata" - ); - } -}; - -// model/faxGetResponse.ts -var FaxGetResponse = class _FaxGetResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "fax", - baseName: "fax", - type: "FaxResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _FaxGetResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxGetResponse"); - } -}; - -// model/faxLineAddUserRequest.ts -var FaxLineAddUserRequest = class _FaxLineAddUserRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "number", - baseName: "number", - type: "string" - }, - { - name: "accountId", - baseName: "account_id", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _FaxLineAddUserRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxLineAddUserRequest"); - } -}; - -// model/faxLineAreaCodeGetCountryEnum.ts -var FaxLineAreaCodeGetCountryEnum = /* @__PURE__ */ ((FaxLineAreaCodeGetCountryEnum2) => { - FaxLineAreaCodeGetCountryEnum2["Ca"] = "CA"; - FaxLineAreaCodeGetCountryEnum2["Us"] = "US"; - FaxLineAreaCodeGetCountryEnum2["Uk"] = "UK"; - return FaxLineAreaCodeGetCountryEnum2; -})(FaxLineAreaCodeGetCountryEnum || {}); - -// model/faxLineAreaCodeGetProvinceEnum.ts -var FaxLineAreaCodeGetProvinceEnum = /* @__PURE__ */ ((FaxLineAreaCodeGetProvinceEnum2) => { - FaxLineAreaCodeGetProvinceEnum2["Ab"] = "AB"; - FaxLineAreaCodeGetProvinceEnum2["Bc"] = "BC"; - FaxLineAreaCodeGetProvinceEnum2["Mb"] = "MB"; - FaxLineAreaCodeGetProvinceEnum2["Nb"] = "NB"; - FaxLineAreaCodeGetProvinceEnum2["Nl"] = "NL"; - FaxLineAreaCodeGetProvinceEnum2["Nt"] = "NT"; - FaxLineAreaCodeGetProvinceEnum2["Ns"] = "NS"; - FaxLineAreaCodeGetProvinceEnum2["Nu"] = "NU"; - FaxLineAreaCodeGetProvinceEnum2["On"] = "ON"; - FaxLineAreaCodeGetProvinceEnum2["Pe"] = "PE"; - FaxLineAreaCodeGetProvinceEnum2["Qc"] = "QC"; - FaxLineAreaCodeGetProvinceEnum2["Sk"] = "SK"; - FaxLineAreaCodeGetProvinceEnum2["Yt"] = "YT"; - return FaxLineAreaCodeGetProvinceEnum2; -})(FaxLineAreaCodeGetProvinceEnum || {}); - -// model/faxLineAreaCodeGetResponse.ts -var FaxLineAreaCodeGetResponse = class _FaxLineAreaCodeGetResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "areaCodes", - baseName: "area_codes", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _FaxLineAreaCodeGetResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxLineAreaCodeGetResponse"); - } -}; - -// model/faxLineAreaCodeGetStateEnum.ts -var FaxLineAreaCodeGetStateEnum = /* @__PURE__ */ ((FaxLineAreaCodeGetStateEnum2) => { - FaxLineAreaCodeGetStateEnum2["Ak"] = "AK"; - FaxLineAreaCodeGetStateEnum2["Al"] = "AL"; - FaxLineAreaCodeGetStateEnum2["Ar"] = "AR"; - FaxLineAreaCodeGetStateEnum2["Az"] = "AZ"; - FaxLineAreaCodeGetStateEnum2["Ca"] = "CA"; - FaxLineAreaCodeGetStateEnum2["Co"] = "CO"; - FaxLineAreaCodeGetStateEnum2["Ct"] = "CT"; - FaxLineAreaCodeGetStateEnum2["Dc"] = "DC"; - FaxLineAreaCodeGetStateEnum2["De"] = "DE"; - FaxLineAreaCodeGetStateEnum2["Fl"] = "FL"; - FaxLineAreaCodeGetStateEnum2["Ga"] = "GA"; - FaxLineAreaCodeGetStateEnum2["Hi"] = "HI"; - FaxLineAreaCodeGetStateEnum2["Ia"] = "IA"; - FaxLineAreaCodeGetStateEnum2["Id"] = "ID"; - FaxLineAreaCodeGetStateEnum2["Il"] = "IL"; - FaxLineAreaCodeGetStateEnum2["In"] = "IN"; - FaxLineAreaCodeGetStateEnum2["Ks"] = "KS"; - FaxLineAreaCodeGetStateEnum2["Ky"] = "KY"; - FaxLineAreaCodeGetStateEnum2["La"] = "LA"; - FaxLineAreaCodeGetStateEnum2["Ma"] = "MA"; - FaxLineAreaCodeGetStateEnum2["Md"] = "MD"; - FaxLineAreaCodeGetStateEnum2["Me"] = "ME"; - FaxLineAreaCodeGetStateEnum2["Mi"] = "MI"; - FaxLineAreaCodeGetStateEnum2["Mn"] = "MN"; - FaxLineAreaCodeGetStateEnum2["Mo"] = "MO"; - FaxLineAreaCodeGetStateEnum2["Ms"] = "MS"; - FaxLineAreaCodeGetStateEnum2["Mt"] = "MT"; - FaxLineAreaCodeGetStateEnum2["Nc"] = "NC"; - FaxLineAreaCodeGetStateEnum2["Nd"] = "ND"; - FaxLineAreaCodeGetStateEnum2["Ne"] = "NE"; - FaxLineAreaCodeGetStateEnum2["Nh"] = "NH"; - FaxLineAreaCodeGetStateEnum2["Nj"] = "NJ"; - FaxLineAreaCodeGetStateEnum2["Nm"] = "NM"; - FaxLineAreaCodeGetStateEnum2["Nv"] = "NV"; - FaxLineAreaCodeGetStateEnum2["Ny"] = "NY"; - FaxLineAreaCodeGetStateEnum2["Oh"] = "OH"; - FaxLineAreaCodeGetStateEnum2["Ok"] = "OK"; - FaxLineAreaCodeGetStateEnum2["Or"] = "OR"; - FaxLineAreaCodeGetStateEnum2["Pa"] = "PA"; - FaxLineAreaCodeGetStateEnum2["Ri"] = "RI"; - FaxLineAreaCodeGetStateEnum2["Sc"] = "SC"; - FaxLineAreaCodeGetStateEnum2["Sd"] = "SD"; - FaxLineAreaCodeGetStateEnum2["Tn"] = "TN"; - FaxLineAreaCodeGetStateEnum2["Tx"] = "TX"; - FaxLineAreaCodeGetStateEnum2["Ut"] = "UT"; - FaxLineAreaCodeGetStateEnum2["Va"] = "VA"; - FaxLineAreaCodeGetStateEnum2["Vt"] = "VT"; - FaxLineAreaCodeGetStateEnum2["Wa"] = "WA"; - FaxLineAreaCodeGetStateEnum2["Wi"] = "WI"; - FaxLineAreaCodeGetStateEnum2["Wv"] = "WV"; - FaxLineAreaCodeGetStateEnum2["Wy"] = "WY"; - return FaxLineAreaCodeGetStateEnum2; -})(FaxLineAreaCodeGetStateEnum || {}); - -// model/faxLineCreateRequest.ts -var FaxLineCreateRequest = class _FaxLineCreateRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "areaCode", - baseName: "area_code", - type: "number" - }, - { - name: "country", - baseName: "country", - type: "FaxLineCreateRequest.CountryEnum" - }, - { - name: "city", - baseName: "city", - type: "string" - }, - { - name: "accountId", - baseName: "account_id", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _FaxLineCreateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxLineCreateRequest"); - } -}; -((FaxLineCreateRequest2) => { - let CountryEnum; - ((CountryEnum2) => { - CountryEnum2["Ca"] = "CA"; - CountryEnum2["Us"] = "US"; - CountryEnum2["Uk"] = "UK"; - })(CountryEnum = FaxLineCreateRequest2.CountryEnum || (FaxLineCreateRequest2.CountryEnum = {})); -})(FaxLineCreateRequest || (FaxLineCreateRequest = {})); - -// model/faxLineDeleteRequest.ts -var FaxLineDeleteRequest = class _FaxLineDeleteRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "number", - baseName: "number", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _FaxLineDeleteRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxLineDeleteRequest"); - } -}; - -// model/faxLineListResponse.ts -var FaxLineListResponse = class _FaxLineListResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "listInfo", - baseName: "list_info", - type: "ListInfoResponse" - }, - { - name: "faxLines", - baseName: "fax_lines", - type: "Array" - }, - { - name: "warnings", - baseName: "warnings", - type: "WarningResponse" - } - ]; - } - static getAttributeTypeMap() { - return _FaxLineListResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxLineListResponse"); - } -}; - -// model/faxLineRemoveUserRequest.ts -var FaxLineRemoveUserRequest = class _FaxLineRemoveUserRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "number", - baseName: "number", - type: "string" - }, - { - name: "accountId", - baseName: "account_id", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _FaxLineRemoveUserRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxLineRemoveUserRequest"); - } -}; - -// model/faxLineResponse.ts -var FaxLineResponse = class _FaxLineResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "faxLine", - baseName: "fax_line", - type: "FaxLineResponseFaxLine" - }, - { - name: "warnings", - baseName: "warnings", - type: "WarningResponse" - } - ]; - } - static getAttributeTypeMap() { - return _FaxLineResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxLineResponse"); - } -}; - -// model/faxLineResponseFaxLine.ts -var FaxLineResponseFaxLine = class _FaxLineResponseFaxLine { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "number", - baseName: "number", - type: "string" - }, - { - name: "createdAt", - baseName: "created_at", - type: "number" - }, - { - name: "updatedAt", - baseName: "updated_at", - type: "number" - }, - { - name: "accounts", - baseName: "accounts", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _FaxLineResponseFaxLine.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxLineResponseFaxLine"); - } -}; - -// model/faxListResponse.ts -var FaxListResponse = class _FaxListResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "faxes", - baseName: "faxes", - type: "Array" - }, - { - name: "listInfo", - baseName: "list_info", - type: "ListInfoResponse" - } - ]; - } - static getAttributeTypeMap() { - return _FaxListResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxListResponse"); - } -}; - -// model/faxResponse.ts -var FaxResponse = class _FaxResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "faxId", - baseName: "fax_id", - type: "string" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "originalTitle", - baseName: "original_title", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "createdAt", - baseName: "created_at", - type: "number" - }, - { - name: "sender", - baseName: "sender", - type: "string" - }, - { - name: "filesUrl", - baseName: "files_url", - type: "string" - }, - { - name: "transmissions", - baseName: "transmissions", - type: "Array" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "finalCopyUri", - baseName: "final_copy_uri", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _FaxResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxResponse"); - } -}; - -// model/faxResponseTransmission.ts -var FaxResponseTransmission = class _FaxResponseTransmission { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "recipient", - baseName: "recipient", - type: "string" - }, - { - name: "statusCode", - baseName: "status_code", - type: "FaxResponseTransmission.StatusCodeEnum" - }, - { - name: "sentAt", - baseName: "sent_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _FaxResponseTransmission.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxResponseTransmission"); - } -}; -((FaxResponseTransmission2) => { - let StatusCodeEnum; - ((StatusCodeEnum2) => { - StatusCodeEnum2["Success"] = "success"; - StatusCodeEnum2["Transmitting"] = "transmitting"; - StatusCodeEnum2["ErrorCouldNotFax"] = "error_could_not_fax"; - StatusCodeEnum2["ErrorUnknown"] = "error_unknown"; - StatusCodeEnum2["ErrorBusy"] = "error_busy"; - StatusCodeEnum2["ErrorNoAnswer"] = "error_no_answer"; - StatusCodeEnum2["ErrorDisconnected"] = "error_disconnected"; - StatusCodeEnum2["ErrorBadDestination"] = "error_bad_destination"; - })(StatusCodeEnum = FaxResponseTransmission2.StatusCodeEnum || (FaxResponseTransmission2.StatusCodeEnum = {})); -})(FaxResponseTransmission || (FaxResponseTransmission = {})); - -// model/faxSendRequest.ts -var FaxSendRequest = class _FaxSendRequest { - constructor() { - /** - * API Test Mode Setting - */ - this["testMode"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "recipient", - baseName: "recipient", - type: "string" - }, - { - name: "sender", - baseName: "sender", - type: "string" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "coverPageTo", - baseName: "cover_page_to", - type: "string" - }, - { - name: "coverPageFrom", - baseName: "cover_page_from", - type: "string" - }, - { - name: "coverPageMessage", - baseName: "cover_page_message", - type: "string" - }, - { - name: "title", - baseName: "title", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _FaxSendRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FaxSendRequest"); - } -}; - -// model/fileResponse.ts -var FileResponse = class _FileResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "fileUrl", - baseName: "file_url", - type: "string" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _FileResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FileResponse"); - } -}; - -// model/fileResponseDataUri.ts -var FileResponseDataUri = class _FileResponseDataUri { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "dataUri", - baseName: "data_uri", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _FileResponseDataUri.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "FileResponseDataUri"); - } -}; - -// model/listInfoResponse.ts -var ListInfoResponse = class _ListInfoResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "numPages", - baseName: "num_pages", - type: "number" - }, - { - name: "numResults", - baseName: "num_results", - type: "number" - }, - { - name: "page", - baseName: "page", - type: "number" - }, - { - name: "pageSize", - baseName: "page_size", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _ListInfoResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ListInfoResponse"); - } -}; - -// model/models.ts -var primitives = [ - "string", - "boolean", - "double", - "integer", - "long", - "float", - "number", - "any" -]; -function startsWith(str, match) { - return str.substring(0, match.length) === match; -} -function endsWith2(str, match) { - return str.length >= match.length && str.substring(str.length - match.length) === match; -} -var nullableSuffix = " | null"; -var optionalSuffix = " | undefined"; -var arrayPrefix = "Array<"; -var arraySuffix = ">"; -var mapPrefix = "{ [key: string]: "; -var mapSuffix = "; }"; -var ObjectSerializer = class _ObjectSerializer { - static findCorrectType(data, expectedType) { - if (data == void 0) { - return expectedType; - } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) { - return expectedType; - } else if (expectedType === "Date") { - return expectedType; - } else { - if (enumsMap[expectedType]) { - return expectedType; - } - if (!typeMap[expectedType]) { - return expectedType; - } - let discriminatorProperty = typeMap[expectedType].discriminator; - let discriminatorValue = data[discriminatorProperty]; - if (typeMap[expectedType].hasOwnProperty("discriminatorClassName")) { - let discriminatorClass = typeMap[expectedType].discriminatorClassName(discriminatorValue); - if (discriminatorClass) { - return discriminatorClass; - } - } - if (discriminatorProperty == null) { - return expectedType; - } else { - if (data[discriminatorProperty]) { - var discriminatorType = data[discriminatorProperty]; - if (typeMap[discriminatorType]) { - return discriminatorType; - } else { - return expectedType; - } - } else { - return expectedType; - } - } - } - } - static serialize(data, type) { - if (data == void 0) { - return data; - } else if (primitives.indexOf(type.toLowerCase()) !== -1) { - return data; - } else if (endsWith2(type, nullableSuffix)) { - let subType = type.slice(0, -nullableSuffix.length); - return _ObjectSerializer.serialize(data, subType); - } else if (endsWith2(type, optionalSuffix)) { - let subType = type.slice(0, -optionalSuffix.length); - return _ObjectSerializer.serialize(data, subType); - } else if (startsWith(type, arrayPrefix)) { - let subType = type.slice(arrayPrefix.length, -arraySuffix.length); - let transformedData = []; - for (let index = 0; index < data.length; index++) { - let datum = data[index]; - transformedData.push(_ObjectSerializer.serialize(datum, subType)); - } - return transformedData; - } else if (startsWith(type, mapPrefix)) { - let subType = type.slice(mapPrefix.length, -mapSuffix.length); - let transformedData = {}; - for (let key in data) { - transformedData[key] = _ObjectSerializer.serialize(data[key], subType); - } - return transformedData; - } else if (type === "Date") { - return data.toISOString(); - } else { - if (enumsMap[type]) { - return data; - } - if (!typeMap[type]) { - return data; - } - type = this.findCorrectType(data, type); - let attributeTypes = typeMap[type].getAttributeTypeMap(); - let instance = {}; - for (let index = 0; index < attributeTypes.length; index++) { - let attributeType = attributeTypes[index]; - let value = _ObjectSerializer.serialize( - data[attributeType.name], - attributeType.type - ); - if (value !== void 0) { - instance[attributeType.baseName] = value; - } - } - return instance; - } - } - static deserialize(data, type) { - type = _ObjectSerializer.findCorrectType(data, type); - if (data == void 0) { - return data; - } else if (primitives.indexOf(type.toLowerCase()) !== -1) { - return data; - } else if (endsWith2(type, nullableSuffix)) { - let subType = type.slice(0, -nullableSuffix.length); - return _ObjectSerializer.deserialize(data, subType); - } else if (endsWith2(type, optionalSuffix)) { - let subType = type.slice(0, -optionalSuffix.length); - return _ObjectSerializer.deserialize(data, subType); - } else if (startsWith(type, arrayPrefix)) { - let subType = type.slice(arrayPrefix.length, -arraySuffix.length); - let transformedData = []; - for (let index = 0; index < data.length; index++) { - let datum = data[index]; - transformedData.push(_ObjectSerializer.deserialize(datum, subType)); - } - return transformedData; - } else if (startsWith(type, mapPrefix)) { - let subType = type.slice(mapPrefix.length, -mapSuffix.length); - let transformedData = {}; - for (let key in data) { - transformedData[key] = _ObjectSerializer.deserialize(data[key], subType); - } - return transformedData; - } else if (type === "Date") { - return new Date(data); - } else { - if (enumsMap[type]) { - return data; - } - if (!typeMap[type]) { - return data; - } - let instance = new typeMap[type](); - let attributeTypes = typeMap[type].getAttributeTypeMap(); - for (let index = 0; index < attributeTypes.length; index++) { - let attributeType = attributeTypes[index]; - const propertyKey = data[attributeType.baseName] !== void 0 ? attributeType.baseName : attributeType.name; - instance[attributeType.name] = _ObjectSerializer.deserialize( - data[propertyKey], - attributeType.type - ); - } - return instance; - } - } -}; -var HttpBasicAuth = class { - constructor() { - this.username = ""; - this.password = ""; - } - applyToRequest(requestOptions) { - requestOptions.auth = { - username: this.username, - password: this.password - }; - } -}; -var HttpBearerAuth = class { - constructor() { - this.accessToken = ""; - } - applyToRequest(requestOptions) { - if (requestOptions && requestOptions.headers) { - const accessToken = typeof this.accessToken === "function" ? this.accessToken() : this.accessToken; - requestOptions.headers["Authorization"] = "Bearer " + accessToken; - } - } -}; -var ApiKeyAuth = class { - constructor(location, paramName) { - this.location = location; - this.paramName = paramName; - this.apiKey = ""; - } - applyToRequest(requestOptions) { - if (this.location == "query") { - requestOptions.params[this.paramName] = this.apiKey; - } else if (this.location == "header" && requestOptions && requestOptions.headers) { - requestOptions.headers[this.paramName] = this.apiKey; - } else if (this.location == "cookie" && requestOptions && requestOptions.headers) { - if (requestOptions.headers["Cookie"]) { - requestOptions.headers["Cookie"] += "; " + this.paramName + "=" + encodeURIComponent(this.apiKey); - } else { - requestOptions.headers["Cookie"] = this.paramName + "=" + encodeURIComponent(this.apiKey); - } - } - } -}; -var OAuth = class { - constructor() { - this.accessToken = ""; - } - applyToRequest(requestOptions) { - if (requestOptions && requestOptions.headers) { - requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; - } - } -}; -var VoidAuth = class { - constructor() { - this.username = ""; - this.password = ""; - } - applyToRequest(_) { - } -}; - -// model/oAuthTokenGenerateRequest.ts -var OAuthTokenGenerateRequest = class _OAuthTokenGenerateRequest { - constructor() { - /** - * When generating a new token use `authorization_code`. - */ - this["grantType"] = "authorization_code"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "clientSecret", - baseName: "client_secret", - type: "string" - }, - { - name: "code", - baseName: "code", - type: "string" - }, - { - name: "grantType", - baseName: "grant_type", - type: "string" - }, - { - name: "state", - baseName: "state", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _OAuthTokenGenerateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "OAuthTokenGenerateRequest"); - } -}; - -// model/oAuthTokenRefreshRequest.ts -var OAuthTokenRefreshRequest = class _OAuthTokenRefreshRequest { - constructor() { - /** - * When refreshing an existing token use `refresh_token`. - */ - this["grantType"] = "refresh_token"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "grantType", - baseName: "grant_type", - type: "string" - }, - { - name: "refreshToken", - baseName: "refresh_token", - type: "string" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "clientSecret", - baseName: "client_secret", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _OAuthTokenRefreshRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "OAuthTokenRefreshRequest"); - } -}; - -// model/oAuthTokenResponse.ts -var OAuthTokenResponse = class _OAuthTokenResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "accessToken", - baseName: "access_token", - type: "string" - }, - { - name: "tokenType", - baseName: "token_type", - type: "string" - }, - { - name: "refreshToken", - baseName: "refresh_token", - type: "string" - }, - { - name: "expiresIn", - baseName: "expires_in", - type: "number" - }, - { - name: "state", - baseName: "state", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _OAuthTokenResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "OAuthTokenResponse"); - } -}; - -// model/reportCreateRequest.ts -var ReportCreateRequest = class _ReportCreateRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "endDate", - baseName: "end_date", - type: "string" - }, - { - name: "reportType", - baseName: "report_type", - type: "Array" - }, - { - name: "startDate", - baseName: "start_date", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _ReportCreateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ReportCreateRequest"); - } -}; -((ReportCreateRequest2) => { - let ReportTypeEnum; - ((ReportTypeEnum2) => { - ReportTypeEnum2["UserActivity"] = "user_activity"; - ReportTypeEnum2["DocumentStatus"] = "document_status"; - ReportTypeEnum2["SmsActivity"] = "sms_activity"; - })(ReportTypeEnum = ReportCreateRequest2.ReportTypeEnum || (ReportCreateRequest2.ReportTypeEnum = {})); -})(ReportCreateRequest || (ReportCreateRequest = {})); - -// model/reportCreateResponse.ts -var ReportCreateResponse = class _ReportCreateResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "report", - baseName: "report", - type: "ReportResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _ReportCreateResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ReportCreateResponse"); - } -}; - -// model/reportResponse.ts -var ReportResponse = class _ReportResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "success", - baseName: "success", - type: "string" - }, - { - name: "startDate", - baseName: "start_date", - type: "string" - }, - { - name: "endDate", - baseName: "end_date", - type: "string" - }, - { - name: "reportType", - baseName: "report_type", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _ReportResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "ReportResponse"); - } -}; -((ReportResponse2) => { - let ReportTypeEnum; - ((ReportTypeEnum2) => { - ReportTypeEnum2["UserActivity"] = "user_activity"; - ReportTypeEnum2["DocumentStatus"] = "document_status"; - ReportTypeEnum2["SmsActivity"] = "sms_activity"; - })(ReportTypeEnum = ReportResponse2.ReportTypeEnum || (ReportResponse2.ReportTypeEnum = {})); -})(ReportResponse || (ReportResponse = {})); - -// model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.ts -var SignatureRequestBulkCreateEmbeddedWithTemplateRequest = class _SignatureRequestBulkCreateEmbeddedWithTemplateRequest { - constructor() { - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templateIds", - baseName: "template_ids", - type: "Array" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "signerFile", - baseName: "signer_file", - type: "RequestFile" - }, - { - name: "signerList", - baseName: "signer_list", - type: "Array" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "ccs", - baseName: "ccs", - type: "Array" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestBulkCreateEmbeddedWithTemplateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" - ); - } -}; - -// model/signatureRequestBulkSendWithTemplateRequest.ts -var SignatureRequestBulkSendWithTemplateRequest = class _SignatureRequestBulkSendWithTemplateRequest { - constructor() { - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templateIds", - baseName: "template_ids", - type: "Array" - }, - { - name: "signerFile", - baseName: "signer_file", - type: "RequestFile" - }, - { - name: "signerList", - baseName: "signer_list", - type: "Array" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "ccs", - baseName: "ccs", - type: "Array" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestBulkSendWithTemplateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestBulkSendWithTemplateRequest" - ); - } -}; - -// model/signatureRequestCreateEmbeddedRequest.ts -var SignatureRequestCreateEmbeddedRequest = class _SignatureRequestCreateEmbeddedRequest { - constructor() { - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. - */ - this["allowFormView"] = false; - /** - * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. - */ - this["allowReassign"] = false; - /** - * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. - */ - this["hideTextTags"] = false; - /** - * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - /** - * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. - */ - this["useTextTags"] = false; - /** - * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer\'s information during signing. **NOTE:** Keep your signer\'s information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. - */ - this["populateAutoFillFields"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - }, - { - name: "groupedSigners", - baseName: "grouped_signers", - type: "Array" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "allowFormView", - baseName: "allow_form_view", - type: "boolean" - }, - { - name: "allowReassign", - baseName: "allow_reassign", - type: "boolean" - }, - { - name: "attachments", - baseName: "attachments", - type: "Array" - }, - { - name: "ccEmailAddresses", - baseName: "cc_email_addresses", - type: "Array" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "fieldOptions", - baseName: "field_options", - type: "SubFieldOptions" - }, - { - name: "formFieldGroups", - baseName: "form_field_groups", - type: "Array" - }, - { - name: "formFieldRules", - baseName: "form_field_rules", - type: "Array" - }, - { - name: "formFieldsPerDocument", - baseName: "form_fields_per_document", - type: "Array" - }, - { - name: "hideTextTags", - baseName: "hide_text_tags", - type: "boolean" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "signingOptions", - baseName: "signing_options", - type: "SubSigningOptions" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "useTextTags", - baseName: "use_text_tags", - type: "boolean" - }, - { - name: "populateAutoFillFields", - baseName: "populate_auto_fill_fields", - type: "boolean" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestCreateEmbeddedRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestCreateEmbeddedRequest" - ); - } -}; - -// model/signatureRequestCreateEmbeddedWithTemplateRequest.ts -var SignatureRequestCreateEmbeddedWithTemplateRequest = class _SignatureRequestCreateEmbeddedWithTemplateRequest { - constructor() { - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - /** - * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer\'s information during signing. **NOTE:** Keep your signer\'s information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. - */ - this["populateAutoFillFields"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templateIds", - baseName: "template_ids", - type: "Array" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "ccs", - baseName: "ccs", - type: "Array" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "signingOptions", - baseName: "signing_options", - type: "SubSigningOptions" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "populateAutoFillFields", - baseName: "populate_auto_fill_fields", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestCreateEmbeddedWithTemplateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestCreateEmbeddedWithTemplateRequest" - ); - } -}; - -// model/signatureRequestEditEmbeddedRequest.ts -var SignatureRequestEditEmbeddedRequest = class _SignatureRequestEditEmbeddedRequest { - constructor() { - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. - */ - this["allowFormView"] = false; - /** - * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. - */ - this["allowReassign"] = false; - /** - * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. - */ - this["hideTextTags"] = false; - /** - * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - /** - * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. - */ - this["useTextTags"] = false; - /** - * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer\'s information during signing. **NOTE:** Keep your signer\'s information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. - */ - this["populateAutoFillFields"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - }, - { - name: "groupedSigners", - baseName: "grouped_signers", - type: "Array" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "allowFormView", - baseName: "allow_form_view", - type: "boolean" - }, - { - name: "allowReassign", - baseName: "allow_reassign", - type: "boolean" - }, - { - name: "attachments", - baseName: "attachments", - type: "Array" - }, - { - name: "ccEmailAddresses", - baseName: "cc_email_addresses", - type: "Array" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "fieldOptions", - baseName: "field_options", - type: "SubFieldOptions" - }, - { - name: "formFieldGroups", - baseName: "form_field_groups", - type: "Array" - }, - { - name: "formFieldRules", - baseName: "form_field_rules", - type: "Array" - }, - { - name: "formFieldsPerDocument", - baseName: "form_fields_per_document", - type: "Array" - }, - { - name: "hideTextTags", - baseName: "hide_text_tags", - type: "boolean" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "signingOptions", - baseName: "signing_options", - type: "SubSigningOptions" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "useTextTags", - baseName: "use_text_tags", - type: "boolean" - }, - { - name: "populateAutoFillFields", - baseName: "populate_auto_fill_fields", - type: "boolean" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestEditEmbeddedRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestEditEmbeddedRequest" - ); - } -}; - -// model/signatureRequestEditEmbeddedWithTemplateRequest.ts -var SignatureRequestEditEmbeddedWithTemplateRequest = class _SignatureRequestEditEmbeddedWithTemplateRequest { - constructor() { - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - /** - * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer\'s information during signing. **NOTE:** Keep your signer\'s information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. - */ - this["populateAutoFillFields"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templateIds", - baseName: "template_ids", - type: "Array" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "ccs", - baseName: "ccs", - type: "Array" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "signingOptions", - baseName: "signing_options", - type: "SubSigningOptions" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "populateAutoFillFields", - baseName: "populate_auto_fill_fields", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestEditEmbeddedWithTemplateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestEditEmbeddedWithTemplateRequest" - ); - } -}; - -// model/signatureRequestEditRequest.ts -var SignatureRequestEditRequest = class _SignatureRequestEditRequest { - constructor() { - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. - */ - this["allowFormView"] = false; - /** - * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. - */ - this["allowReassign"] = false; - /** - * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. - */ - this["hideTextTags"] = false; - /** - * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. - */ - this["isEid"] = false; - /** - * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - /** - * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. - */ - this["useTextTags"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - }, - { - name: "groupedSigners", - baseName: "grouped_signers", - type: "Array" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "allowFormView", - baseName: "allow_form_view", - type: "boolean" - }, - { - name: "allowReassign", - baseName: "allow_reassign", - type: "boolean" - }, - { - name: "attachments", - baseName: "attachments", - type: "Array" - }, - { - name: "ccEmailAddresses", - baseName: "cc_email_addresses", - type: "Array" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "fieldOptions", - baseName: "field_options", - type: "SubFieldOptions" - }, - { - name: "formFieldGroups", - baseName: "form_field_groups", - type: "Array" - }, - { - name: "formFieldRules", - baseName: "form_field_rules", - type: "Array" - }, - { - name: "formFieldsPerDocument", - baseName: "form_fields_per_document", - type: "Array" - }, - { - name: "hideTextTags", - baseName: "hide_text_tags", - type: "boolean" - }, - { - name: "isEid", - baseName: "is_eid", - type: "boolean" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "signingOptions", - baseName: "signing_options", - type: "SubSigningOptions" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "useTextTags", - baseName: "use_text_tags", - type: "boolean" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestEditRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SignatureRequestEditRequest"); - } -}; - -// model/signatureRequestEditWithTemplateRequest.ts -var SignatureRequestEditWithTemplateRequest = class _SignatureRequestEditWithTemplateRequest { - constructor() { - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. - */ - this["isEid"] = false; - /** - * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templateIds", - baseName: "template_ids", - type: "Array" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "ccs", - baseName: "ccs", - type: "Array" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "isEid", - baseName: "is_eid", - type: "boolean" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "signingOptions", - baseName: "signing_options", - type: "SubSigningOptions" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestEditWithTemplateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestEditWithTemplateRequest" - ); - } -}; - -// model/signatureRequestGetResponse.ts -var SignatureRequestGetResponse = class _SignatureRequestGetResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "signatureRequest", - baseName: "signature_request", - type: "SignatureRequestResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestGetResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SignatureRequestGetResponse"); - } -}; - -// model/signatureRequestListResponse.ts -var SignatureRequestListResponse = class _SignatureRequestListResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "signatureRequests", - baseName: "signature_requests", - type: "Array" - }, - { - name: "listInfo", - baseName: "list_info", - type: "ListInfoResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestListResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SignatureRequestListResponse"); - } -}; - -// model/signatureRequestRemindRequest.ts -var SignatureRequestRemindRequest = class _SignatureRequestRemindRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestRemindRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SignatureRequestRemindRequest"); - } -}; - -// model/signatureRequestResponse.ts -var SignatureRequestResponse = class _SignatureRequestResponse { - constructor() { - /** - * Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. - */ - this["testMode"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "signatureRequestId", - baseName: "signature_request_id", - type: "string" - }, - { - name: "requesterEmailAddress", - baseName: "requester_email_address", - type: "string" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "originalTitle", - baseName: "original_title", - type: "string" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "createdAt", - baseName: "created_at", - type: "number" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - }, - { - name: "isComplete", - baseName: "is_complete", - type: "boolean" - }, - { - name: "isDeclined", - baseName: "is_declined", - type: "boolean" - }, - { - name: "hasError", - baseName: "has_error", - type: "boolean" - }, - { - name: "filesUrl", - baseName: "files_url", - type: "string" - }, - { - name: "signingUrl", - baseName: "signing_url", - type: "string" - }, - { - name: "detailsUrl", - baseName: "details_url", - type: "string" - }, - { - name: "ccEmailAddresses", - baseName: "cc_email_addresses", - type: "Array" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "finalCopyUri", - baseName: "final_copy_uri", - type: "string" - }, - { - name: "templateIds", - baseName: "template_ids", - type: "Array" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "attachments", - baseName: "attachments", - type: "Array" - }, - { - name: "responseData", - baseName: "response_data", - type: "Array" - }, - { - name: "signatures", - baseName: "signatures", - type: "Array" - }, - { - name: "bulkSendJobId", - baseName: "bulk_send_job_id", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SignatureRequestResponse"); - } -}; - -// model/signatureRequestResponseAttachment.ts -var SignatureRequestResponseAttachment = class _SignatureRequestResponseAttachment { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "id", - baseName: "id", - type: "string" - }, - { - name: "signer", - baseName: "signer", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "required", - baseName: "required", - type: "boolean" - }, - { - name: "instructions", - baseName: "instructions", - type: "string" - }, - { - name: "uploadedAt", - baseName: "uploaded_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestResponseAttachment.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseAttachment" - ); - } -}; - -// model/signatureRequestResponseCustomFieldBase.ts -var SignatureRequestResponseCustomFieldBase = class _SignatureRequestResponseCustomFieldBase { - static { - this.discriminator = "type"; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "required", - baseName: "required", - type: "boolean" - }, - { - name: "apiId", - baseName: "api_id", - type: "string" - }, - { - name: "editor", - baseName: "editor", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestResponseCustomFieldBase.attributeTypeMap; - } - static discriminatorClassName(value) { - if (value === void 0 || value === null) { - return null; - } - if (value === "checkbox") { - return "SignatureRequestResponseCustomFieldCheckbox"; - } - if (value === "text") { - return "SignatureRequestResponseCustomFieldText"; - } - return null; - } -}; - -// model/signatureRequestResponseCustomFieldCheckbox.ts -var SignatureRequestResponseCustomFieldCheckbox = class _SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestResponseCustomFieldBase { - constructor() { - super(...arguments); - /** - * The type of this Custom Field. Only \'text\' and \'checkbox\' are currently supported. - */ - this["type"] = "checkbox"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "value", - baseName: "value", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SignatureRequestResponseCustomFieldCheckbox.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseCustomFieldCheckbox" - ); - } -}; - -// model/signatureRequestResponseCustomFieldText.ts -var SignatureRequestResponseCustomFieldText = class _SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCustomFieldBase { - constructor() { - super(...arguments); - /** - * The type of this Custom Field. Only \'text\' and \'checkbox\' are currently supported. - */ - this["type"] = "text"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "value", - baseName: "value", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SignatureRequestResponseCustomFieldText.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseCustomFieldText" - ); - } -}; - -// model/signatureRequestResponseCustomFieldTypeEnum.ts -var SignatureRequestResponseCustomFieldTypeEnum = /* @__PURE__ */ ((SignatureRequestResponseCustomFieldTypeEnum2) => { - SignatureRequestResponseCustomFieldTypeEnum2["Text"] = "text"; - SignatureRequestResponseCustomFieldTypeEnum2["Checkbox"] = "checkbox"; - return SignatureRequestResponseCustomFieldTypeEnum2; -})(SignatureRequestResponseCustomFieldTypeEnum || {}); - -// model/signatureRequestResponseDataBase.ts -var SignatureRequestResponseDataBase = class _SignatureRequestResponseDataBase { - static { - this.discriminator = "type"; - } - static { - this.attributeTypeMap = [ - { - name: "apiId", - baseName: "api_id", - type: "string" - }, - { - name: "signatureId", - baseName: "signature_id", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "required", - baseName: "required", - type: "boolean" - }, - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestResponseDataBase.attributeTypeMap; - } - static discriminatorClassName(value) { - if (value === void 0 || value === null) { - return null; - } - if (value === "checkbox") { - return "SignatureRequestResponseDataValueCheckbox"; - } - if (value === "checkbox-merge") { - return "SignatureRequestResponseDataValueCheckboxMerge"; - } - if (value === "date_signed") { - return "SignatureRequestResponseDataValueDateSigned"; - } - if (value === "dropdown") { - return "SignatureRequestResponseDataValueDropdown"; - } - if (value === "initials") { - return "SignatureRequestResponseDataValueInitials"; - } - if (value === "radio") { - return "SignatureRequestResponseDataValueRadio"; - } - if (value === "signature") { - return "SignatureRequestResponseDataValueSignature"; - } - if (value === "text") { - return "SignatureRequestResponseDataValueText"; - } - if (value === "text-merge") { - return "SignatureRequestResponseDataValueTextMerge"; - } - return null; - } -}; - -// model/signatureRequestResponseDataTypeEnum.ts -var SignatureRequestResponseDataTypeEnum = /* @__PURE__ */ ((SignatureRequestResponseDataTypeEnum2) => { - SignatureRequestResponseDataTypeEnum2["Text"] = "text"; - SignatureRequestResponseDataTypeEnum2["Checkbox"] = "checkbox"; - SignatureRequestResponseDataTypeEnum2["DateSigned"] = "date_signed"; - SignatureRequestResponseDataTypeEnum2["Dropdown"] = "dropdown"; - SignatureRequestResponseDataTypeEnum2["Initials"] = "initials"; - SignatureRequestResponseDataTypeEnum2["Radio"] = "radio"; - SignatureRequestResponseDataTypeEnum2["Signature"] = "signature"; - SignatureRequestResponseDataTypeEnum2["TextMerge"] = "text-merge"; - SignatureRequestResponseDataTypeEnum2["CheckboxMerge"] = "checkbox-merge"; - return SignatureRequestResponseDataTypeEnum2; -})(SignatureRequestResponseDataTypeEnum || {}); - -// model/signatureRequestResponseDataValueCheckbox.ts -var SignatureRequestResponseDataValueCheckbox = class _SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponseDataBase { - constructor() { - super(...arguments); - /** - * A yes/no checkbox - */ - this["type"] = "checkbox"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "value", - baseName: "value", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SignatureRequestResponseDataValueCheckbox.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseDataValueCheckbox" - ); - } -}; - -// model/signatureRequestResponseDataValueCheckboxMerge.ts -var SignatureRequestResponseDataValueCheckboxMerge = class _SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestResponseDataBase { - constructor() { - super(...arguments); - /** - * A checkbox field that has default value set by the api - */ - this["type"] = "checkbox-merge"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "value", - baseName: "value", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SignatureRequestResponseDataValueCheckboxMerge.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseDataValueCheckboxMerge" - ); - } -}; - -// model/signatureRequestResponseDataValueDateSigned.ts -var SignatureRequestResponseDataValueDateSigned = class _SignatureRequestResponseDataValueDateSigned extends SignatureRequestResponseDataBase { - constructor() { - super(...arguments); - /** - * A date - */ - this["type"] = "date_signed"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "value", - baseName: "value", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SignatureRequestResponseDataValueDateSigned.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseDataValueDateSigned" - ); - } -}; - -// model/signatureRequestResponseDataValueDropdown.ts -var SignatureRequestResponseDataValueDropdown = class _SignatureRequestResponseDataValueDropdown extends SignatureRequestResponseDataBase { - constructor() { - super(...arguments); - /** - * An input field for dropdowns - */ - this["type"] = "dropdown"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "value", - baseName: "value", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SignatureRequestResponseDataValueDropdown.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseDataValueDropdown" - ); - } -}; - -// model/signatureRequestResponseDataValueInitials.ts -var SignatureRequestResponseDataValueInitials = class _SignatureRequestResponseDataValueInitials extends SignatureRequestResponseDataBase { - constructor() { - super(...arguments); - /** - * An input field for initials - */ - this["type"] = "initials"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "value", - baseName: "value", - type: "string" - }, - { - name: "isSigned", - baseName: "is_signed", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SignatureRequestResponseDataValueInitials.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseDataValueInitials" - ); - } -}; - -// model/signatureRequestResponseDataValueRadio.ts -var SignatureRequestResponseDataValueRadio = class _SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDataBase { - constructor() { - super(...arguments); - /** - * An input field for radios - */ - this["type"] = "radio"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "value", - baseName: "value", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SignatureRequestResponseDataValueRadio.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseDataValueRadio" - ); - } -}; - -// model/signatureRequestResponseDataValueSignature.ts -var SignatureRequestResponseDataValueSignature = class _SignatureRequestResponseDataValueSignature extends SignatureRequestResponseDataBase { - constructor() { - super(...arguments); - /** - * A signature input field - */ - this["type"] = "signature"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "value", - baseName: "value", - type: "string" - }, - { - name: "isSigned", - baseName: "is_signed", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SignatureRequestResponseDataValueSignature.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseDataValueSignature" - ); - } -}; - -// model/signatureRequestResponseDataValueText.ts -var SignatureRequestResponseDataValueText = class _SignatureRequestResponseDataValueText extends SignatureRequestResponseDataBase { - constructor() { - super(...arguments); - /** - * A text input field - */ - this["type"] = "text"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "value", - baseName: "value", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SignatureRequestResponseDataValueText.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseDataValueText" - ); - } -}; - -// model/signatureRequestResponseDataValueTextMerge.ts -var SignatureRequestResponseDataValueTextMerge = class _SignatureRequestResponseDataValueTextMerge extends SignatureRequestResponseDataBase { - constructor() { - super(...arguments); - /** - * A text field that has default text set by the api - */ - this["type"] = "text-merge"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "value", - baseName: "value", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SignatureRequestResponseDataValueTextMerge.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseDataValueTextMerge" - ); - } -}; - -// model/signatureRequestResponseSignatures.ts -var SignatureRequestResponseSignatures = class _SignatureRequestResponseSignatures { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "signatureId", - baseName: "signature_id", - type: "string" - }, - { - name: "signerGroupGuid", - baseName: "signer_group_guid", - type: "string" - }, - { - name: "signerEmailAddress", - baseName: "signer_email_address", - type: "string" - }, - { - name: "signerName", - baseName: "signer_name", - type: "string" - }, - { - name: "signerRole", - baseName: "signer_role", - type: "string" - }, - { - name: "order", - baseName: "order", - type: "number" - }, - { - name: "statusCode", - baseName: "status_code", - type: "string" - }, - { - name: "declineReason", - baseName: "decline_reason", - type: "string" - }, - { - name: "signedAt", - baseName: "signed_at", - type: "number" - }, - { - name: "lastViewedAt", - baseName: "last_viewed_at", - type: "number" - }, - { - name: "lastRemindedAt", - baseName: "last_reminded_at", - type: "number" - }, - { - name: "hasPin", - baseName: "has_pin", - type: "boolean" - }, - { - name: "hasSmsAuth", - baseName: "has_sms_auth", - type: "boolean" - }, - { - name: "hasSmsDelivery", - baseName: "has_sms_delivery", - type: "boolean" - }, - { - name: "smsPhoneNumber", - baseName: "sms_phone_number", - type: "string" - }, - { - name: "reassignedBy", - baseName: "reassigned_by", - type: "string" - }, - { - name: "reassignmentReason", - baseName: "reassignment_reason", - type: "string" - }, - { - name: "reassignedFrom", - baseName: "reassigned_from", - type: "string" - }, - { - name: "error", - baseName: "error", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestResponseSignatures.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestResponseSignatures" - ); - } -}; - -// model/signatureRequestSendRequest.ts -var SignatureRequestSendRequest = class _SignatureRequestSendRequest { - constructor() { - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. - */ - this["allowReassign"] = false; - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. - */ - this["allowFormView"] = false; - /** - * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. - */ - this["hideTextTags"] = false; - /** - * Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer\'s identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. - * - * @deprecated - */ - this["isQualifiedSignature"] = false; - /** - * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. - */ - this["isEid"] = false; - /** - * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - /** - * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. - */ - this["useTextTags"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - }, - { - name: "groupedSigners", - baseName: "grouped_signers", - type: "Array" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "allowReassign", - baseName: "allow_reassign", - type: "boolean" - }, - { - name: "allowFormView", - baseName: "allow_form_view", - type: "boolean" - }, - { - name: "attachments", - baseName: "attachments", - type: "Array" - }, - { - name: "ccEmailAddresses", - baseName: "cc_email_addresses", - type: "Array" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "fieldOptions", - baseName: "field_options", - type: "SubFieldOptions" - }, - { - name: "formFieldGroups", - baseName: "form_field_groups", - type: "Array" - }, - { - name: "formFieldRules", - baseName: "form_field_rules", - type: "Array" - }, - { - name: "formFieldsPerDocument", - baseName: "form_fields_per_document", - type: "Array" - }, - { - name: "hideTextTags", - baseName: "hide_text_tags", - type: "boolean" - }, - { - name: "isQualifiedSignature", - baseName: "is_qualified_signature", - type: "boolean" - }, - { - name: "isEid", - baseName: "is_eid", - type: "boolean" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "signingOptions", - baseName: "signing_options", - type: "SubSigningOptions" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "useTextTags", - baseName: "use_text_tags", - type: "boolean" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestSendRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SignatureRequestSendRequest"); - } -}; - -// model/signatureRequestSendWithTemplateRequest.ts -var SignatureRequestSendWithTemplateRequest = class _SignatureRequestSendWithTemplateRequest { - constructor() { - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer\'s identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. - * - * @deprecated - */ - this["isQualifiedSignature"] = false; - /** - * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. - */ - this["isEid"] = false; - /** - * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templateIds", - baseName: "template_ids", - type: "Array" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "ccs", - baseName: "ccs", - type: "Array" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "isQualifiedSignature", - baseName: "is_qualified_signature", - type: "boolean" - }, - { - name: "isEid", - baseName: "is_eid", - type: "boolean" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "signingOptions", - baseName: "signing_options", - type: "SubSigningOptions" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestSendWithTemplateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestSendWithTemplateRequest" - ); - } -}; - -// model/signatureRequestUpdateRequest.ts -var SignatureRequestUpdateRequest = class _SignatureRequestUpdateRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "signatureId", - baseName: "signature_id", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _SignatureRequestUpdateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SignatureRequestUpdateRequest"); - } -}; - -// model/subAttachment.ts -var SubAttachment = class _SubAttachment { - constructor() { - /** - * Determines if the attachment must be uploaded. - */ - this["required"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "signerIndex", - baseName: "signer_index", - type: "number" - }, - { - name: "instructions", - baseName: "instructions", - type: "string" - }, - { - name: "required", - baseName: "required", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _SubAttachment.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubAttachment"); - } -}; - -// model/subBulkSignerList.ts -var SubBulkSignerList = class _SubBulkSignerList { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _SubBulkSignerList.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubBulkSignerList"); - } -}; - -// model/subBulkSignerListCustomField.ts -var SubBulkSignerListCustomField = class _SubBulkSignerListCustomField { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "value", - baseName: "value", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SubBulkSignerListCustomField.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubBulkSignerListCustomField"); - } -}; - -// model/subCC.ts -var SubCC = class _SubCC { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "role", - baseName: "role", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SubCC.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubCC"); - } -}; - -// model/subCustomField.ts -var SubCustomField = class _SubCustomField { - constructor() { - /** - * Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`. - */ - this["required"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "editor", - baseName: "editor", - type: "string" - }, - { - name: "required", - baseName: "required", - type: "boolean" - }, - { - name: "value", - baseName: "value", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SubCustomField.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubCustomField"); - } -}; - -// model/subEditorOptions.ts -var SubEditorOptions = class _SubEditorOptions { - constructor() { - /** - * Allows requesters to edit the list of signers - */ - this["allowEditSigners"] = false; - /** - * Allows requesters to edit documents, including delete and add - */ - this["allowEditDocuments"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "allowEditSigners", - baseName: "allow_edit_signers", - type: "boolean" - }, - { - name: "allowEditDocuments", - baseName: "allow_edit_documents", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _SubEditorOptions.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubEditorOptions"); - } -}; - -// model/subFieldOptions.ts -var SubFieldOptions = class _SubFieldOptions { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "dateFormat", - baseName: "date_format", - type: "SubFieldOptions.DateFormatEnum" - } - ]; - } - static getAttributeTypeMap() { - return _SubFieldOptions.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubFieldOptions"); - } -}; -((SubFieldOptions2) => { - let DateFormatEnum; - ((DateFormatEnum2) => { - DateFormatEnum2["MMDDYYYY"] = "MM / DD / YYYY"; - DateFormatEnum2["MM_DD_YYYY"] = "MM - DD - YYYY"; - DateFormatEnum2["DDMMYYYY"] = "DD / MM / YYYY"; - DateFormatEnum2["DD_MM_YYYY"] = "DD - MM - YYYY"; - DateFormatEnum2["YYYYMMDD"] = "YYYY / MM / DD"; - DateFormatEnum2["YYYY_MM_DD"] = "YYYY - MM - DD"; - })(DateFormatEnum = SubFieldOptions2.DateFormatEnum || (SubFieldOptions2.DateFormatEnum = {})); -})(SubFieldOptions || (SubFieldOptions = {})); - -// model/subFormFieldGroup.ts -var SubFormFieldGroup = class _SubFormFieldGroup { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "groupId", - baseName: "group_id", - type: "string" - }, - { - name: "groupLabel", - baseName: "group_label", - type: "string" - }, - { - name: "requirement", - baseName: "requirement", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SubFormFieldGroup.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubFormFieldGroup"); - } -}; - -// model/subFormFieldRule.ts -var SubFormFieldRule = class _SubFormFieldRule { - constructor() { - /** - * Currently only `AND` is supported. Support for `OR` is being worked on. - */ - this["triggerOperator"] = "AND"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "id", - baseName: "id", - type: "string" - }, - { - name: "triggerOperator", - baseName: "trigger_operator", - type: "string" - }, - { - name: "triggers", - baseName: "triggers", - type: "Array" - }, - { - name: "actions", - baseName: "actions", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _SubFormFieldRule.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubFormFieldRule"); - } -}; - -// model/subFormFieldRuleAction.ts -var SubFormFieldRuleAction = class _SubFormFieldRuleAction { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "hidden", - baseName: "hidden", - type: "boolean" - }, - { - name: "type", - baseName: "type", - type: "SubFormFieldRuleAction.TypeEnum" - }, - { - name: "fieldId", - baseName: "field_id", - type: "string" - }, - { - name: "groupId", - baseName: "group_id", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SubFormFieldRuleAction.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubFormFieldRuleAction"); - } -}; -((SubFormFieldRuleAction2) => { - let TypeEnum; - ((TypeEnum2) => { - TypeEnum2["ChangeFieldVisibility"] = "change-field-visibility"; - TypeEnum2["FieldVisibility"] = "change-field-visibility"; - TypeEnum2["ChangeGroupVisibility"] = "change-group-visibility"; - TypeEnum2["GroupVisibility"] = "change-group-visibility"; - })(TypeEnum = SubFormFieldRuleAction2.TypeEnum || (SubFormFieldRuleAction2.TypeEnum = {})); -})(SubFormFieldRuleAction || (SubFormFieldRuleAction = {})); - -// model/subFormFieldRuleTrigger.ts -var SubFormFieldRuleTrigger = class _SubFormFieldRuleTrigger { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "id", - baseName: "id", - type: "string" - }, - { - name: "operator", - baseName: "operator", - type: "SubFormFieldRuleTrigger.OperatorEnum" - }, - { - name: "value", - baseName: "value", - type: "string" - }, - { - name: "values", - baseName: "values", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _SubFormFieldRuleTrigger.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubFormFieldRuleTrigger"); - } -}; -((SubFormFieldRuleTrigger2) => { - let OperatorEnum; - ((OperatorEnum2) => { - OperatorEnum2["Any"] = "any"; - OperatorEnum2["Is"] = "is"; - OperatorEnum2["Match"] = "match"; - OperatorEnum2["None"] = "none"; - OperatorEnum2["Not"] = "not"; - })(OperatorEnum = SubFormFieldRuleTrigger2.OperatorEnum || (SubFormFieldRuleTrigger2.OperatorEnum = {})); -})(SubFormFieldRuleTrigger || (SubFormFieldRuleTrigger = {})); - -// model/subFormFieldsPerDocumentBase.ts -var SubFormFieldsPerDocumentBase = class _SubFormFieldsPerDocumentBase { - static { - this.discriminator = "type"; - } - static { - this.attributeTypeMap = [ - { - name: "documentIndex", - baseName: "document_index", - type: "number" - }, - { - name: "apiId", - baseName: "api_id", - type: "string" - }, - { - name: "height", - baseName: "height", - type: "number" - }, - { - name: "required", - baseName: "required", - type: "boolean" - }, - { - name: "signer", - baseName: "signer", - type: "string" - }, - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "width", - baseName: "width", - type: "number" - }, - { - name: "x", - baseName: "x", - type: "number" - }, - { - name: "y", - baseName: "y", - type: "number" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "page", - baseName: "page", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _SubFormFieldsPerDocumentBase.attributeTypeMap; - } - static discriminatorClassName(value) { - if (value === void 0 || value === null) { - return null; - } - if (value === "checkbox") { - return "SubFormFieldsPerDocumentCheckbox"; - } - if (value === "checkbox-merge") { - return "SubFormFieldsPerDocumentCheckboxMerge"; - } - if (value === "date_signed") { - return "SubFormFieldsPerDocumentDateSigned"; - } - if (value === "dropdown") { - return "SubFormFieldsPerDocumentDropdown"; - } - if (value === "hyperlink") { - return "SubFormFieldsPerDocumentHyperlink"; - } - if (value === "initials") { - return "SubFormFieldsPerDocumentInitials"; - } - if (value === "radio") { - return "SubFormFieldsPerDocumentRadio"; - } - if (value === "signature") { - return "SubFormFieldsPerDocumentSignature"; - } - if (value === "text") { - return "SubFormFieldsPerDocumentText"; - } - if (value === "text-merge") { - return "SubFormFieldsPerDocumentTextMerge"; - } - return null; - } -}; - -// model/subFormFieldsPerDocumentCheckbox.ts -var SubFormFieldsPerDocumentCheckbox = class _SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase { - constructor() { - super(...arguments); - /** - * A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. - */ - this["type"] = "checkbox"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "isChecked", - baseName: "is_checked", - type: "boolean" - }, - { - name: "group", - baseName: "group", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SubFormFieldsPerDocumentCheckbox.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SubFormFieldsPerDocumentCheckbox" - ); - } -}; - -// model/subFormFieldsPerDocumentCheckboxMerge.ts -var SubFormFieldsPerDocumentCheckboxMerge = class _SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase { - constructor() { - super(...arguments); - /** - * A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. - */ - this["type"] = "checkbox-merge"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SubFormFieldsPerDocumentCheckboxMerge.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SubFormFieldsPerDocumentCheckboxMerge" - ); - } -}; - -// model/subFormFieldsPerDocumentDateSigned.ts -var SubFormFieldsPerDocumentDateSigned = class _SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase { - constructor() { - super(...arguments); - /** - * A date. Use the `SubFormFieldsPerDocumentDateSigned` class. - */ - this["type"] = "date_signed"; - /** - * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. - */ - this["fontSize"] = 12; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "fontFamily", - baseName: "font_family", - type: "SubFormFieldsPerDocumentDateSigned.FontFamilyEnum" - }, - { - name: "fontSize", - baseName: "font_size", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SubFormFieldsPerDocumentDateSigned.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SubFormFieldsPerDocumentDateSigned" - ); - } -}; -((SubFormFieldsPerDocumentDateSigned2) => { - let FontFamilyEnum; - ((FontFamilyEnum2) => { - FontFamilyEnum2["Helvetica"] = "helvetica"; - FontFamilyEnum2["Arial"] = "arial"; - FontFamilyEnum2["Courier"] = "courier"; - FontFamilyEnum2["Calibri"] = "calibri"; - FontFamilyEnum2["Cambria"] = "cambria"; - FontFamilyEnum2["Georgia"] = "georgia"; - FontFamilyEnum2["Times"] = "times"; - FontFamilyEnum2["Trebuchet"] = "trebuchet"; - FontFamilyEnum2["Verdana"] = "verdana"; - FontFamilyEnum2["Roboto"] = "roboto"; - FontFamilyEnum2["RobotoMono"] = "robotoMono"; - FontFamilyEnum2["NotoSans"] = "notoSans"; - FontFamilyEnum2["NotoSerif"] = "notoSerif"; - FontFamilyEnum2["NotoCjkJpRegular"] = "notoCJK-JP-Regular"; - FontFamilyEnum2["NotoHebrewRegular"] = "notoHebrew-Regular"; - FontFamilyEnum2["NotoSanThaiMerged"] = "notoSanThaiMerged"; - })(FontFamilyEnum = SubFormFieldsPerDocumentDateSigned2.FontFamilyEnum || (SubFormFieldsPerDocumentDateSigned2.FontFamilyEnum = {})); -})(SubFormFieldsPerDocumentDateSigned || (SubFormFieldsPerDocumentDateSigned = {})); - -// model/subFormFieldsPerDocumentDropdown.ts -var SubFormFieldsPerDocumentDropdown = class _SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase { - constructor() { - super(...arguments); - /** - * An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. - */ - this["type"] = "dropdown"; - /** - * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. - */ - this["fontSize"] = 12; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "options", - baseName: "options", - type: "Array" - }, - { - name: "content", - baseName: "content", - type: "string" - }, - { - name: "fontFamily", - baseName: "font_family", - type: "SubFormFieldsPerDocumentDropdown.FontFamilyEnum" - }, - { - name: "fontSize", - baseName: "font_size", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SubFormFieldsPerDocumentDropdown.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SubFormFieldsPerDocumentDropdown" - ); - } -}; -((SubFormFieldsPerDocumentDropdown2) => { - let FontFamilyEnum; - ((FontFamilyEnum2) => { - FontFamilyEnum2["Helvetica"] = "helvetica"; - FontFamilyEnum2["Arial"] = "arial"; - FontFamilyEnum2["Courier"] = "courier"; - FontFamilyEnum2["Calibri"] = "calibri"; - FontFamilyEnum2["Cambria"] = "cambria"; - FontFamilyEnum2["Georgia"] = "georgia"; - FontFamilyEnum2["Times"] = "times"; - FontFamilyEnum2["Trebuchet"] = "trebuchet"; - FontFamilyEnum2["Verdana"] = "verdana"; - FontFamilyEnum2["Roboto"] = "roboto"; - FontFamilyEnum2["RobotoMono"] = "robotoMono"; - FontFamilyEnum2["NotoSans"] = "notoSans"; - FontFamilyEnum2["NotoSerif"] = "notoSerif"; - FontFamilyEnum2["NotoCjkJpRegular"] = "notoCJK-JP-Regular"; - FontFamilyEnum2["NotoHebrewRegular"] = "notoHebrew-Regular"; - FontFamilyEnum2["NotoSanThaiMerged"] = "notoSanThaiMerged"; - })(FontFamilyEnum = SubFormFieldsPerDocumentDropdown2.FontFamilyEnum || (SubFormFieldsPerDocumentDropdown2.FontFamilyEnum = {})); -})(SubFormFieldsPerDocumentDropdown || (SubFormFieldsPerDocumentDropdown = {})); - -// model/subFormFieldsPerDocumentFontEnum.ts -var SubFormFieldsPerDocumentFontEnum = /* @__PURE__ */ ((SubFormFieldsPerDocumentFontEnum2) => { - SubFormFieldsPerDocumentFontEnum2["Helvetica"] = "helvetica"; - SubFormFieldsPerDocumentFontEnum2["Arial"] = "arial"; - SubFormFieldsPerDocumentFontEnum2["Courier"] = "courier"; - SubFormFieldsPerDocumentFontEnum2["Calibri"] = "calibri"; - SubFormFieldsPerDocumentFontEnum2["Cambria"] = "cambria"; - SubFormFieldsPerDocumentFontEnum2["Georgia"] = "georgia"; - SubFormFieldsPerDocumentFontEnum2["Times"] = "times"; - SubFormFieldsPerDocumentFontEnum2["Trebuchet"] = "trebuchet"; - SubFormFieldsPerDocumentFontEnum2["Verdana"] = "verdana"; - SubFormFieldsPerDocumentFontEnum2["Roboto"] = "roboto"; - SubFormFieldsPerDocumentFontEnum2["RobotoMono"] = "robotoMono"; - SubFormFieldsPerDocumentFontEnum2["NotoSans"] = "notoSans"; - SubFormFieldsPerDocumentFontEnum2["NotoSerif"] = "notoSerif"; - SubFormFieldsPerDocumentFontEnum2["NotoCjkJpRegular"] = "notoCJK-JP-Regular"; - SubFormFieldsPerDocumentFontEnum2["NotoHebrewRegular"] = "notoHebrew-Regular"; - SubFormFieldsPerDocumentFontEnum2["NotoSanThaiMerged"] = "notoSanThaiMerged"; - return SubFormFieldsPerDocumentFontEnum2; -})(SubFormFieldsPerDocumentFontEnum || {}); - -// model/subFormFieldsPerDocumentHyperlink.ts -var SubFormFieldsPerDocumentHyperlink = class _SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase { - constructor() { - super(...arguments); - /** - * A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. - */ - this["type"] = "hyperlink"; - /** - * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. - */ - this["fontSize"] = 12; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "content", - baseName: "content", - type: "string" - }, - { - name: "contentUrl", - baseName: "content_url", - type: "string" - }, - { - name: "fontFamily", - baseName: "font_family", - type: "SubFormFieldsPerDocumentHyperlink.FontFamilyEnum" - }, - { - name: "fontSize", - baseName: "font_size", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SubFormFieldsPerDocumentHyperlink.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SubFormFieldsPerDocumentHyperlink" - ); - } -}; -((SubFormFieldsPerDocumentHyperlink2) => { - let FontFamilyEnum; - ((FontFamilyEnum2) => { - FontFamilyEnum2["Helvetica"] = "helvetica"; - FontFamilyEnum2["Arial"] = "arial"; - FontFamilyEnum2["Courier"] = "courier"; - FontFamilyEnum2["Calibri"] = "calibri"; - FontFamilyEnum2["Cambria"] = "cambria"; - FontFamilyEnum2["Georgia"] = "georgia"; - FontFamilyEnum2["Times"] = "times"; - FontFamilyEnum2["Trebuchet"] = "trebuchet"; - FontFamilyEnum2["Verdana"] = "verdana"; - FontFamilyEnum2["Roboto"] = "roboto"; - FontFamilyEnum2["RobotoMono"] = "robotoMono"; - FontFamilyEnum2["NotoSans"] = "notoSans"; - FontFamilyEnum2["NotoSerif"] = "notoSerif"; - FontFamilyEnum2["NotoCjkJpRegular"] = "notoCJK-JP-Regular"; - FontFamilyEnum2["NotoHebrewRegular"] = "notoHebrew-Regular"; - FontFamilyEnum2["NotoSanThaiMerged"] = "notoSanThaiMerged"; - })(FontFamilyEnum = SubFormFieldsPerDocumentHyperlink2.FontFamilyEnum || (SubFormFieldsPerDocumentHyperlink2.FontFamilyEnum = {})); -})(SubFormFieldsPerDocumentHyperlink || (SubFormFieldsPerDocumentHyperlink = {})); - -// model/subFormFieldsPerDocumentInitials.ts -var SubFormFieldsPerDocumentInitials = class _SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase { - constructor() { - super(...arguments); - /** - * An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. - */ - this["type"] = "initials"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SubFormFieldsPerDocumentInitials.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SubFormFieldsPerDocumentInitials" - ); - } -}; - -// model/subFormFieldsPerDocumentRadio.ts -var SubFormFieldsPerDocumentRadio = class _SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase { - constructor() { - super(...arguments); - /** - * An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. - */ - this["type"] = "radio"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "group", - baseName: "group", - type: "string" - }, - { - name: "isChecked", - baseName: "is_checked", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SubFormFieldsPerDocumentRadio.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubFormFieldsPerDocumentRadio"); - } -}; - -// model/subFormFieldsPerDocumentSignature.ts -var SubFormFieldsPerDocumentSignature = class _SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase { - constructor() { - super(...arguments); - /** - * A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. - */ - this["type"] = "signature"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SubFormFieldsPerDocumentSignature.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SubFormFieldsPerDocumentSignature" - ); - } -}; - -// model/subFormFieldsPerDocumentText.ts -var SubFormFieldsPerDocumentText = class _SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase { - constructor() { - super(...arguments); - /** - * A text input field. Use the `SubFormFieldsPerDocumentText` class. - */ - this["type"] = "text"; - /** - * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. - */ - this["fontSize"] = 12; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "placeholder", - baseName: "placeholder", - type: "string" - }, - { - name: "autoFillType", - baseName: "auto_fill_type", - type: "string" - }, - { - name: "linkId", - baseName: "link_id", - type: "string" - }, - { - name: "masked", - baseName: "masked", - type: "boolean" - }, - { - name: "validationType", - baseName: "validation_type", - type: "SubFormFieldsPerDocumentText.ValidationTypeEnum" - }, - { - name: "validationCustomRegex", - baseName: "validation_custom_regex", - type: "string" - }, - { - name: "validationCustomRegexFormatLabel", - baseName: "validation_custom_regex_format_label", - type: "string" - }, - { - name: "content", - baseName: "content", - type: "string" - }, - { - name: "fontFamily", - baseName: "font_family", - type: "SubFormFieldsPerDocumentText.FontFamilyEnum" - }, - { - name: "fontSize", - baseName: "font_size", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SubFormFieldsPerDocumentText.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubFormFieldsPerDocumentText"); - } -}; -((SubFormFieldsPerDocumentText2) => { - let ValidationTypeEnum; - ((ValidationTypeEnum2) => { - ValidationTypeEnum2["NumbersOnly"] = "numbers_only"; - ValidationTypeEnum2["LettersOnly"] = "letters_only"; - ValidationTypeEnum2["PhoneNumber"] = "phone_number"; - ValidationTypeEnum2["BankRoutingNumber"] = "bank_routing_number"; - ValidationTypeEnum2["BankAccountNumber"] = "bank_account_number"; - ValidationTypeEnum2["EmailAddress"] = "email_address"; - ValidationTypeEnum2["ZipCode"] = "zip_code"; - ValidationTypeEnum2["SocialSecurityNumber"] = "social_security_number"; - ValidationTypeEnum2["EmployerIdentificationNumber"] = "employer_identification_number"; - ValidationTypeEnum2["CustomRegex"] = "custom_regex"; - })(ValidationTypeEnum = SubFormFieldsPerDocumentText2.ValidationTypeEnum || (SubFormFieldsPerDocumentText2.ValidationTypeEnum = {})); - let FontFamilyEnum; - ((FontFamilyEnum2) => { - FontFamilyEnum2["Helvetica"] = "helvetica"; - FontFamilyEnum2["Arial"] = "arial"; - FontFamilyEnum2["Courier"] = "courier"; - FontFamilyEnum2["Calibri"] = "calibri"; - FontFamilyEnum2["Cambria"] = "cambria"; - FontFamilyEnum2["Georgia"] = "georgia"; - FontFamilyEnum2["Times"] = "times"; - FontFamilyEnum2["Trebuchet"] = "trebuchet"; - FontFamilyEnum2["Verdana"] = "verdana"; - FontFamilyEnum2["Roboto"] = "roboto"; - FontFamilyEnum2["RobotoMono"] = "robotoMono"; - FontFamilyEnum2["NotoSans"] = "notoSans"; - FontFamilyEnum2["NotoSerif"] = "notoSerif"; - FontFamilyEnum2["NotoCjkJpRegular"] = "notoCJK-JP-Regular"; - FontFamilyEnum2["NotoHebrewRegular"] = "notoHebrew-Regular"; - FontFamilyEnum2["NotoSanThaiMerged"] = "notoSanThaiMerged"; - })(FontFamilyEnum = SubFormFieldsPerDocumentText2.FontFamilyEnum || (SubFormFieldsPerDocumentText2.FontFamilyEnum = {})); -})(SubFormFieldsPerDocumentText || (SubFormFieldsPerDocumentText = {})); - -// model/subFormFieldsPerDocumentTextMerge.ts -var SubFormFieldsPerDocumentTextMerge = class _SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase { - constructor() { - super(...arguments); - /** - * A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. - */ - this["type"] = "text-merge"; - /** - * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. - */ - this["fontSize"] = 12; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "fontFamily", - baseName: "font_family", - type: "SubFormFieldsPerDocumentTextMerge.FontFamilyEnum" - }, - { - name: "fontSize", - baseName: "font_size", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_SubFormFieldsPerDocumentTextMerge.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SubFormFieldsPerDocumentTextMerge" - ); - } -}; -((SubFormFieldsPerDocumentTextMerge2) => { - let FontFamilyEnum; - ((FontFamilyEnum2) => { - FontFamilyEnum2["Helvetica"] = "helvetica"; - FontFamilyEnum2["Arial"] = "arial"; - FontFamilyEnum2["Courier"] = "courier"; - FontFamilyEnum2["Calibri"] = "calibri"; - FontFamilyEnum2["Cambria"] = "cambria"; - FontFamilyEnum2["Georgia"] = "georgia"; - FontFamilyEnum2["Times"] = "times"; - FontFamilyEnum2["Trebuchet"] = "trebuchet"; - FontFamilyEnum2["Verdana"] = "verdana"; - FontFamilyEnum2["Roboto"] = "roboto"; - FontFamilyEnum2["RobotoMono"] = "robotoMono"; - FontFamilyEnum2["NotoSans"] = "notoSans"; - FontFamilyEnum2["NotoSerif"] = "notoSerif"; - FontFamilyEnum2["NotoCjkJpRegular"] = "notoCJK-JP-Regular"; - FontFamilyEnum2["NotoHebrewRegular"] = "notoHebrew-Regular"; - FontFamilyEnum2["NotoSanThaiMerged"] = "notoSanThaiMerged"; - })(FontFamilyEnum = SubFormFieldsPerDocumentTextMerge2.FontFamilyEnum || (SubFormFieldsPerDocumentTextMerge2.FontFamilyEnum = {})); -})(SubFormFieldsPerDocumentTextMerge || (SubFormFieldsPerDocumentTextMerge = {})); - -// model/subFormFieldsPerDocumentTypeEnum.ts -var SubFormFieldsPerDocumentTypeEnum = /* @__PURE__ */ ((SubFormFieldsPerDocumentTypeEnum2) => { - SubFormFieldsPerDocumentTypeEnum2["Checkbox"] = "checkbox"; - SubFormFieldsPerDocumentTypeEnum2["CheckboxMerge"] = "checkbox-merge"; - SubFormFieldsPerDocumentTypeEnum2["DateSigned"] = "date_signed"; - SubFormFieldsPerDocumentTypeEnum2["Dropdown"] = "dropdown"; - SubFormFieldsPerDocumentTypeEnum2["Hyperlink"] = "hyperlink"; - SubFormFieldsPerDocumentTypeEnum2["Initials"] = "initials"; - SubFormFieldsPerDocumentTypeEnum2["Signature"] = "signature"; - SubFormFieldsPerDocumentTypeEnum2["Radio"] = "radio"; - SubFormFieldsPerDocumentTypeEnum2["Text"] = "text"; - SubFormFieldsPerDocumentTypeEnum2["TextMerge"] = "text-merge"; - return SubFormFieldsPerDocumentTypeEnum2; -})(SubFormFieldsPerDocumentTypeEnum || {}); - -// model/subMergeField.ts -var SubMergeField = class _SubMergeField { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "type", - baseName: "type", - type: "SubMergeField.TypeEnum" - } - ]; - } - static getAttributeTypeMap() { - return _SubMergeField.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubMergeField"); - } -}; -((SubMergeField2) => { - let TypeEnum; - ((TypeEnum2) => { - TypeEnum2["Text"] = "text"; - TypeEnum2["Checkbox"] = "checkbox"; - })(TypeEnum = SubMergeField2.TypeEnum || (SubMergeField2.TypeEnum = {})); -})(SubMergeField || (SubMergeField = {})); - -// model/subOAuth.ts -var SubOAuth = class _SubOAuth { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "callbackUrl", - baseName: "callback_url", - type: "string" - }, - { - name: "scopes", - baseName: "scopes", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _SubOAuth.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubOAuth"); - } -}; -((SubOAuth2) => { - let ScopesEnum; - ((ScopesEnum2) => { - ScopesEnum2["RequestSignature"] = "request_signature"; - ScopesEnum2["BasicAccountInfo"] = "basic_account_info"; - ScopesEnum2["AccountAccess"] = "account_access"; - ScopesEnum2["SignatureRequestAccess"] = "signature_request_access"; - ScopesEnum2["TemplateAccess"] = "template_access"; - ScopesEnum2["TeamAccess"] = "team_access"; - ScopesEnum2["ApiAppAccess"] = "api_app_access"; - ScopesEnum2["Empty"] = ""; - })(ScopesEnum = SubOAuth2.ScopesEnum || (SubOAuth2.ScopesEnum = {})); -})(SubOAuth || (SubOAuth = {})); - -// model/subOptions.ts -var SubOptions = class _SubOptions { - constructor() { - /** - * Determines if signers can use \"Insert Everywhere\" when signing a document. - */ - this["canInsertEverywhere"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "canInsertEverywhere", - baseName: "can_insert_everywhere", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _SubOptions.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubOptions"); - } -}; - -// model/subSignatureRequestGroupedSigners.ts -var SubSignatureRequestGroupedSigners = class _SubSignatureRequestGroupedSigners { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "group", - baseName: "group", - type: "string" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - }, - { - name: "order", - baseName: "order", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _SubSignatureRequestGroupedSigners.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SubSignatureRequestGroupedSigners" - ); - } -}; - -// model/subSignatureRequestSigner.ts -var SubSignatureRequestSigner = class _SubSignatureRequestSigner { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "order", - baseName: "order", - type: "number" - }, - { - name: "pin", - baseName: "pin", - type: "string" - }, - { - name: "smsPhoneNumber", - baseName: "sms_phone_number", - type: "string" - }, - { - name: "smsPhoneNumberType", - baseName: "sms_phone_number_type", - type: "SubSignatureRequestSigner.SmsPhoneNumberTypeEnum" - } - ]; - } - static getAttributeTypeMap() { - return _SubSignatureRequestSigner.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubSignatureRequestSigner"); - } -}; -((SubSignatureRequestSigner2) => { - let SmsPhoneNumberTypeEnum; - ((SmsPhoneNumberTypeEnum2) => { - SmsPhoneNumberTypeEnum2["Authentication"] = "authentication"; - SmsPhoneNumberTypeEnum2["Delivery"] = "delivery"; - })(SmsPhoneNumberTypeEnum = SubSignatureRequestSigner2.SmsPhoneNumberTypeEnum || (SubSignatureRequestSigner2.SmsPhoneNumberTypeEnum = {})); -})(SubSignatureRequestSigner || (SubSignatureRequestSigner = {})); - -// model/subSignatureRequestTemplateSigner.ts -var SubSignatureRequestTemplateSigner = class _SubSignatureRequestTemplateSigner { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "role", - baseName: "role", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "pin", - baseName: "pin", - type: "string" - }, - { - name: "smsPhoneNumber", - baseName: "sms_phone_number", - type: "string" - }, - { - name: "smsPhoneNumberType", - baseName: "sms_phone_number_type", - type: "SubSignatureRequestTemplateSigner.SmsPhoneNumberTypeEnum" - } - ]; - } - static getAttributeTypeMap() { - return _SubSignatureRequestTemplateSigner.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SubSignatureRequestTemplateSigner" - ); - } -}; -((SubSignatureRequestTemplateSigner2) => { - let SmsPhoneNumberTypeEnum; - ((SmsPhoneNumberTypeEnum2) => { - SmsPhoneNumberTypeEnum2["Authentication"] = "authentication"; - SmsPhoneNumberTypeEnum2["Delivery"] = "delivery"; - })(SmsPhoneNumberTypeEnum = SubSignatureRequestTemplateSigner2.SmsPhoneNumberTypeEnum || (SubSignatureRequestTemplateSigner2.SmsPhoneNumberTypeEnum = {})); -})(SubSignatureRequestTemplateSigner || (SubSignatureRequestTemplateSigner = {})); - -// model/subSigningOptions.ts -var SubSigningOptions = class _SubSigningOptions { - constructor() { - /** - * Allows drawing the signature - */ - this["draw"] = false; - /** - * Allows using a smartphone to email the signature - */ - this["phone"] = false; - /** - * Allows typing the signature - */ - this["type"] = false; - /** - * Allows uploading the signature - */ - this["upload"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "defaultType", - baseName: "default_type", - type: "SubSigningOptions.DefaultTypeEnum" - }, - { - name: "draw", - baseName: "draw", - type: "boolean" - }, - { - name: "phone", - baseName: "phone", - type: "boolean" - }, - { - name: "type", - baseName: "type", - type: "boolean" - }, - { - name: "upload", - baseName: "upload", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _SubSigningOptions.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubSigningOptions"); - } -}; -((SubSigningOptions2) => { - let DefaultTypeEnum; - ((DefaultTypeEnum2) => { - DefaultTypeEnum2["Draw"] = "draw"; - DefaultTypeEnum2["Phone"] = "phone"; - DefaultTypeEnum2["Type"] = "type"; - DefaultTypeEnum2["Upload"] = "upload"; - })(DefaultTypeEnum = SubSigningOptions2.DefaultTypeEnum || (SubSigningOptions2.DefaultTypeEnum = {})); -})(SubSigningOptions || (SubSigningOptions = {})); - -// model/subTeamResponse.ts -var SubTeamResponse = class _SubTeamResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "teamId", - baseName: "team_id", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SubTeamResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubTeamResponse"); - } -}; - -// model/subTemplateRole.ts -var SubTemplateRole = class _SubTemplateRole { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "order", - baseName: "order", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _SubTemplateRole.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubTemplateRole"); - } -}; - -// model/subUnclaimedDraftSigner.ts -var SubUnclaimedDraftSigner = class _SubUnclaimedDraftSigner { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "order", - baseName: "order", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _SubUnclaimedDraftSigner.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubUnclaimedDraftSigner"); - } -}; - -// model/subUnclaimedDraftTemplateSigner.ts -var SubUnclaimedDraftTemplateSigner = class _SubUnclaimedDraftTemplateSigner { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "role", - baseName: "role", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _SubUnclaimedDraftTemplateSigner.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "SubUnclaimedDraftTemplateSigner" - ); - } -}; - -// model/subWhiteLabelingOptions.ts -var SubWhiteLabelingOptions = class _SubWhiteLabelingOptions { - constructor() { - this["headerBackgroundColor"] = "#1a1a1a"; - this["legalVersion"] = _SubWhiteLabelingOptions.LegalVersionEnum.Terms1; - this["linkColor"] = "#0061FE"; - this["pageBackgroundColor"] = "#f7f8f9"; - this["primaryButtonColor"] = "#0061FE"; - this["primaryButtonColorHover"] = "#0061FE"; - this["primaryButtonTextColor"] = "#ffffff"; - this["primaryButtonTextColorHover"] = "#ffffff"; - this["secondaryButtonColor"] = "#ffffff"; - this["secondaryButtonColorHover"] = "#ffffff"; - this["secondaryButtonTextColor"] = "#0061FE"; - this["secondaryButtonTextColorHover"] = "#0061FE"; - this["textColor1"] = "#808080"; - this["textColor2"] = "#ffffff"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "headerBackgroundColor", - baseName: "header_background_color", - type: "string" - }, - { - name: "legalVersion", - baseName: "legal_version", - type: "SubWhiteLabelingOptions.LegalVersionEnum" - }, - { - name: "linkColor", - baseName: "link_color", - type: "string" - }, - { - name: "pageBackgroundColor", - baseName: "page_background_color", - type: "string" - }, - { - name: "primaryButtonColor", - baseName: "primary_button_color", - type: "string" - }, - { - name: "primaryButtonColorHover", - baseName: "primary_button_color_hover", - type: "string" - }, - { - name: "primaryButtonTextColor", - baseName: "primary_button_text_color", - type: "string" - }, - { - name: "primaryButtonTextColorHover", - baseName: "primary_button_text_color_hover", - type: "string" - }, - { - name: "secondaryButtonColor", - baseName: "secondary_button_color", - type: "string" - }, - { - name: "secondaryButtonColorHover", - baseName: "secondary_button_color_hover", - type: "string" - }, - { - name: "secondaryButtonTextColor", - baseName: "secondary_button_text_color", - type: "string" - }, - { - name: "secondaryButtonTextColorHover", - baseName: "secondary_button_text_color_hover", - type: "string" - }, - { - name: "textColor1", - baseName: "text_color1", - type: "string" - }, - { - name: "textColor2", - baseName: "text_color2", - type: "string" - }, - { - name: "resetToDefault", - baseName: "reset_to_default", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _SubWhiteLabelingOptions.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "SubWhiteLabelingOptions"); - } -}; -((SubWhiteLabelingOptions2) => { - let LegalVersionEnum; - ((LegalVersionEnum2) => { - LegalVersionEnum2["Terms1"] = "terms1"; - LegalVersionEnum2["Terms2"] = "terms2"; - })(LegalVersionEnum = SubWhiteLabelingOptions2.LegalVersionEnum || (SubWhiteLabelingOptions2.LegalVersionEnum = {})); -})(SubWhiteLabelingOptions || (SubWhiteLabelingOptions = {})); - -// model/teamAddMemberRequest.ts -var TeamAddMemberRequest = class _TeamAddMemberRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "accountId", - baseName: "account_id", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "role", - baseName: "role", - type: "TeamAddMemberRequest.RoleEnum" - } - ]; - } - static getAttributeTypeMap() { - return _TeamAddMemberRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamAddMemberRequest"); - } -}; -((TeamAddMemberRequest2) => { - let RoleEnum; - ((RoleEnum2) => { - RoleEnum2["Member"] = "Member"; - RoleEnum2["Developer"] = "Developer"; - RoleEnum2["TeamManager"] = "Team Manager"; - RoleEnum2["Admin"] = "Admin"; - })(RoleEnum = TeamAddMemberRequest2.RoleEnum || (TeamAddMemberRequest2.RoleEnum = {})); -})(TeamAddMemberRequest || (TeamAddMemberRequest = {})); - -// model/teamCreateRequest.ts -var TeamCreateRequest = class _TeamCreateRequest { - constructor() { - /** - * The name of your Team. - */ - this["name"] = "Untitled Team"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _TeamCreateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamCreateRequest"); - } -}; - -// model/teamGetInfoResponse.ts -var TeamGetInfoResponse = class _TeamGetInfoResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "team", - baseName: "team", - type: "TeamInfoResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TeamGetInfoResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamGetInfoResponse"); - } -}; - -// model/teamGetResponse.ts -var TeamGetResponse = class _TeamGetResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "team", - baseName: "team", - type: "TeamResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TeamGetResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamGetResponse"); - } -}; - -// model/teamInfoResponse.ts -var TeamInfoResponse = class _TeamInfoResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "teamId", - baseName: "team_id", - type: "string" - }, - { - name: "teamParent", - baseName: "team_parent", - type: "TeamParentResponse" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "numMembers", - baseName: "num_members", - type: "number" - }, - { - name: "numSubTeams", - baseName: "num_sub_teams", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _TeamInfoResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamInfoResponse"); - } -}; - -// model/teamInviteResponse.ts -var TeamInviteResponse = class _TeamInviteResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "teamId", - baseName: "team_id", - type: "string" - }, - { - name: "role", - baseName: "role", - type: "string" - }, - { - name: "sentAt", - baseName: "sent_at", - type: "number" - }, - { - name: "redeemedAt", - baseName: "redeemed_at", - type: "number" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _TeamInviteResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamInviteResponse"); - } -}; - -// model/teamInvitesResponse.ts -var TeamInvitesResponse = class _TeamInvitesResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "teamInvites", - baseName: "team_invites", - type: "Array" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TeamInvitesResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamInvitesResponse"); - } -}; - -// model/teamMemberResponse.ts -var TeamMemberResponse = class _TeamMemberResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "accountId", - baseName: "account_id", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "role", - baseName: "role", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _TeamMemberResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamMemberResponse"); - } -}; - -// model/teamMembersResponse.ts -var TeamMembersResponse = class _TeamMembersResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "teamMembers", - baseName: "team_members", - type: "Array" - }, - { - name: "listInfo", - baseName: "list_info", - type: "ListInfoResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TeamMembersResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamMembersResponse"); - } -}; - -// model/teamParentResponse.ts -var TeamParentResponse = class _TeamParentResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "teamId", - baseName: "team_id", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _TeamParentResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamParentResponse"); - } -}; - -// model/teamRemoveMemberRequest.ts -var TeamRemoveMemberRequest = class _TeamRemoveMemberRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "accountId", - baseName: "account_id", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "newOwnerEmailAddress", - baseName: "new_owner_email_address", - type: "string" - }, - { - name: "newTeamId", - baseName: "new_team_id", - type: "string" - }, - { - name: "newRole", - baseName: "new_role", - type: "TeamRemoveMemberRequest.NewRoleEnum" - } - ]; - } - static getAttributeTypeMap() { - return _TeamRemoveMemberRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamRemoveMemberRequest"); - } -}; -((TeamRemoveMemberRequest2) => { - let NewRoleEnum; - ((NewRoleEnum2) => { - NewRoleEnum2["Member"] = "Member"; - NewRoleEnum2["Developer"] = "Developer"; - NewRoleEnum2["TeamManager"] = "Team Manager"; - NewRoleEnum2["Admin"] = "Admin"; - })(NewRoleEnum = TeamRemoveMemberRequest2.NewRoleEnum || (TeamRemoveMemberRequest2.NewRoleEnum = {})); -})(TeamRemoveMemberRequest || (TeamRemoveMemberRequest = {})); - -// model/teamResponse.ts -var TeamResponse = class _TeamResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "accounts", - baseName: "accounts", - type: "Array" - }, - { - name: "invitedAccounts", - baseName: "invited_accounts", - type: "Array" - }, - { - name: "invitedEmails", - baseName: "invited_emails", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TeamResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamResponse"); - } -}; - -// model/teamSubTeamsResponse.ts -var TeamSubTeamsResponse = class _TeamSubTeamsResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "subTeams", - baseName: "sub_teams", - type: "Array" - }, - { - name: "listInfo", - baseName: "list_info", - type: "ListInfoResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TeamSubTeamsResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamSubTeamsResponse"); - } -}; - -// model/teamUpdateRequest.ts -var TeamUpdateRequest = class _TeamUpdateRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _TeamUpdateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TeamUpdateRequest"); - } -}; - -// model/templateAddUserRequest.ts -var TemplateAddUserRequest = class _TemplateAddUserRequest { - constructor() { - /** - * If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. - */ - this["skipNotification"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "accountId", - baseName: "account_id", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "skipNotification", - baseName: "skip_notification", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateAddUserRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateAddUserRequest"); - } -}; - -// model/templateCreateEmbeddedDraftRequest.ts -var TemplateCreateEmbeddedDraftRequest = class _TemplateCreateEmbeddedDraftRequest { - constructor() { - /** - * This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. - */ - this["allowCcs"] = true; - /** - * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. - */ - this["allowReassign"] = false; - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. - */ - this["allowFormView"] = false; - /** - * Provide users the ability to review/edit the template signer roles. - */ - this["forceSignerRoles"] = false; - /** - * Provide users the ability to review/edit the template subject and message. - */ - this["forceSubjectMessage"] = false; - /** - * This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. - */ - this["showPreview"] = false; - /** - * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. - */ - this["showProgressStepper"] = true; - /** - * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. - */ - this["skipMeNow"] = false; - /** - * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - /** - * Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). - */ - this["usePreexistingFields"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "allowCcs", - baseName: "allow_ccs", - type: "boolean" - }, - { - name: "allowReassign", - baseName: "allow_reassign", - type: "boolean" - }, - { - name: "allowFormView", - baseName: "allow_form_view", - type: "boolean" - }, - { - name: "attachments", - baseName: "attachments", - type: "Array" - }, - { - name: "ccRoles", - baseName: "cc_roles", - type: "Array" - }, - { - name: "editorOptions", - baseName: "editor_options", - type: "SubEditorOptions" - }, - { - name: "fieldOptions", - baseName: "field_options", - type: "SubFieldOptions" - }, - { - name: "forceSignerRoles", - baseName: "force_signer_roles", - type: "boolean" - }, - { - name: "forceSubjectMessage", - baseName: "force_subject_message", - type: "boolean" - }, - { - name: "formFieldGroups", - baseName: "form_field_groups", - type: "Array" - }, - { - name: "formFieldRules", - baseName: "form_field_rules", - type: "Array" - }, - { - name: "formFieldsPerDocument", - baseName: "form_fields_per_document", - type: "Array" - }, - { - name: "mergeFields", - baseName: "merge_fields", - type: "Array" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "showPreview", - baseName: "show_preview", - type: "boolean" - }, - { - name: "showProgressStepper", - baseName: "show_progress_stepper", - type: "boolean" - }, - { - name: "signerRoles", - baseName: "signer_roles", - type: "Array" - }, - { - name: "skipMeNow", - baseName: "skip_me_now", - type: "boolean" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "usePreexistingFields", - baseName: "use_preexisting_fields", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateCreateEmbeddedDraftRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateCreateEmbeddedDraftRequest" - ); - } -}; - -// model/templateCreateEmbeddedDraftResponse.ts -var TemplateCreateEmbeddedDraftResponse = class _TemplateCreateEmbeddedDraftResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "template", - baseName: "template", - type: "TemplateCreateEmbeddedDraftResponseTemplate" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateCreateEmbeddedDraftResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateCreateEmbeddedDraftResponse" - ); - } -}; - -// model/templateCreateEmbeddedDraftResponseTemplate.ts -var TemplateCreateEmbeddedDraftResponseTemplate = class _TemplateCreateEmbeddedDraftResponseTemplate { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templateId", - baseName: "template_id", - type: "string" - }, - { - name: "editUrl", - baseName: "edit_url", - type: "string" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateCreateEmbeddedDraftResponseTemplate.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateCreateEmbeddedDraftResponseTemplate" - ); - } -}; - -// model/templateCreateRequest.ts -var TemplateCreateRequest = class _TemplateCreateRequest { - constructor() { - /** - * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. - */ - this["allowReassign"] = false; - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. - */ - this["allowFormView"] = false; - /** - * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - /** - * Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). - */ - this["usePreexistingFields"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "formFieldsPerDocument", - baseName: "form_fields_per_document", - type: "Array" - }, - { - name: "signerRoles", - baseName: "signer_roles", - type: "Array" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "allowReassign", - baseName: "allow_reassign", - type: "boolean" - }, - { - name: "allowFormView", - baseName: "allow_form_view", - type: "boolean" - }, - { - name: "attachments", - baseName: "attachments", - type: "Array" - }, - { - name: "ccRoles", - baseName: "cc_roles", - type: "Array" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "fieldOptions", - baseName: "field_options", - type: "SubFieldOptions" - }, - { - name: "formFieldGroups", - baseName: "form_field_groups", - type: "Array" - }, - { - name: "formFieldRules", - baseName: "form_field_rules", - type: "Array" - }, - { - name: "mergeFields", - baseName: "merge_fields", - type: "Array" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "usePreexistingFields", - baseName: "use_preexisting_fields", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateCreateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateCreateRequest"); - } -}; - -// model/templateCreateResponse.ts -var TemplateCreateResponse = class _TemplateCreateResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "template", - baseName: "template", - type: "TemplateCreateResponseTemplate" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateCreateResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateCreateResponse"); - } -}; - -// model/templateCreateResponseTemplate.ts -var TemplateCreateResponseTemplate = class _TemplateCreateResponseTemplate { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templateId", - baseName: "template_id", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateCreateResponseTemplate.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateCreateResponseTemplate"); - } -}; - -// model/templateEditResponse.ts -var TemplateEditResponse = class _TemplateEditResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templateId", - baseName: "template_id", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateEditResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateEditResponse"); - } -}; - -// model/templateGetResponse.ts -var TemplateGetResponse = class _TemplateGetResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "template", - baseName: "template", - type: "TemplateResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateGetResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateGetResponse"); - } -}; - -// model/templateListResponse.ts -var TemplateListResponse = class _TemplateListResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templates", - baseName: "templates", - type: "Array" - }, - { - name: "listInfo", - baseName: "list_info", - type: "ListInfoResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateListResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateListResponse"); - } -}; - -// model/templateRemoveUserRequest.ts -var TemplateRemoveUserRequest = class _TemplateRemoveUserRequest { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "accountId", - baseName: "account_id", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateRemoveUserRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateRemoveUserRequest"); - } -}; - -// model/templateResponse.ts -var TemplateResponse = class _TemplateResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templateId", - baseName: "template_id", - type: "string" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "updatedAt", - baseName: "updated_at", - type: "number" - }, - { - name: "isEmbedded", - baseName: "is_embedded", - type: "boolean" - }, - { - name: "isCreator", - baseName: "is_creator", - type: "boolean" - }, - { - name: "canEdit", - baseName: "can_edit", - type: "boolean" - }, - { - name: "isLocked", - baseName: "is_locked", - type: "boolean" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "signerRoles", - baseName: "signer_roles", - type: "Array" - }, - { - name: "ccRoles", - baseName: "cc_roles", - type: "Array" - }, - { - name: "documents", - baseName: "documents", - type: "Array" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "namedFormFields", - baseName: "named_form_fields", - type: "Array" - }, - { - name: "accounts", - baseName: "accounts", - type: "Array" - }, - { - name: "attachments", - baseName: "attachments", - type: "Array" - }, - { - name: "allowFormView", - baseName: "allow_form_view", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateResponse"); - } -}; - -// model/templateResponseAccount.ts -var TemplateResponseAccount = class _TemplateResponseAccount { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "accountId", - baseName: "account_id", - type: "string" - }, - { - name: "emailAddress", - baseName: "email_address", - type: "string" - }, - { - name: "isLocked", - baseName: "is_locked", - type: "boolean" - }, - { - name: "isPaidHs", - baseName: "is_paid_hs", - type: "boolean" - }, - { - name: "isPaidHf", - baseName: "is_paid_hf", - type: "boolean" - }, - { - name: "quotas", - baseName: "quotas", - type: "TemplateResponseAccountQuota" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateResponseAccount.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateResponseAccount"); - } -}; - -// model/templateResponseAccountQuota.ts -var TemplateResponseAccountQuota = class _TemplateResponseAccountQuota { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templatesLeft", - baseName: "templates_left", - type: "number" - }, - { - name: "apiSignatureRequestsLeft", - baseName: "api_signature_requests_left", - type: "number" - }, - { - name: "documentsLeft", - baseName: "documents_left", - type: "number" - }, - { - name: "smsVerificationsLeft", - baseName: "sms_verifications_left", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateResponseAccountQuota.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateResponseAccountQuota"); - } -}; - -// model/templateResponseCCRole.ts -var TemplateResponseCCRole = class _TemplateResponseCCRole { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateResponseCCRole.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateResponseCCRole"); - } -}; - -// model/templateResponseDocument.ts -var TemplateResponseDocument = class _TemplateResponseDocument { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "index", - baseName: "index", - type: "number" - }, - { - name: "fieldGroups", - baseName: "field_groups", - type: "Array" - }, - { - name: "formFields", - baseName: "form_fields", - type: "Array" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "staticFields", - baseName: "static_fields", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateResponseDocument.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateResponseDocument"); - } -}; - -// model/templateResponseDocumentCustomFieldBase.ts -var TemplateResponseDocumentCustomFieldBase = class _TemplateResponseDocumentCustomFieldBase { - static { - this.discriminator = "type"; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "apiId", - baseName: "api_id", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "signer", - baseName: "signer", - type: "string" - }, - { - name: "x", - baseName: "x", - type: "number" - }, - { - name: "y", - baseName: "y", - type: "number" - }, - { - name: "width", - baseName: "width", - type: "number" - }, - { - name: "height", - baseName: "height", - type: "number" - }, - { - name: "required", - baseName: "required", - type: "boolean" - }, - { - name: "group", - baseName: "group", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateResponseDocumentCustomFieldBase.attributeTypeMap; - } - static discriminatorClassName(value) { - if (value === void 0 || value === null) { - return null; - } - if (value === "checkbox") { - return "TemplateResponseDocumentCustomFieldCheckbox"; - } - if (value === "text") { - return "TemplateResponseDocumentCustomFieldText"; - } - return null; - } -}; - -// model/templateResponseDocumentCustomFieldCheckbox.ts -var TemplateResponseDocumentCustomFieldCheckbox = class _TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocumentCustomFieldBase { - constructor() { - super(...arguments); - /** - * The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` - */ - this["type"] = "checkbox"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentCustomFieldCheckbox.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentCustomFieldCheckbox" - ); - } -}; - -// model/templateResponseDocumentCustomFieldText.ts -var TemplateResponseDocumentCustomFieldText = class _TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCustomFieldBase { - constructor() { - super(...arguments); - /** - * The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` - */ - this["type"] = "text"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "avgTextLength", - baseName: "avg_text_length", - type: "TemplateResponseFieldAvgTextLength" - }, - { - name: "isMultiline", - baseName: "isMultiline", - type: "boolean" - }, - { - name: "originalFontSize", - baseName: "originalFontSize", - type: "number" - }, - { - name: "fontFamily", - baseName: "fontFamily", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentCustomFieldText.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentCustomFieldText" - ); - } -}; - -// model/templateResponseDocumentFieldGroup.ts -var TemplateResponseDocumentFieldGroup = class _TemplateResponseDocumentFieldGroup { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "rule", - baseName: "rule", - type: "TemplateResponseDocumentFieldGroupRule" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateResponseDocumentFieldGroup.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentFieldGroup" - ); - } -}; - -// model/templateResponseDocumentFieldGroupRule.ts -var TemplateResponseDocumentFieldGroupRule = class _TemplateResponseDocumentFieldGroupRule { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "requirement", - baseName: "requirement", - type: "string" - }, - { - name: "groupLabel", - baseName: "groupLabel", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateResponseDocumentFieldGroupRule.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentFieldGroupRule" - ); - } -}; - -// model/templateResponseDocumentFormFieldBase.ts -var TemplateResponseDocumentFormFieldBase = class _TemplateResponseDocumentFormFieldBase { - static { - this.discriminator = "type"; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "apiId", - baseName: "api_id", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "signer", - baseName: "signer", - type: "string" - }, - { - name: "x", - baseName: "x", - type: "number" - }, - { - name: "y", - baseName: "y", - type: "number" - }, - { - name: "width", - baseName: "width", - type: "number" - }, - { - name: "height", - baseName: "height", - type: "number" - }, - { - name: "required", - baseName: "required", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateResponseDocumentFormFieldBase.attributeTypeMap; - } - static discriminatorClassName(value) { - if (value === void 0 || value === null) { - return null; - } - if (value === "checkbox") { - return "TemplateResponseDocumentFormFieldCheckbox"; - } - if (value === "date_signed") { - return "TemplateResponseDocumentFormFieldDateSigned"; - } - if (value === "dropdown") { - return "TemplateResponseDocumentFormFieldDropdown"; - } - if (value === "hyperlink") { - return "TemplateResponseDocumentFormFieldHyperlink"; - } - if (value === "initials") { - return "TemplateResponseDocumentFormFieldInitials"; - } - if (value === "radio") { - return "TemplateResponseDocumentFormFieldRadio"; - } - if (value === "signature") { - return "TemplateResponseDocumentFormFieldSignature"; - } - if (value === "text") { - return "TemplateResponseDocumentFormFieldText"; - } - return null; - } -}; - -// model/templateResponseDocumentFormFieldCheckbox.ts -var TemplateResponseDocumentFormFieldCheckbox = class _TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocumentFormFieldBase { - constructor() { - super(...arguments); - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` - */ - this["type"] = "checkbox"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "group", - baseName: "group", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentFormFieldCheckbox.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentFormFieldCheckbox" - ); - } -}; - -// model/templateResponseDocumentFormFieldDateSigned.ts -var TemplateResponseDocumentFormFieldDateSigned = class _TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocumentFormFieldBase { - constructor() { - super(...arguments); - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` - */ - this["type"] = "date_signed"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "group", - baseName: "group", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentFormFieldDateSigned.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentFormFieldDateSigned" - ); - } -}; - -// model/templateResponseDocumentFormFieldDropdown.ts -var TemplateResponseDocumentFormFieldDropdown = class _TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocumentFormFieldBase { - constructor() { - super(...arguments); - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` - */ - this["type"] = "dropdown"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "group", - baseName: "group", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentFormFieldDropdown.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentFormFieldDropdown" - ); - } -}; - -// model/templateResponseDocumentFormFieldHyperlink.ts -var TemplateResponseDocumentFormFieldHyperlink = class _TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumentFormFieldBase { - constructor() { - super(...arguments); - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` - */ - this["type"] = "hyperlink"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "avgTextLength", - baseName: "avg_text_length", - type: "TemplateResponseFieldAvgTextLength" - }, - { - name: "isMultiline", - baseName: "isMultiline", - type: "boolean" - }, - { - name: "originalFontSize", - baseName: "originalFontSize", - type: "number" - }, - { - name: "fontFamily", - baseName: "fontFamily", - type: "string" - }, - { - name: "group", - baseName: "group", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentFormFieldHyperlink.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentFormFieldHyperlink" - ); - } -}; - -// model/templateResponseDocumentFormFieldInitials.ts -var TemplateResponseDocumentFormFieldInitials = class _TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocumentFormFieldBase { - constructor() { - super(...arguments); - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` - */ - this["type"] = "initials"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "group", - baseName: "group", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentFormFieldInitials.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentFormFieldInitials" - ); - } -}; - -// model/templateResponseDocumentFormFieldRadio.ts -var TemplateResponseDocumentFormFieldRadio = class _TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFormFieldBase { - constructor() { - super(...arguments); - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` - */ - this["type"] = "radio"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "group", - baseName: "group", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentFormFieldRadio.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentFormFieldRadio" - ); - } -}; - -// model/templateResponseDocumentFormFieldSignature.ts -var TemplateResponseDocumentFormFieldSignature = class _TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumentFormFieldBase { - constructor() { - super(...arguments); - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` - */ - this["type"] = "signature"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "group", - baseName: "group", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentFormFieldSignature.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentFormFieldSignature" - ); - } -}; - -// model/templateResponseDocumentFormFieldText.ts -var TemplateResponseDocumentFormFieldText = class _TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentFormFieldBase { - constructor() { - super(...arguments); - /** - * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` - */ - this["type"] = "text"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "avgTextLength", - baseName: "avg_text_length", - type: "TemplateResponseFieldAvgTextLength" - }, - { - name: "isMultiline", - baseName: "isMultiline", - type: "boolean" - }, - { - name: "originalFontSize", - baseName: "originalFontSize", - type: "number" - }, - { - name: "fontFamily", - baseName: "fontFamily", - type: "string" - }, - { - name: "validationType", - baseName: "validation_type", - type: "TemplateResponseDocumentFormFieldText.ValidationTypeEnum" - }, - { - name: "validationCustomRegex", - baseName: "validation_custom_regex", - type: "string" - }, - { - name: "validationCustomRegexFormatLabel", - baseName: "validation_custom_regex_format_label", - type: "string" - }, - { - name: "group", - baseName: "group", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentFormFieldText.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentFormFieldText" - ); - } -}; -((TemplateResponseDocumentFormFieldText2) => { - let ValidationTypeEnum; - ((ValidationTypeEnum2) => { - ValidationTypeEnum2["NumbersOnly"] = "numbers_only"; - ValidationTypeEnum2["LettersOnly"] = "letters_only"; - ValidationTypeEnum2["PhoneNumber"] = "phone_number"; - ValidationTypeEnum2["BankRoutingNumber"] = "bank_routing_number"; - ValidationTypeEnum2["BankAccountNumber"] = "bank_account_number"; - ValidationTypeEnum2["EmailAddress"] = "email_address"; - ValidationTypeEnum2["ZipCode"] = "zip_code"; - ValidationTypeEnum2["SocialSecurityNumber"] = "social_security_number"; - ValidationTypeEnum2["EmployerIdentificationNumber"] = "employer_identification_number"; - ValidationTypeEnum2["CustomRegex"] = "custom_regex"; - })(ValidationTypeEnum = TemplateResponseDocumentFormFieldText2.ValidationTypeEnum || (TemplateResponseDocumentFormFieldText2.ValidationTypeEnum = {})); -})(TemplateResponseDocumentFormFieldText || (TemplateResponseDocumentFormFieldText = {})); - -// model/templateResponseDocumentStaticFieldBase.ts -var TemplateResponseDocumentStaticFieldBase = class _TemplateResponseDocumentStaticFieldBase { - constructor() { - /** - * The signer of the Static Field. - */ - this["signer"] = "me_now"; - } - static { - this.discriminator = "type"; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - }, - { - name: "apiId", - baseName: "api_id", - type: "string" - }, - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "signer", - baseName: "signer", - type: "string" - }, - { - name: "x", - baseName: "x", - type: "number" - }, - { - name: "y", - baseName: "y", - type: "number" - }, - { - name: "width", - baseName: "width", - type: "number" - }, - { - name: "height", - baseName: "height", - type: "number" - }, - { - name: "required", - baseName: "required", - type: "boolean" - }, - { - name: "group", - baseName: "group", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateResponseDocumentStaticFieldBase.attributeTypeMap; - } - static discriminatorClassName(value) { - if (value === void 0 || value === null) { - return null; - } - if (value === "checkbox") { - return "TemplateResponseDocumentStaticFieldCheckbox"; - } - if (value === "date_signed") { - return "TemplateResponseDocumentStaticFieldDateSigned"; - } - if (value === "dropdown") { - return "TemplateResponseDocumentStaticFieldDropdown"; - } - if (value === "hyperlink") { - return "TemplateResponseDocumentStaticFieldHyperlink"; - } - if (value === "initials") { - return "TemplateResponseDocumentStaticFieldInitials"; - } - if (value === "radio") { - return "TemplateResponseDocumentStaticFieldRadio"; - } - if (value === "signature") { - return "TemplateResponseDocumentStaticFieldSignature"; - } - if (value === "text") { - return "TemplateResponseDocumentStaticFieldText"; - } - return null; - } -}; - -// model/templateResponseDocumentStaticFieldCheckbox.ts -var TemplateResponseDocumentStaticFieldCheckbox = class _TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocumentStaticFieldBase { - constructor() { - super(...arguments); - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` - */ - this["type"] = "checkbox"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentStaticFieldCheckbox.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentStaticFieldCheckbox" - ); - } -}; - -// model/templateResponseDocumentStaticFieldDateSigned.ts -var TemplateResponseDocumentStaticFieldDateSigned = class _TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocumentStaticFieldBase { - constructor() { - super(...arguments); - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` - */ - this["type"] = "date_signed"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentStaticFieldDateSigned.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentStaticFieldDateSigned" - ); - } -}; - -// model/templateResponseDocumentStaticFieldDropdown.ts -var TemplateResponseDocumentStaticFieldDropdown = class _TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocumentStaticFieldBase { - constructor() { - super(...arguments); - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` - */ - this["type"] = "dropdown"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentStaticFieldDropdown.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentStaticFieldDropdown" - ); - } -}; - -// model/templateResponseDocumentStaticFieldHyperlink.ts -var TemplateResponseDocumentStaticFieldHyperlink = class _TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocumentStaticFieldBase { - constructor() { - super(...arguments); - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` - */ - this["type"] = "hyperlink"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentStaticFieldHyperlink.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentStaticFieldHyperlink" - ); - } -}; - -// model/templateResponseDocumentStaticFieldInitials.ts -var TemplateResponseDocumentStaticFieldInitials = class _TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocumentStaticFieldBase { - constructor() { - super(...arguments); - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` - */ - this["type"] = "initials"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentStaticFieldInitials.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentStaticFieldInitials" - ); - } -}; - -// model/templateResponseDocumentStaticFieldRadio.ts -var TemplateResponseDocumentStaticFieldRadio = class _TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentStaticFieldBase { - constructor() { - super(...arguments); - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` - */ - this["type"] = "radio"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentStaticFieldRadio.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentStaticFieldRadio" - ); - } -}; - -// model/templateResponseDocumentStaticFieldSignature.ts -var TemplateResponseDocumentStaticFieldSignature = class _TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocumentStaticFieldBase { - constructor() { - super(...arguments); - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` - */ - this["type"] = "signature"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentStaticFieldSignature.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentStaticFieldSignature" - ); - } -}; - -// model/templateResponseDocumentStaticFieldText.ts -var TemplateResponseDocumentStaticFieldText = class _TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentStaticFieldBase { - constructor() { - super(...arguments); - /** - * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` - */ - this["type"] = "text"; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return super.getAttributeTypeMap().concat(_TemplateResponseDocumentStaticFieldText.attributeTypeMap); - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseDocumentStaticFieldText" - ); - } -}; - -// model/templateResponseFieldAvgTextLength.ts -var TemplateResponseFieldAvgTextLength = class _TemplateResponseFieldAvgTextLength { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "numLines", - baseName: "num_lines", - type: "number" - }, - { - name: "numCharsPerLine", - baseName: "num_chars_per_line", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateResponseFieldAvgTextLength.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateResponseFieldAvgTextLength" - ); - } -}; - -// model/templateResponseSignerRole.ts -var TemplateResponseSignerRole = class _TemplateResponseSignerRole { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "name", - baseName: "name", - type: "string" - }, - { - name: "order", - baseName: "order", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateResponseSignerRole.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateResponseSignerRole"); - } -}; - -// model/templateUpdateFilesRequest.ts -var TemplateUpdateFilesRequest = class _TemplateUpdateFilesRequest { - constructor() { - /** - * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateUpdateFilesRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateUpdateFilesRequest"); - } -}; - -// model/templateUpdateFilesResponse.ts -var TemplateUpdateFilesResponse = class _TemplateUpdateFilesResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "template", - baseName: "template", - type: "TemplateUpdateFilesResponseTemplate" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateUpdateFilesResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "TemplateUpdateFilesResponse"); - } -}; - -// model/templateUpdateFilesResponseTemplate.ts -var TemplateUpdateFilesResponseTemplate = class _TemplateUpdateFilesResponseTemplate { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "templateId", - baseName: "template_id", - type: "string" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _TemplateUpdateFilesResponseTemplate.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "TemplateUpdateFilesResponseTemplate" - ); - } -}; - -// model/unclaimedDraftCreateEmbeddedRequest.ts -var UnclaimedDraftCreateEmbeddedRequest = class _UnclaimedDraftCreateEmbeddedRequest { - constructor() { - /** - * This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. - */ - this["allowCcs"] = true; - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. - */ - this["allowFormView"] = false; - /** - * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. - */ - this["allowReassign"] = false; - /** - * Provide users the ability to review/edit the signers. - */ - this["forceSignerPage"] = false; - /** - * Provide users the ability to review/edit the subject and message. - */ - this["forceSubjectMessage"] = false; - /** - * Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. - */ - this["hideTextTags"] = false; - /** - * The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. - */ - this["holdRequest"] = false; - /** - * The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. - */ - this["isForEmbeddedSigning"] = false; - /** - * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. - */ - this["showProgressStepper"] = true; - /** - * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. - */ - this["skipMeNow"] = false; - /** - * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - /** - * The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. - */ - this["type"] = _UnclaimedDraftCreateEmbeddedRequest.TypeEnum.RequestSignature; - /** - * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. - */ - this["usePreexistingFields"] = false; - /** - * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. - */ - this["useTextTags"] = false; - /** - * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer\'s information during signing. **NOTE:** Keep your signer\'s information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. - */ - this["populateAutoFillFields"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "requesterEmailAddress", - baseName: "requester_email_address", - type: "string" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "allowCcs", - baseName: "allow_ccs", - type: "boolean" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "allowFormView", - baseName: "allow_form_view", - type: "boolean" - }, - { - name: "allowReassign", - baseName: "allow_reassign", - type: "boolean" - }, - { - name: "attachments", - baseName: "attachments", - type: "Array" - }, - { - name: "ccEmailAddresses", - baseName: "cc_email_addresses", - type: "Array" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "editorOptions", - baseName: "editor_options", - type: "SubEditorOptions" - }, - { - name: "fieldOptions", - baseName: "field_options", - type: "SubFieldOptions" - }, - { - name: "forceSignerPage", - baseName: "force_signer_page", - type: "boolean" - }, - { - name: "forceSubjectMessage", - baseName: "force_subject_message", - type: "boolean" - }, - { - name: "formFieldGroups", - baseName: "form_field_groups", - type: "Array" - }, - { - name: "formFieldRules", - baseName: "form_field_rules", - type: "Array" - }, - { - name: "formFieldsPerDocument", - baseName: "form_fields_per_document", - type: "Array" - }, - { - name: "hideTextTags", - baseName: "hide_text_tags", - type: "boolean" - }, - { - name: "holdRequest", - baseName: "hold_request", - type: "boolean" - }, - { - name: "isForEmbeddedSigning", - baseName: "is_for_embedded_signing", - type: "boolean" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "requestingRedirectUrl", - baseName: "requesting_redirect_url", - type: "string" - }, - { - name: "showPreview", - baseName: "show_preview", - type: "boolean" - }, - { - name: "showProgressStepper", - baseName: "show_progress_stepper", - type: "boolean" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - }, - { - name: "signingOptions", - baseName: "signing_options", - type: "SubSigningOptions" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "skipMeNow", - baseName: "skip_me_now", - type: "boolean" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "type", - baseName: "type", - type: "UnclaimedDraftCreateEmbeddedRequest.TypeEnum" - }, - { - name: "usePreexistingFields", - baseName: "use_preexisting_fields", - type: "boolean" - }, - { - name: "useTextTags", - baseName: "use_text_tags", - type: "boolean" - }, - { - name: "populateAutoFillFields", - baseName: "populate_auto_fill_fields", - type: "boolean" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _UnclaimedDraftCreateEmbeddedRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "UnclaimedDraftCreateEmbeddedRequest" - ); - } -}; -((UnclaimedDraftCreateEmbeddedRequest2) => { - let TypeEnum; - ((TypeEnum2) => { - TypeEnum2["SendDocument"] = "send_document"; - TypeEnum2["RequestSignature"] = "request_signature"; - })(TypeEnum = UnclaimedDraftCreateEmbeddedRequest2.TypeEnum || (UnclaimedDraftCreateEmbeddedRequest2.TypeEnum = {})); -})(UnclaimedDraftCreateEmbeddedRequest || (UnclaimedDraftCreateEmbeddedRequest = {})); - -// model/unclaimedDraftCreateEmbeddedWithTemplateRequest.ts -var UnclaimedDraftCreateEmbeddedWithTemplateRequest = class _UnclaimedDraftCreateEmbeddedWithTemplateRequest { - constructor() { - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. - */ - this["allowReassign"] = false; - /** - * Provide users the ability to review/edit the template signer roles. - */ - this["forceSignerRoles"] = false; - /** - * Provide users the ability to review/edit the template subject and message. - */ - this["forceSubjectMessage"] = false; - /** - * The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. - */ - this["holdRequest"] = false; - /** - * The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. - */ - this["isForEmbeddedSigning"] = false; - /** - * This allows the requester to enable the preview experience (i.e. does not allow the requester\'s end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set). - */ - this["previewOnly"] = false; - /** - * This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. - */ - this["showPreview"] = false; - /** - * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. - */ - this["showProgressStepper"] = true; - /** - * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. - */ - this["skipMeNow"] = false; - /** - * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - /** - * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer\'s information during signing. **NOTE:** Keep your signer\'s information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. - */ - this["populateAutoFillFields"] = false; - /** - * This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. - */ - this["allowCcs"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "requesterEmailAddress", - baseName: "requester_email_address", - type: "string" - }, - { - name: "templateIds", - baseName: "template_ids", - type: "Array" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "allowReassign", - baseName: "allow_reassign", - type: "boolean" - }, - { - name: "ccs", - baseName: "ccs", - type: "Array" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "editorOptions", - baseName: "editor_options", - type: "SubEditorOptions" - }, - { - name: "fieldOptions", - baseName: "field_options", - type: "SubFieldOptions" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "forceSignerRoles", - baseName: "force_signer_roles", - type: "boolean" - }, - { - name: "forceSubjectMessage", - baseName: "force_subject_message", - type: "boolean" - }, - { - name: "holdRequest", - baseName: "hold_request", - type: "boolean" - }, - { - name: "isForEmbeddedSigning", - baseName: "is_for_embedded_signing", - type: "boolean" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "previewOnly", - baseName: "preview_only", - type: "boolean" - }, - { - name: "requestingRedirectUrl", - baseName: "requesting_redirect_url", - type: "string" - }, - { - name: "showPreview", - baseName: "show_preview", - type: "boolean" - }, - { - name: "showProgressStepper", - baseName: "show_progress_stepper", - type: "boolean" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - }, - { - name: "signingOptions", - baseName: "signing_options", - type: "SubSigningOptions" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "skipMeNow", - baseName: "skip_me_now", - type: "boolean" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "title", - baseName: "title", - type: "string" - }, - { - name: "populateAutoFillFields", - baseName: "populate_auto_fill_fields", - type: "boolean" - }, - { - name: "allowCcs", - baseName: "allow_ccs", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _UnclaimedDraftCreateEmbeddedWithTemplateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "UnclaimedDraftCreateEmbeddedWithTemplateRequest" - ); - } -}; - -// model/unclaimedDraftCreateRequest.ts -var UnclaimedDraftCreateRequest = class _UnclaimedDraftCreateRequest { - constructor() { - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - */ - this["allowDecline"] = false; - /** - * Allows signers to view the form fields before signing if set to `true`. Defaults to `false`. - */ - this["allowFormView"] = false; - /** - * Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. - */ - this["hideTextTags"] = false; - /** - * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. - */ - this["showProgressStepper"] = true; - /** - * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - /** - * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. - */ - this["usePreexistingFields"] = false; - /** - * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. - */ - this["useTextTags"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "type", - baseName: "type", - type: "UnclaimedDraftCreateRequest.TypeEnum" - }, - { - name: "files", - baseName: "files", - type: "Array" - }, - { - name: "fileUrls", - baseName: "file_urls", - type: "Array" - }, - { - name: "allowDecline", - baseName: "allow_decline", - type: "boolean" - }, - { - name: "allowFormView", - baseName: "allow_form_view", - type: "boolean" - }, - { - name: "attachments", - baseName: "attachments", - type: "Array" - }, - { - name: "ccEmailAddresses", - baseName: "cc_email_addresses", - type: "Array" - }, - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "customFields", - baseName: "custom_fields", - type: "Array" - }, - { - name: "fieldOptions", - baseName: "field_options", - type: "SubFieldOptions" - }, - { - name: "formFieldGroups", - baseName: "form_field_groups", - type: "Array" - }, - { - name: "formFieldRules", - baseName: "form_field_rules", - type: "Array" - }, - { - name: "formFieldsPerDocument", - baseName: "form_fields_per_document", - type: "Array" - }, - { - name: "hideTextTags", - baseName: "hide_text_tags", - type: "boolean" - }, - { - name: "message", - baseName: "message", - type: "string" - }, - { - name: "metadata", - baseName: "metadata", - type: "{ [key: string]: any; }" - }, - { - name: "showProgressStepper", - baseName: "show_progress_stepper", - type: "boolean" - }, - { - name: "signers", - baseName: "signers", - type: "Array" - }, - { - name: "signingOptions", - baseName: "signing_options", - type: "SubSigningOptions" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "subject", - baseName: "subject", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - }, - { - name: "usePreexistingFields", - baseName: "use_preexisting_fields", - type: "boolean" - }, - { - name: "useTextTags", - baseName: "use_text_tags", - type: "boolean" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - } - ]; - } - static getAttributeTypeMap() { - return _UnclaimedDraftCreateRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "UnclaimedDraftCreateRequest"); - } -}; -((UnclaimedDraftCreateRequest2) => { - let TypeEnum; - ((TypeEnum2) => { - TypeEnum2["SendDocument"] = "send_document"; - TypeEnum2["RequestSignature"] = "request_signature"; - })(TypeEnum = UnclaimedDraftCreateRequest2.TypeEnum || (UnclaimedDraftCreateRequest2.TypeEnum = {})); -})(UnclaimedDraftCreateRequest || (UnclaimedDraftCreateRequest = {})); - -// model/unclaimedDraftCreateResponse.ts -var UnclaimedDraftCreateResponse = class _UnclaimedDraftCreateResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "unclaimedDraft", - baseName: "unclaimed_draft", - type: "UnclaimedDraftResponse" - }, - { - name: "warnings", - baseName: "warnings", - type: "Array" - } - ]; - } - static getAttributeTypeMap() { - return _UnclaimedDraftCreateResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "UnclaimedDraftCreateResponse"); - } -}; - -// model/unclaimedDraftEditAndResendRequest.ts -var UnclaimedDraftEditAndResendRequest = class _UnclaimedDraftEditAndResendRequest { - constructor() { - /** - * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. - */ - this["showProgressStepper"] = true; - /** - * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. - */ - this["testMode"] = false; - } - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "clientId", - baseName: "client_id", - type: "string" - }, - { - name: "editorOptions", - baseName: "editor_options", - type: "SubEditorOptions" - }, - { - name: "isForEmbeddedSigning", - baseName: "is_for_embedded_signing", - type: "boolean" - }, - { - name: "requesterEmailAddress", - baseName: "requester_email_address", - type: "string" - }, - { - name: "requestingRedirectUrl", - baseName: "requesting_redirect_url", - type: "string" - }, - { - name: "showProgressStepper", - baseName: "show_progress_stepper", - type: "boolean" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _UnclaimedDraftEditAndResendRequest.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize( - data, - "UnclaimedDraftEditAndResendRequest" - ); - } -}; - -// model/unclaimedDraftResponse.ts -var UnclaimedDraftResponse = class _UnclaimedDraftResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "signatureRequestId", - baseName: "signature_request_id", - type: "string" - }, - { - name: "claimUrl", - baseName: "claim_url", - type: "string" - }, - { - name: "signingRedirectUrl", - baseName: "signing_redirect_url", - type: "string" - }, - { - name: "requestingRedirectUrl", - baseName: "requesting_redirect_url", - type: "string" - }, - { - name: "expiresAt", - baseName: "expires_at", - type: "number" - }, - { - name: "testMode", - baseName: "test_mode", - type: "boolean" - } - ]; - } - static getAttributeTypeMap() { - return _UnclaimedDraftResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "UnclaimedDraftResponse"); - } -}; - -// model/warningResponse.ts -var WarningResponse = class _WarningResponse { - static { - this.discriminator = void 0; - } - static { - this.attributeTypeMap = [ - { - name: "warningMsg", - baseName: "warning_msg", - type: "string" - }, - { - name: "warningName", - baseName: "warning_name", - type: "string" - } - ]; - } - static getAttributeTypeMap() { - return _WarningResponse.attributeTypeMap; - } - /** Attempt to instantiate and hydrate a new instance of this class */ - static init(data) { - return ObjectSerializer.deserialize(data, "WarningResponse"); - } -}; - -// model/index.ts -var enumsMap = { - "EventCallbackRequestEvent.EventTypeEnum": EventCallbackRequestEvent.EventTypeEnum, - FaxLineAreaCodeGetCountryEnum, - FaxLineAreaCodeGetProvinceEnum, - FaxLineAreaCodeGetStateEnum, - "FaxLineCreateRequest.CountryEnum": FaxLineCreateRequest.CountryEnum, - "FaxResponseTransmission.StatusCodeEnum": FaxResponseTransmission.StatusCodeEnum, - "ReportCreateRequest.ReportTypeEnum": ReportCreateRequest.ReportTypeEnum, - "ReportResponse.ReportTypeEnum": ReportResponse.ReportTypeEnum, - SignatureRequestResponseCustomFieldTypeEnum, - SignatureRequestResponseDataTypeEnum, - "SubFieldOptions.DateFormatEnum": SubFieldOptions.DateFormatEnum, - "SubFormFieldRuleAction.TypeEnum": SubFormFieldRuleAction.TypeEnum, - "SubFormFieldRuleTrigger.OperatorEnum": SubFormFieldRuleTrigger.OperatorEnum, - "SubFormFieldsPerDocumentDateSigned.FontFamilyEnum": SubFormFieldsPerDocumentDateSigned.FontFamilyEnum, - "SubFormFieldsPerDocumentDropdown.FontFamilyEnum": SubFormFieldsPerDocumentDropdown.FontFamilyEnum, - SubFormFieldsPerDocumentFontEnum, - "SubFormFieldsPerDocumentHyperlink.FontFamilyEnum": SubFormFieldsPerDocumentHyperlink.FontFamilyEnum, - "SubFormFieldsPerDocumentText.ValidationTypeEnum": SubFormFieldsPerDocumentText.ValidationTypeEnum, - "SubFormFieldsPerDocumentText.FontFamilyEnum": SubFormFieldsPerDocumentText.FontFamilyEnum, - "SubFormFieldsPerDocumentTextMerge.FontFamilyEnum": SubFormFieldsPerDocumentTextMerge.FontFamilyEnum, - SubFormFieldsPerDocumentTypeEnum, - "SubMergeField.TypeEnum": SubMergeField.TypeEnum, - "SubOAuth.ScopesEnum": SubOAuth.ScopesEnum, - "SubSignatureRequestSigner.SmsPhoneNumberTypeEnum": SubSignatureRequestSigner.SmsPhoneNumberTypeEnum, - "SubSignatureRequestTemplateSigner.SmsPhoneNumberTypeEnum": SubSignatureRequestTemplateSigner.SmsPhoneNumberTypeEnum, - "SubSigningOptions.DefaultTypeEnum": SubSigningOptions.DefaultTypeEnum, - "SubWhiteLabelingOptions.LegalVersionEnum": SubWhiteLabelingOptions.LegalVersionEnum, - "TeamAddMemberRequest.RoleEnum": TeamAddMemberRequest.RoleEnum, - "TeamRemoveMemberRequest.NewRoleEnum": TeamRemoveMemberRequest.NewRoleEnum, - "TemplateResponseDocumentFormFieldText.ValidationTypeEnum": TemplateResponseDocumentFormFieldText.ValidationTypeEnum, - "UnclaimedDraftCreateEmbeddedRequest.TypeEnum": UnclaimedDraftCreateEmbeddedRequest.TypeEnum, - "UnclaimedDraftCreateRequest.TypeEnum": UnclaimedDraftCreateRequest.TypeEnum -}; -var typeMap = { - AccountCreateRequest, - AccountCreateResponse, - AccountGetResponse, - AccountResponse, - AccountResponseQuotas, - AccountResponseUsage, - AccountUpdateRequest, - AccountVerifyRequest, - AccountVerifyResponse, - AccountVerifyResponseAccount, - ApiAppCreateRequest, - ApiAppGetResponse, - ApiAppListResponse, - ApiAppResponse, - ApiAppResponseOAuth, - ApiAppResponseOptions, - ApiAppResponseOwnerAccount, - ApiAppResponseWhiteLabelingOptions, - ApiAppUpdateRequest, - BulkSendJobGetResponse, - BulkSendJobGetResponseSignatureRequests, - BulkSendJobListResponse, - BulkSendJobResponse, - BulkSendJobSendResponse, - EmbeddedEditUrlRequest, - EmbeddedEditUrlResponse, - EmbeddedEditUrlResponseEmbedded, - EmbeddedSignUrlResponse, - EmbeddedSignUrlResponseEmbedded, - ErrorResponse, - ErrorResponseError, - EventCallbackRequest, - EventCallbackRequestEvent, - EventCallbackRequestEventMetadata, - FaxGetResponse, - FaxLineAddUserRequest, - FaxLineAreaCodeGetResponse, - FaxLineCreateRequest, - FaxLineDeleteRequest, - FaxLineListResponse, - FaxLineRemoveUserRequest, - FaxLineResponse, - FaxLineResponseFaxLine, - FaxListResponse, - FaxResponse, - FaxResponseTransmission, - FaxSendRequest, - FileResponse, - FileResponseDataUri, - ListInfoResponse, - OAuthTokenGenerateRequest, - OAuthTokenRefreshRequest, - OAuthTokenResponse, - ReportCreateRequest, - ReportCreateResponse, - ReportResponse, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest, - SignatureRequestBulkSendWithTemplateRequest, - SignatureRequestCreateEmbeddedRequest, - SignatureRequestCreateEmbeddedWithTemplateRequest, - SignatureRequestEditEmbeddedRequest, - SignatureRequestEditEmbeddedWithTemplateRequest, - SignatureRequestEditRequest, - SignatureRequestEditWithTemplateRequest, - SignatureRequestGetResponse, - SignatureRequestListResponse, - SignatureRequestRemindRequest, - SignatureRequestResponse, - SignatureRequestResponseAttachment, - SignatureRequestResponseCustomFieldBase, - SignatureRequestResponseCustomFieldCheckbox, - SignatureRequestResponseCustomFieldText, - SignatureRequestResponseDataBase, - SignatureRequestResponseDataValueCheckbox, - SignatureRequestResponseDataValueCheckboxMerge, - SignatureRequestResponseDataValueDateSigned, - SignatureRequestResponseDataValueDropdown, - SignatureRequestResponseDataValueInitials, - SignatureRequestResponseDataValueRadio, - SignatureRequestResponseDataValueSignature, - SignatureRequestResponseDataValueText, - SignatureRequestResponseDataValueTextMerge, - SignatureRequestResponseSignatures, - SignatureRequestSendRequest, - SignatureRequestSendWithTemplateRequest, - SignatureRequestUpdateRequest, - SubAttachment, - SubBulkSignerList, - SubBulkSignerListCustomField, - SubCC, - SubCustomField, - SubEditorOptions, - SubFieldOptions, - SubFormFieldGroup, - SubFormFieldRule, - SubFormFieldRuleAction, - SubFormFieldRuleTrigger, - SubFormFieldsPerDocumentBase, - SubFormFieldsPerDocumentCheckbox, - SubFormFieldsPerDocumentCheckboxMerge, - SubFormFieldsPerDocumentDateSigned, - SubFormFieldsPerDocumentDropdown, - SubFormFieldsPerDocumentHyperlink, - SubFormFieldsPerDocumentInitials, - SubFormFieldsPerDocumentRadio, - SubFormFieldsPerDocumentSignature, - SubFormFieldsPerDocumentText, - SubFormFieldsPerDocumentTextMerge, - SubMergeField, - SubOAuth, - SubOptions, - SubSignatureRequestGroupedSigners, - SubSignatureRequestSigner, - SubSignatureRequestTemplateSigner, - SubSigningOptions, - SubTeamResponse, - SubTemplateRole, - SubUnclaimedDraftSigner, - SubUnclaimedDraftTemplateSigner, - SubWhiteLabelingOptions, - TeamAddMemberRequest, - TeamCreateRequest, - TeamGetInfoResponse, - TeamGetResponse, - TeamInfoResponse, - TeamInviteResponse, - TeamInvitesResponse, - TeamMemberResponse, - TeamMembersResponse, - TeamParentResponse, - TeamRemoveMemberRequest, - TeamResponse, - TeamSubTeamsResponse, - TeamUpdateRequest, - TemplateAddUserRequest, - TemplateCreateEmbeddedDraftRequest, - TemplateCreateEmbeddedDraftResponse, - TemplateCreateEmbeddedDraftResponseTemplate, - TemplateCreateRequest, - TemplateCreateResponse, - TemplateCreateResponseTemplate, - TemplateEditResponse, - TemplateGetResponse, - TemplateListResponse, - TemplateRemoveUserRequest, - TemplateResponse, - TemplateResponseAccount, - TemplateResponseAccountQuota, - TemplateResponseCCRole, - TemplateResponseDocument, - TemplateResponseDocumentCustomFieldBase, - TemplateResponseDocumentCustomFieldCheckbox, - TemplateResponseDocumentCustomFieldText, - TemplateResponseDocumentFieldGroup, - TemplateResponseDocumentFieldGroupRule, - TemplateResponseDocumentFormFieldBase, - TemplateResponseDocumentFormFieldCheckbox, - TemplateResponseDocumentFormFieldDateSigned, - TemplateResponseDocumentFormFieldDropdown, - TemplateResponseDocumentFormFieldHyperlink, - TemplateResponseDocumentFormFieldInitials, - TemplateResponseDocumentFormFieldRadio, - TemplateResponseDocumentFormFieldSignature, - TemplateResponseDocumentFormFieldText, - TemplateResponseDocumentStaticFieldBase, - TemplateResponseDocumentStaticFieldCheckbox, - TemplateResponseDocumentStaticFieldDateSigned, - TemplateResponseDocumentStaticFieldDropdown, - TemplateResponseDocumentStaticFieldHyperlink, - TemplateResponseDocumentStaticFieldInitials, - TemplateResponseDocumentStaticFieldRadio, - TemplateResponseDocumentStaticFieldSignature, - TemplateResponseDocumentStaticFieldText, - TemplateResponseFieldAvgTextLength, - TemplateResponseSignerRole, - TemplateUpdateFilesRequest, - TemplateUpdateFilesResponse, - TemplateUpdateFilesResponseTemplate, - UnclaimedDraftCreateEmbeddedRequest, - UnclaimedDraftCreateEmbeddedWithTemplateRequest, - UnclaimedDraftCreateRequest, - UnclaimedDraftCreateResponse, - UnclaimedDraftEditAndResendRequest, - UnclaimedDraftResponse, - WarningResponse -}; - -// api/accountApi.ts -var defaultBasePath = "https://api.hellosign.com/v3"; -var AccountApi = class { - constructor(basePath) { - this._basePath = defaultBasePath; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; - } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); - } - /** - * Creates a new Dropbox Sign Account that is associated with the specified `email_address`. - * @summary Create Account - * @param accountCreateRequest - * @param options - */ - async accountCreate(accountCreateRequest, options = { headers: {} }) { - accountCreateRequest = deserializeIfNeeded( - accountCreateRequest, - "AccountCreateRequest" - ); - const localVarPath = this.basePath + "/account/create"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (accountCreateRequest === null || accountCreateRequest === void 0) { - throw new Error( - "Required parameter accountCreateRequest was null or undefined when calling accountCreate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - accountCreateRequest, - AccountCreateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - accountCreateRequest, - "AccountCreateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse( - resolve, - reject, - response, - "AccountCreateResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse( - reject, - error.response, - 200, - "AccountCreateResponse" - )) { - return; - } - if (handleErrorRangeResponse( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Returns the properties and settings of your Account. - * @summary Get Account - * @param accountId `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. - * @param emailAddress `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. - * @param options - */ - async accountGet(accountId, emailAddress, options = { headers: {} }) { - const localVarPath = this.basePath + "/account"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (accountId !== void 0) { - localVarQueryParameters["account_id"] = ObjectSerializer.serialize( - accountId, - "string" - ); - } - if (emailAddress !== void 0) { - localVarQueryParameters["email_address"] = ObjectSerializer.serialize( - emailAddress, - "string" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse( - resolve, - reject, - response, - "AccountGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse( - reject, - error.response, - 200, - "AccountGetResponse" - )) { - return; - } - if (handleErrorRangeResponse( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Updates the properties and settings of your Account. Currently only allows for updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. - * @summary Update Account - * @param accountUpdateRequest - * @param options - */ - async accountUpdate(accountUpdateRequest, options = { headers: {} }) { - accountUpdateRequest = deserializeIfNeeded( - accountUpdateRequest, - "AccountUpdateRequest" - ); - const localVarPath = this.basePath + "/account"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (accountUpdateRequest === null || accountUpdateRequest === void 0) { - throw new Error( - "Required parameter accountUpdateRequest was null or undefined when calling accountUpdate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - accountUpdateRequest, - AccountUpdateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - accountUpdateRequest, - "AccountUpdateRequest" - ); - } - let localVarRequestOptions = { - method: "PUT", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse( - resolve, - reject, - response, - "AccountGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse( - reject, - error.response, - 200, - "AccountGetResponse" - )) { - return; - } - if (handleErrorRangeResponse( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Verifies whether an Dropbox Sign Account exists for the given email address. - * @summary Verify Account - * @param accountVerifyRequest - * @param options - */ - async accountVerify(accountVerifyRequest, options = { headers: {} }) { - accountVerifyRequest = deserializeIfNeeded( - accountVerifyRequest, - "AccountVerifyRequest" - ); - const localVarPath = this.basePath + "/account/verify"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (accountVerifyRequest === null || accountVerifyRequest === void 0) { - throw new Error( - "Required parameter accountVerifyRequest was null or undefined when calling accountVerify." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - accountVerifyRequest, - AccountVerifyRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - accountVerifyRequest, - "AccountVerifyRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse( - resolve, - reject, - response, - "AccountVerifyResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse( - reject, - error.response, - 200, - "AccountVerifyResponse" - )) { - return; - } - if (handleErrorRangeResponse( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } -}; -function deserializeIfNeeded(obj, classname) { - if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { - return ObjectSerializer.deserialize(obj, classname); - } - return obj; -} -function handleSuccessfulResponse(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/apiAppApi.ts -var defaultBasePath2 = "https://api.hellosign.com/v3"; -var ApiAppApi = class { - constructor(basePath) { - this._basePath = defaultBasePath2; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; - } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); - } - /** - * Creates a new API App. - * @summary Create API App - * @param apiAppCreateRequest - * @param options - */ - async apiAppCreate(apiAppCreateRequest, options = { headers: {} }) { - apiAppCreateRequest = deserializeIfNeeded2( - apiAppCreateRequest, - "ApiAppCreateRequest" - ); - const localVarPath = this.basePath + "/api_app"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (apiAppCreateRequest === null || apiAppCreateRequest === void 0) { - throw new Error( - "Required parameter apiAppCreateRequest was null or undefined when calling apiAppCreate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - apiAppCreateRequest, - ApiAppCreateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - apiAppCreateRequest, - "ApiAppCreateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse2( - resolve, - reject, - response, - "ApiAppGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse2( - reject, - error.response, - 201, - "ApiAppGetResponse" - )) { - return; - } - if (handleErrorRangeResponse2( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Deletes an API App. Can only be invoked for apps you own. - * @summary Delete API App - * @param clientId The client id of the API App to delete. - * @param options - */ - async apiAppDelete(clientId, options = { headers: {} }) { - const localVarPath = this.basePath + "/api_app/{client_id}".replace( - "{client_id}", - encodeURIComponent(String(clientId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (clientId === null || clientId === void 0) { - throw new Error( - "Required parameter clientId was null or undefined when calling apiAppDelete." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "DELETE", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse2(resolve, reject, response); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorRangeResponse2( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Returns an object with information about an API App. - * @summary Get API App - * @param clientId The client id of the API App to retrieve. - * @param options - */ - async apiAppGet(clientId, options = { headers: {} }) { - const localVarPath = this.basePath + "/api_app/{client_id}".replace( - "{client_id}", - encodeURIComponent(String(clientId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (clientId === null || clientId === void 0) { - throw new Error( - "Required parameter clientId was null or undefined when calling apiAppGet." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse2( - resolve, - reject, - response, - "ApiAppGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse2( - reject, - error.response, - 200, - "ApiAppGetResponse" - )) { - return; - } - if (handleErrorRangeResponse2( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Returns a list of API Apps that are accessible by you. If you are on a team with an Admin or Developer role, this list will include apps owned by teammates. - * @summary List API Apps - * @param page Which page number of the API App List to return. Defaults to `1`. - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. - * @param options - */ - async apiAppList(page, pageSize, options = { headers: {} }) { - const localVarPath = this.basePath + "/api_app/list"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (page !== void 0) { - localVarQueryParameters["page"] = ObjectSerializer.serialize( - page, - "number" - ); - } - if (pageSize !== void 0) { - localVarQueryParameters["page_size"] = ObjectSerializer.serialize( - pageSize, - "number" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse2( - resolve, - reject, - response, - "ApiAppListResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse2( - reject, - error.response, - 200, - "ApiAppListResponse" - )) { - return; - } - if (handleErrorRangeResponse2( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Updates an existing API App. Can only be invoked for apps you own. Only the fields you provide will be updated. If you wish to clear an existing optional field, provide an empty string. - * @summary Update API App - * @param clientId The client id of the API App to update. - * @param apiAppUpdateRequest - * @param options - */ - async apiAppUpdate(clientId, apiAppUpdateRequest, options = { headers: {} }) { - apiAppUpdateRequest = deserializeIfNeeded2( - apiAppUpdateRequest, - "ApiAppUpdateRequest" - ); - const localVarPath = this.basePath + "/api_app/{client_id}".replace( - "{client_id}", - encodeURIComponent(String(clientId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (clientId === null || clientId === void 0) { - throw new Error( - "Required parameter clientId was null or undefined when calling apiAppUpdate." - ); - } - if (apiAppUpdateRequest === null || apiAppUpdateRequest === void 0) { - throw new Error( - "Required parameter apiAppUpdateRequest was null or undefined when calling apiAppUpdate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - apiAppUpdateRequest, - ApiAppUpdateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - apiAppUpdateRequest, - "ApiAppUpdateRequest" - ); - } - let localVarRequestOptions = { - method: "PUT", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse2( - resolve, - reject, - response, - "ApiAppGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse2( - reject, - error.response, - 200, - "ApiAppGetResponse" - )) { - return; - } - if (handleErrorRangeResponse2( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } -}; -function deserializeIfNeeded2(obj, classname) { - if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { - return ObjectSerializer.deserialize(obj, classname); - } - return obj; -} -function handleSuccessfulResponse2(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse2(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse2(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/bulkSendJobApi.ts -var defaultBasePath3 = "https://api.hellosign.com/v3"; -var BulkSendJobApi = class { - constructor(basePath) { - this._basePath = defaultBasePath3; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; - } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); - } - /** - * Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. - * @summary Get Bulk Send Job - * @param bulkSendJobId The id of the BulkSendJob to retrieve. - * @param page Which page number of the BulkSendJob list to return. Defaults to `1`. - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. - * @param options - */ - async bulkSendJobGet(bulkSendJobId, page, pageSize, options = { headers: {} }) { - const localVarPath = this.basePath + "/bulk_send_job/{bulk_send_job_id}".replace( - "{bulk_send_job_id}", - encodeURIComponent(String(bulkSendJobId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (bulkSendJobId === null || bulkSendJobId === void 0) { - throw new Error( - "Required parameter bulkSendJobId was null or undefined when calling bulkSendJobGet." - ); - } - if (page !== void 0) { - localVarQueryParameters["page"] = ObjectSerializer.serialize( - page, - "number" - ); - } - if (pageSize !== void 0) { - localVarQueryParameters["page_size"] = ObjectSerializer.serialize( - pageSize, - "number" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse3( - resolve, - reject, - response, - "BulkSendJobGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse3( - reject, - error.response, - 200, - "BulkSendJobGetResponse" - )) { - return; - } - if (handleErrorRangeResponse3( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Returns a list of BulkSendJob that you can access. - * @summary List Bulk Send Jobs - * @param page Which page number of the BulkSendJob List to return. Defaults to `1`. - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. - * @param options - */ - async bulkSendJobList(page, pageSize, options = { headers: {} }) { - const localVarPath = this.basePath + "/bulk_send_job/list"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (page !== void 0) { - localVarQueryParameters["page"] = ObjectSerializer.serialize( - page, - "number" - ); - } - if (pageSize !== void 0) { - localVarQueryParameters["page_size"] = ObjectSerializer.serialize( - pageSize, - "number" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse3( - resolve, - reject, - response, - "BulkSendJobListResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse3( - reject, - error.response, - 200, - "BulkSendJobListResponse" - )) { - return; - } - if (handleErrorRangeResponse3( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } -}; -function handleSuccessfulResponse3(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse3(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse3(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/embeddedApi.ts -var defaultBasePath4 = "https://api.hellosign.com/v3"; -var EmbeddedApi = class { - constructor(basePath) { - this._basePath = defaultBasePath4; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; - } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); - } - /** - * Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. - * @summary Get Embedded Template Edit URL - * @param templateId The id of the template to edit. - * @param embeddedEditUrlRequest - * @param options - */ - async embeddedEditUrl(templateId, embeddedEditUrlRequest, options = { headers: {} }) { - embeddedEditUrlRequest = deserializeIfNeeded3( - embeddedEditUrlRequest, - "EmbeddedEditUrlRequest" - ); - const localVarPath = this.basePath + "/embedded/edit_url/{template_id}".replace( - "{template_id}", - encodeURIComponent(String(templateId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (templateId === null || templateId === void 0) { - throw new Error( - "Required parameter templateId was null or undefined when calling embeddedEditUrl." - ); - } - if (embeddedEditUrlRequest === null || embeddedEditUrlRequest === void 0) { - throw new Error( - "Required parameter embeddedEditUrlRequest was null or undefined when calling embeddedEditUrl." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - embeddedEditUrlRequest, - EmbeddedEditUrlRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - embeddedEditUrlRequest, - "EmbeddedEditUrlRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse4( - resolve, - reject, - response, - "EmbeddedEditUrlResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse4( - reject, - error.response, - 200, - "EmbeddedEditUrlResponse" - )) { - return; - } - if (handleErrorRangeResponse4( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Retrieves an embedded object containing a signature url that can be opened in an iFrame. Note that templates created via the embedded template process will only be accessible through the API. - * @summary Get Embedded Sign URL - * @param signatureId The id of the signature to get a signature url for. - * @param options - */ - async embeddedSignUrl(signatureId, options = { headers: {} }) { - const localVarPath = this.basePath + "/embedded/sign_url/{signature_id}".replace( - "{signature_id}", - encodeURIComponent(String(signatureId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureId === null || signatureId === void 0) { - throw new Error( - "Required parameter signatureId was null or undefined when calling embeddedSignUrl." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse4( - resolve, - reject, - response, - "EmbeddedSignUrlResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse4( - reject, - error.response, - 200, - "EmbeddedSignUrlResponse" - )) { - return; - } - if (handleErrorRangeResponse4( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } -}; -function deserializeIfNeeded3(obj, classname) { - if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { - return ObjectSerializer.deserialize(obj, classname); - } - return obj; -} -function handleSuccessfulResponse4(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse4(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse4(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/faxApi.ts -var defaultBasePath5 = "https://api.hellosign.com/v3"; -var FaxApi = class { - constructor(basePath) { - this._basePath = defaultBasePath5; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; - } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); - } - /** - * Deletes the specified Fax from the system - * @summary Delete Fax - * @param faxId Fax ID - * @param options - */ - async faxDelete(faxId, options = { headers: {} }) { - const localVarPath = this.basePath + "/fax/{fax_id}".replace( - "{fax_id}", - encodeURIComponent(String(faxId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (faxId === null || faxId === void 0) { - throw new Error( - "Required parameter faxId was null or undefined when calling faxDelete." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "DELETE", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse5(resolve, reject, response); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorRangeResponse5( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Downloads files associated with a Fax - * @summary Download Fax Files - * @param faxId Fax ID - * @param options - */ - async faxFiles(faxId, options = { headers: {} }) { - const localVarPath = this.basePath + "/fax/files/{fax_id}".replace( - "{fax_id}", - encodeURIComponent(String(faxId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/pdf", "application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (faxId === null || faxId === void 0) { - throw new Error( - "Required parameter faxId was null or undefined when calling faxFiles." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "arraybuffer" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse5( - resolve, - reject, - response, - "Buffer" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse5( - reject, - error.response, - 200, - "RequestFile" - )) { - return; - } - if (handleErrorRangeResponse5( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Returns information about a Fax - * @summary Get Fax - * @param faxId Fax ID - * @param options - */ - async faxGet(faxId, options = { headers: {} }) { - const localVarPath = this.basePath + "/fax/{fax_id}".replace( - "{fax_id}", - encodeURIComponent(String(faxId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (faxId === null || faxId === void 0) { - throw new Error( - "Required parameter faxId was null or undefined when calling faxGet." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse5( - resolve, - reject, - response, - "FaxGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse5( - reject, - error.response, - 200, - "FaxGetResponse" - )) { - return; - } - if (handleErrorRangeResponse5( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Returns properties of multiple Faxes - * @summary Lists Faxes - * @param page Which page number of the Fax List to return. Defaults to `1`. - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. - * @param options - */ - async faxList(page, pageSize, options = { headers: {} }) { - const localVarPath = this.basePath + "/fax/list"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (page !== void 0) { - localVarQueryParameters["page"] = ObjectSerializer.serialize( - page, - "number" - ); - } - if (pageSize !== void 0) { - localVarQueryParameters["page_size"] = ObjectSerializer.serialize( - pageSize, - "number" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse5( - resolve, - reject, - response, - "FaxListResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse5( - reject, - error.response, - 200, - "FaxListResponse" - )) { - return; - } - if (handleErrorRangeResponse5( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Creates and sends a new Fax with the submitted file(s) - * @summary Send Fax - * @param faxSendRequest - * @param options - */ - async faxSend(faxSendRequest, options = { headers: {} }) { - faxSendRequest = deserializeIfNeeded4(faxSendRequest, "FaxSendRequest"); - const localVarPath = this.basePath + "/fax/send"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (faxSendRequest === null || faxSendRequest === void 0) { - throw new Error( - "Required parameter faxSendRequest was null or undefined when calling faxSend." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - faxSendRequest, - FaxSendRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize(faxSendRequest, "FaxSendRequest"); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse5( - resolve, - reject, - response, - "FaxGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse5( - reject, - error.response, - 200, - "FaxGetResponse" - )) { - return; - } - if (handleErrorRangeResponse5( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } -}; -function deserializeIfNeeded4(obj, classname) { - if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { - return ObjectSerializer.deserialize(obj, classname); - } - return obj; -} -function handleSuccessfulResponse5(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse5(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse5(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/faxLineApi.ts -var defaultBasePath6 = "https://api.hellosign.com/v3"; -var FaxLineApi = class { - constructor(basePath) { - this._basePath = defaultBasePath6; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; - } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); - } - /** - * Grants a user access to the specified Fax Line. - * @summary Add Fax Line User - * @param faxLineAddUserRequest - * @param options - */ - async faxLineAddUser(faxLineAddUserRequest, options = { headers: {} }) { - faxLineAddUserRequest = deserializeIfNeeded5( - faxLineAddUserRequest, - "FaxLineAddUserRequest" - ); - const localVarPath = this.basePath + "/fax_line/add_user"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (faxLineAddUserRequest === null || faxLineAddUserRequest === void 0) { - throw new Error( - "Required parameter faxLineAddUserRequest was null or undefined when calling faxLineAddUser." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - faxLineAddUserRequest, - FaxLineAddUserRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - faxLineAddUserRequest, - "FaxLineAddUserRequest" - ); - } - let localVarRequestOptions = { - method: "PUT", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse6( - resolve, - reject, - response, - "FaxLineResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse6( - reject, - error.response, - 200, - "FaxLineResponse" - )) { - return; - } - if (handleErrorRangeResponse6( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Returns a list of available area codes for a given state/province and city - * @summary Get Available Fax Line Area Codes - * @param country Filter area codes by country - * @param state Filter area codes by state - * @param province Filter area codes by province - * @param city Filter area codes by city - * @param options - */ - async faxLineAreaCodeGet(country, state, province, city, options = { headers: {} }) { - const localVarPath = this.basePath + "/fax_line/area_codes"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (country === null || country === void 0) { - throw new Error( - "Required parameter country was null or undefined when calling faxLineAreaCodeGet." - ); - } - if (country !== void 0) { - localVarQueryParameters["country"] = ObjectSerializer.serialize( - country, - "'CA' | 'US' | 'UK'" - ); - } - if (state !== void 0) { - localVarQueryParameters["state"] = ObjectSerializer.serialize( - state, - "'AK' | 'AL' | 'AR' | 'AZ' | 'CA' | 'CO' | 'CT' | 'DC' | 'DE' | 'FL' | 'GA' | 'HI' | 'IA' | 'ID' | 'IL' | 'IN' | 'KS' | 'KY' | 'LA' | 'MA' | 'MD' | 'ME' | 'MI' | 'MN' | 'MO' | 'MS' | 'MT' | 'NC' | 'ND' | 'NE' | 'NH' | 'NJ' | 'NM' | 'NV' | 'NY' | 'OH' | 'OK' | 'OR' | 'PA' | 'RI' | 'SC' | 'SD' | 'TN' | 'TX' | 'UT' | 'VA' | 'VT' | 'WA' | 'WI' | 'WV' | 'WY'" - ); - } - if (province !== void 0) { - localVarQueryParameters["province"] = ObjectSerializer.serialize( - province, - "'AB' | 'BC' | 'MB' | 'NB' | 'NL' | 'NT' | 'NS' | 'NU' | 'ON' | 'PE' | 'QC' | 'SK' | 'YT'" - ); - } - if (city !== void 0) { - localVarQueryParameters["city"] = ObjectSerializer.serialize( - city, - "string" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse6( - resolve, - reject, - response, - "FaxLineAreaCodeGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse6( - reject, - error.response, - 200, - "FaxLineAreaCodeGetResponse" - )) { - return; - } - if (handleErrorRangeResponse6( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Purchases a new Fax Line - * @summary Purchase Fax Line - * @param faxLineCreateRequest - * @param options - */ - async faxLineCreate(faxLineCreateRequest, options = { headers: {} }) { - faxLineCreateRequest = deserializeIfNeeded5( - faxLineCreateRequest, - "FaxLineCreateRequest" - ); - const localVarPath = this.basePath + "/fax_line/create"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (faxLineCreateRequest === null || faxLineCreateRequest === void 0) { - throw new Error( - "Required parameter faxLineCreateRequest was null or undefined when calling faxLineCreate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - faxLineCreateRequest, - FaxLineCreateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - faxLineCreateRequest, - "FaxLineCreateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse6( - resolve, - reject, - response, - "FaxLineResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse6( - reject, - error.response, - 200, - "FaxLineResponse" - )) { - return; - } - if (handleErrorRangeResponse6( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Deletes the specified Fax Line from the subscription. - * @summary Delete Fax Line - * @param faxLineDeleteRequest - * @param options - */ - async faxLineDelete(faxLineDeleteRequest, options = { headers: {} }) { - faxLineDeleteRequest = deserializeIfNeeded5( - faxLineDeleteRequest, - "FaxLineDeleteRequest" - ); - const localVarPath = this.basePath + "/fax_line"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (faxLineDeleteRequest === null || faxLineDeleteRequest === void 0) { - throw new Error( - "Required parameter faxLineDeleteRequest was null or undefined when calling faxLineDelete." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - faxLineDeleteRequest, - FaxLineDeleteRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - faxLineDeleteRequest, - "FaxLineDeleteRequest" - ); - } - let localVarRequestOptions = { - method: "DELETE", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse6(resolve, reject, response); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorRangeResponse6( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Returns the properties and settings of a Fax Line. - * @summary Get Fax Line - * @param number The Fax Line number - * @param options - */ - async faxLineGet(number, options = { headers: {} }) { - const localVarPath = this.basePath + "/fax_line"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (number === null || number === void 0) { - throw new Error( - "Required parameter number was null or undefined when calling faxLineGet." - ); - } - if (number !== void 0) { - localVarQueryParameters["number"] = ObjectSerializer.serialize( - number, - "string" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse6( - resolve, - reject, - response, - "FaxLineResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse6( - reject, - error.response, - 200, - "FaxLineResponse" - )) { - return; - } - if (handleErrorRangeResponse6( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Returns the properties and settings of multiple Fax Lines. - * @summary List Fax Lines - * @param accountId Account ID - * @param page Which page number of the Fax Line List to return. Defaults to `1`. - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. - * @param showTeamLines Include Fax Lines belonging to team members in the list - * @param options - */ - async faxLineList(accountId, page, pageSize, showTeamLines, options = { headers: {} }) { - const localVarPath = this.basePath + "/fax_line/list"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (accountId !== void 0) { - localVarQueryParameters["account_id"] = ObjectSerializer.serialize( - accountId, - "string" - ); - } - if (page !== void 0) { - localVarQueryParameters["page"] = ObjectSerializer.serialize( - page, - "number" - ); - } - if (pageSize !== void 0) { - localVarQueryParameters["page_size"] = ObjectSerializer.serialize( - pageSize, - "number" - ); - } - if (showTeamLines !== void 0) { - localVarQueryParameters["show_team_lines"] = ObjectSerializer.serialize( - showTeamLines, - "boolean" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse6( - resolve, - reject, - response, - "FaxLineListResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse6( - reject, - error.response, - 200, - "FaxLineListResponse" - )) { - return; - } - if (handleErrorRangeResponse6( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Removes a user\'s access to the specified Fax Line - * @summary Remove Fax Line Access - * @param faxLineRemoveUserRequest - * @param options - */ - async faxLineRemoveUser(faxLineRemoveUserRequest, options = { headers: {} }) { - faxLineRemoveUserRequest = deserializeIfNeeded5( - faxLineRemoveUserRequest, - "FaxLineRemoveUserRequest" - ); - const localVarPath = this.basePath + "/fax_line/remove_user"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (faxLineRemoveUserRequest === null || faxLineRemoveUserRequest === void 0) { - throw new Error( - "Required parameter faxLineRemoveUserRequest was null or undefined when calling faxLineRemoveUser." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - faxLineRemoveUserRequest, - FaxLineRemoveUserRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - faxLineRemoveUserRequest, - "FaxLineRemoveUserRequest" - ); - } - let localVarRequestOptions = { - method: "PUT", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse6( - resolve, - reject, - response, - "FaxLineResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse6( - reject, - error.response, - 200, - "FaxLineResponse" - )) { - return; - } - if (handleErrorRangeResponse6( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } -}; -function deserializeIfNeeded5(obj, classname) { - if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { - return ObjectSerializer.deserialize(obj, classname); - } - return obj; -} -function handleSuccessfulResponse6(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse6(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse6(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/oAuthApi.ts -var defaultBasePath7 = "https://app.hellosign.com"; -var OAuthApi = class { - constructor(basePath) { - this._basePath = defaultBasePath7; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; - } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); - } - /** - * Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. - * @summary OAuth Token Generate - * @param oAuthTokenGenerateRequest - * @param options - */ - async oauthTokenGenerate(oAuthTokenGenerateRequest, options = { headers: {} }) { - oAuthTokenGenerateRequest = deserializeIfNeeded6( - oAuthTokenGenerateRequest, - "OAuthTokenGenerateRequest" - ); - const localVarPath = this.basePath + "/oauth/token"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (oAuthTokenGenerateRequest === null || oAuthTokenGenerateRequest === void 0) { - throw new Error( - "Required parameter oAuthTokenGenerateRequest was null or undefined when calling oauthTokenGenerate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - oAuthTokenGenerateRequest, - OAuthTokenGenerateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - oAuthTokenGenerateRequest, - "OAuthTokenGenerateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse7( - resolve, - reject, - response, - "OAuthTokenResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse7( - reject, - error.response, - 200, - "OAuthTokenResponse" - )) { - return; - } - if (handleErrorRangeResponse7( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired. - * @summary OAuth Token Refresh - * @param oAuthTokenRefreshRequest - * @param options - */ - async oauthTokenRefresh(oAuthTokenRefreshRequest, options = { headers: {} }) { - oAuthTokenRefreshRequest = deserializeIfNeeded6( - oAuthTokenRefreshRequest, - "OAuthTokenRefreshRequest" - ); - const localVarPath = this.basePath + "/oauth/token?refresh"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (oAuthTokenRefreshRequest === null || oAuthTokenRefreshRequest === void 0) { - throw new Error( - "Required parameter oAuthTokenRefreshRequest was null or undefined when calling oauthTokenRefresh." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - oAuthTokenRefreshRequest, - OAuthTokenRefreshRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - oAuthTokenRefreshRequest, - "OAuthTokenRefreshRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse7( - resolve, - reject, - response, - "OAuthTokenResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse7( - reject, - error.response, - 200, - "OAuthTokenResponse" - )) { - return; - } - if (handleErrorRangeResponse7( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } -}; -function deserializeIfNeeded6(obj, classname) { - if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { - return ObjectSerializer.deserialize(obj, classname); - } - return obj; -} -function handleSuccessfulResponse7(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse7(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse7(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/reportApi.ts -var defaultBasePath8 = "https://api.hellosign.com/v3"; -var ReportApi = class { - constructor(basePath) { - this._basePath = defaultBasePath8; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; - } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); - } - /** - * Request the creation of one or more report(s). When the report(s) have been generated, you will receive an email (one per requested report type) containing a link to download the report as a CSV file. The requested date range may be up to 12 months in duration, and `start_date` must not be more than 10 years in the past. - * @summary Create Report - * @param reportCreateRequest - * @param options - */ - async reportCreate(reportCreateRequest, options = { headers: {} }) { - reportCreateRequest = deserializeIfNeeded7( - reportCreateRequest, - "ReportCreateRequest" - ); - const localVarPath = this.basePath + "/report/create"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (reportCreateRequest === null || reportCreateRequest === void 0) { - throw new Error( - "Required parameter reportCreateRequest was null or undefined when calling reportCreate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - reportCreateRequest, - ReportCreateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - reportCreateRequest, - "ReportCreateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse8( - resolve, - reject, - response, - "ReportCreateResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse8( - reject, - error.response, - 200, - "ReportCreateResponse" - )) { - return; - } - if (handleErrorRangeResponse8( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } -}; -function deserializeIfNeeded7(obj, classname) { - if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { - return ObjectSerializer.deserialize(obj, classname); - } - return obj; -} -function handleSuccessfulResponse8(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse8(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse8(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/signatureRequestApi.ts -var defaultBasePath9 = "https://api.hellosign.com/v3"; -var SignatureRequestApi = class { - constructor(basePath) { - this._basePath = defaultBasePath9; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; - } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); - } - /** - * Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Only available for Standard plan and higher. - * @summary Embedded Bulk Send with Template - * @param signatureRequestBulkCreateEmbeddedWithTemplateRequest - * @param options - */ - async signatureRequestBulkCreateEmbeddedWithTemplate(signatureRequestBulkCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( - signatureRequestBulkCreateEmbeddedWithTemplateRequest, - "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" - ); - const localVarPath = this.basePath + "/signature_request/bulk_create_embedded_with_template"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestBulkCreateEmbeddedWithTemplateRequest === null || signatureRequestBulkCreateEmbeddedWithTemplateRequest === void 0) { - throw new Error( - "Required parameter signatureRequestBulkCreateEmbeddedWithTemplateRequest was null or undefined when calling signatureRequestBulkCreateEmbeddedWithTemplate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - signatureRequestBulkCreateEmbeddedWithTemplateRequest, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - signatureRequestBulkCreateEmbeddedWithTemplateRequest, - "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "BulkSendJobSendResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "BulkSendJobSendResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE:** Only available for Standard plan and higher. - * @summary Bulk Send with Template - * @param signatureRequestBulkSendWithTemplateRequest - * @param options - */ - async signatureRequestBulkSendWithTemplate(signatureRequestBulkSendWithTemplateRequest, options = { headers: {} }) { - signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded8( - signatureRequestBulkSendWithTemplateRequest, - "SignatureRequestBulkSendWithTemplateRequest" - ); - const localVarPath = this.basePath + "/signature_request/bulk_send_with_template"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestBulkSendWithTemplateRequest === null || signatureRequestBulkSendWithTemplateRequest === void 0) { - throw new Error( - "Required parameter signatureRequestBulkSendWithTemplateRequest was null or undefined when calling signatureRequestBulkSendWithTemplate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - signatureRequestBulkSendWithTemplateRequest, - SignatureRequestBulkSendWithTemplateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - signatureRequestBulkSendWithTemplateRequest, - "SignatureRequestBulkSendWithTemplateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "BulkSendJobSendResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "BulkSendJobSendResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. - * @summary Cancel Incomplete Signature Request - * @param signatureRequestId The id of the incomplete SignatureRequest to cancel. - * @param options - */ - async signatureRequestCancel(signatureRequestId, options = { headers: {} }) { - const localVarPath = this.basePath + "/signature_request/cancel/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestCancel." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9(resolve, reject, response); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. - * @summary Create Embedded Signature Request - * @param signatureRequestCreateEmbeddedRequest - * @param options - */ - async signatureRequestCreateEmbedded(signatureRequestCreateEmbeddedRequest, options = { headers: {} }) { - signatureRequestCreateEmbeddedRequest = deserializeIfNeeded8( - signatureRequestCreateEmbeddedRequest, - "SignatureRequestCreateEmbeddedRequest" - ); - const localVarPath = this.basePath + "/signature_request/create_embedded"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestCreateEmbeddedRequest === null || signatureRequestCreateEmbeddedRequest === void 0) { - throw new Error( - "Required parameter signatureRequestCreateEmbeddedRequest was null or undefined when calling signatureRequestCreateEmbedded." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - signatureRequestCreateEmbeddedRequest, - SignatureRequestCreateEmbeddedRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - signatureRequestCreateEmbeddedRequest, - "SignatureRequestCreateEmbeddedRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestGetResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. - * @summary Create Embedded Signature Request with Template - * @param signatureRequestCreateEmbeddedWithTemplateRequest - * @param options - */ - async signatureRequestCreateEmbeddedWithTemplate(signatureRequestCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded8( - signatureRequestCreateEmbeddedWithTemplateRequest, - "SignatureRequestCreateEmbeddedWithTemplateRequest" - ); - const localVarPath = this.basePath + "/signature_request/create_embedded_with_template"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestCreateEmbeddedWithTemplateRequest === null || signatureRequestCreateEmbeddedWithTemplateRequest === void 0) { - throw new Error( - "Required parameter signatureRequestCreateEmbeddedWithTemplateRequest was null or undefined when calling signatureRequestCreateEmbeddedWithTemplate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - signatureRequestCreateEmbeddedWithTemplateRequest, - SignatureRequestCreateEmbeddedWithTemplateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - signatureRequestCreateEmbeddedWithTemplateRequest, - "SignatureRequestCreateEmbeddedWithTemplateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestGetResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Edits and sends a SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. **NOTE:** Edit and resend *will* deduct your signature request quota. - * @summary Edit Signature Request - * @param signatureRequestId The id of the SignatureRequest to edit. - * @param signatureRequestEditRequest - * @param options - */ - async signatureRequestEdit(signatureRequestId, signatureRequestEditRequest, options = { headers: {} }) { - signatureRequestEditRequest = deserializeIfNeeded8( - signatureRequestEditRequest, - "SignatureRequestEditRequest" - ); - const localVarPath = this.basePath + "/signature_request/edit/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestEdit." - ); - } - if (signatureRequestEditRequest === null || signatureRequestEditRequest === void 0) { - throw new Error( - "Required parameter signatureRequestEditRequest was null or undefined when calling signatureRequestEdit." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - signatureRequestEditRequest, - SignatureRequestEditRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - signatureRequestEditRequest, - "SignatureRequestEditRequest" - ); - } - let localVarRequestOptions = { - method: "PUT", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestGetResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Edits a SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. - * @summary Edit Embedded Signature Request - * @param signatureRequestId The id of the SignatureRequest to edit. - * @param signatureRequestEditEmbeddedRequest - * @param options - */ - async signatureRequestEditEmbedded(signatureRequestId, signatureRequestEditEmbeddedRequest, options = { headers: {} }) { - signatureRequestEditEmbeddedRequest = deserializeIfNeeded8( - signatureRequestEditEmbeddedRequest, - "SignatureRequestEditEmbeddedRequest" - ); - const localVarPath = this.basePath + "/signature_request/edit_embedded/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestEditEmbedded." - ); - } - if (signatureRequestEditEmbeddedRequest === null || signatureRequestEditEmbeddedRequest === void 0) { - throw new Error( - "Required parameter signatureRequestEditEmbeddedRequest was null or undefined when calling signatureRequestEditEmbedded." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - signatureRequestEditEmbeddedRequest, - SignatureRequestEditEmbeddedRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - signatureRequestEditEmbeddedRequest, - "SignatureRequestEditEmbeddedRequest" - ); - } - let localVarRequestOptions = { - method: "PUT", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestGetResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Edits a SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Edit and resend *will* deduct your signature request quota. - * @summary Edit Embedded Signature Request with Template - * @param signatureRequestId The id of the SignatureRequest to edit. - * @param signatureRequestEditEmbeddedWithTemplateRequest - * @param options - */ - async signatureRequestEditEmbeddedWithTemplate(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest, options = { headers: {} }) { - signatureRequestEditEmbeddedWithTemplateRequest = deserializeIfNeeded8( - signatureRequestEditEmbeddedWithTemplateRequest, - "SignatureRequestEditEmbeddedWithTemplateRequest" - ); - const localVarPath = this.basePath + "/signature_request/edit_embedded_with_template/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestEditEmbeddedWithTemplate." - ); - } - if (signatureRequestEditEmbeddedWithTemplateRequest === null || signatureRequestEditEmbeddedWithTemplateRequest === void 0) { - throw new Error( - "Required parameter signatureRequestEditEmbeddedWithTemplateRequest was null or undefined when calling signatureRequestEditEmbeddedWithTemplate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - signatureRequestEditEmbeddedWithTemplateRequest, - SignatureRequestEditEmbeddedWithTemplateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - signatureRequestEditEmbeddedWithTemplateRequest, - "SignatureRequestEditEmbeddedWithTemplateRequest" - ); - } - let localVarRequestOptions = { - method: "PUT", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestGetResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Edits and sends a SignatureRequest based off of the Template(s) specified with the template_ids parameter. **NOTE:** Edit and resend *will* deduct your signature request quota. - * @summary Edit Signature Request With Template - * @param signatureRequestId The id of the SignatureRequest to edit. - * @param signatureRequestEditWithTemplateRequest - * @param options - */ - async signatureRequestEditWithTemplate(signatureRequestId, signatureRequestEditWithTemplateRequest, options = { headers: {} }) { - signatureRequestEditWithTemplateRequest = deserializeIfNeeded8( - signatureRequestEditWithTemplateRequest, - "SignatureRequestEditWithTemplateRequest" - ); - const localVarPath = this.basePath + "/signature_request/edit_with_template/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestEditWithTemplate." - ); - } - if (signatureRequestEditWithTemplateRequest === null || signatureRequestEditWithTemplateRequest === void 0) { - throw new Error( - "Required parameter signatureRequestEditWithTemplateRequest was null or undefined when calling signatureRequestEditWithTemplate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - signatureRequestEditWithTemplateRequest, - SignatureRequestEditWithTemplateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - signatureRequestEditWithTemplateRequest, - "SignatureRequestEditWithTemplateRequest" - ); - } - let localVarRequestOptions = { - method: "PUT", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestGetResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. - * @summary Download Files - * @param signatureRequestId The id of the SignatureRequest to retrieve. - * @param fileType Set to `pdf` for a single merged document or `zip` for a collection of individual documents. - * @param options - */ - async signatureRequestFiles(signatureRequestId, fileType, options = { headers: {} }) { - const localVarPath = this.basePath + "/signature_request/files/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/pdf", "application/zip", "application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestFiles." - ); - } - if (fileType !== void 0) { - localVarQueryParameters["file_type"] = ObjectSerializer.serialize( - fileType, - "'pdf' | 'zip'" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "arraybuffer" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "Buffer" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "RequestFile" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. - * @summary Download Files as Data Uri - * @param signatureRequestId The id of the SignatureRequest to retrieve. - * @param options - */ - async signatureRequestFilesAsDataUri(signatureRequestId, options = { headers: {} }) { - const localVarPath = this.basePath + "/signature_request/files_as_data_uri/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestFilesAsDataUri." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "FileResponseDataUri" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "FileResponseDataUri" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. - * @summary Download Files as File Url - * @param signatureRequestId The id of the SignatureRequest to retrieve. - * @param forceDownload By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. - * @param options - */ - async signatureRequestFilesAsFileUrl(signatureRequestId, forceDownload, options = { headers: {} }) { - const localVarPath = this.basePath + "/signature_request/files_as_file_url/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestFilesAsFileUrl." - ); - } - if (forceDownload !== void 0) { - localVarQueryParameters["force_download"] = ObjectSerializer.serialize( - forceDownload, - "number" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "FileResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "FileResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. - * @summary Get Signature Request - * @param signatureRequestId The id of the SignatureRequest to retrieve. - * @param options - */ - async signatureRequestGet(signatureRequestId, options = { headers: {} }) { - const localVarPath = this.basePath + "/signature_request/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestGet." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestGetResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. - * @summary List Signature Requests - * @param accountId Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. - * @param page Which page number of the SignatureRequest List to return. Defaults to `1`. - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. - * @param query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. - * @param options - */ - async signatureRequestList(accountId, page, pageSize, query, options = { headers: {} }) { - const localVarPath = this.basePath + "/signature_request/list"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (accountId !== void 0) { - localVarQueryParameters["account_id"] = ObjectSerializer.serialize( - accountId, - "string" - ); - } - if (page !== void 0) { - localVarQueryParameters["page"] = ObjectSerializer.serialize( - page, - "number" - ); - } - if (pageSize !== void 0) { - localVarQueryParameters["page_size"] = ObjectSerializer.serialize( - pageSize, - "number" - ); - } - if (query !== void 0) { - localVarQueryParameters["query"] = ObjectSerializer.serialize( - query, - "string" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestListResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestListResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. - * @summary Release On-Hold Signature Request - * @param signatureRequestId The id of the SignatureRequest to release. - * @param options - */ - async signatureRequestReleaseHold(signatureRequestId, options = { headers: {} }) { - const localVarPath = this.basePath + "/signature_request/release_hold/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestReleaseHold." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestGetResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE:** This action can **not** be used with embedded signature requests. - * @summary Send Request Reminder - * @param signatureRequestId The id of the SignatureRequest to send a reminder for. - * @param signatureRequestRemindRequest - * @param options - */ - async signatureRequestRemind(signatureRequestId, signatureRequestRemindRequest, options = { headers: {} }) { - signatureRequestRemindRequest = deserializeIfNeeded8( - signatureRequestRemindRequest, - "SignatureRequestRemindRequest" - ); - const localVarPath = this.basePath + "/signature_request/remind/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestRemind." - ); - } - if (signatureRequestRemindRequest === null || signatureRequestRemindRequest === void 0) { - throw new Error( - "Required parameter signatureRequestRemindRequest was null or undefined when calling signatureRequestRemind." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - signatureRequestRemindRequest, - SignatureRequestRemindRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - signatureRequestRemindRequest, - "SignatureRequestRemindRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestGetResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. - * @summary Remove Signature Request Access - * @param signatureRequestId The id of the SignatureRequest to remove. - * @param options - */ - async signatureRequestRemove(signatureRequestId, options = { headers: {} }) { - const localVarPath = this.basePath + "/signature_request/remove/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestRemove." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9(resolve, reject, response); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. - * @summary Send Signature Request - * @param signatureRequestSendRequest - * @param options - */ - async signatureRequestSend(signatureRequestSendRequest, options = { headers: {} }) { - signatureRequestSendRequest = deserializeIfNeeded8( - signatureRequestSendRequest, - "SignatureRequestSendRequest" - ); - const localVarPath = this.basePath + "/signature_request/send"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestSendRequest === null || signatureRequestSendRequest === void 0) { - throw new Error( - "Required parameter signatureRequestSendRequest was null or undefined when calling signatureRequestSend." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - signatureRequestSendRequest, - SignatureRequestSendRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - signatureRequestSendRequest, - "SignatureRequestSendRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestGetResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. - * @summary Send with Template - * @param signatureRequestSendWithTemplateRequest - * @param options - */ - async signatureRequestSendWithTemplate(signatureRequestSendWithTemplateRequest, options = { headers: {} }) { - signatureRequestSendWithTemplateRequest = deserializeIfNeeded8( - signatureRequestSendWithTemplateRequest, - "SignatureRequestSendWithTemplateRequest" - ); - const localVarPath = this.basePath + "/signature_request/send_with_template"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestSendWithTemplateRequest === null || signatureRequestSendWithTemplateRequest === void 0) { - throw new Error( - "Required parameter signatureRequestSendWithTemplateRequest was null or undefined when calling signatureRequestSendWithTemplate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - signatureRequestSendWithTemplateRequest, - SignatureRequestSendWithTemplateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - signatureRequestSendWithTemplateRequest, - "SignatureRequestSendWithTemplateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestGetResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE:** This action cannot be performed on a signature request with an appended signature page. - * @summary Update Signature Request - * @param signatureRequestId The id of the SignatureRequest to update. - * @param signatureRequestUpdateRequest - * @param options - */ - async signatureRequestUpdate(signatureRequestId, signatureRequestUpdateRequest, options = { headers: {} }) { - signatureRequestUpdateRequest = deserializeIfNeeded8( - signatureRequestUpdateRequest, - "SignatureRequestUpdateRequest" - ); - const localVarPath = this.basePath + "/signature_request/update/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling signatureRequestUpdate." - ); - } - if (signatureRequestUpdateRequest === null || signatureRequestUpdateRequest === void 0) { - throw new Error( - "Required parameter signatureRequestUpdateRequest was null or undefined when calling signatureRequestUpdate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - signatureRequestUpdateRequest, - SignatureRequestUpdateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - signatureRequestUpdateRequest, - "SignatureRequestUpdateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse9( - resolve, - reject, - response, - "SignatureRequestGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse9( - reject, - error.response, - 200, - "SignatureRequestGetResponse" - )) { - return; - } - if (handleErrorRangeResponse9( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } -}; -function deserializeIfNeeded8(obj, classname) { - if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { - return ObjectSerializer.deserialize(obj, classname); - } - return obj; -} -function handleSuccessfulResponse9(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse9(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse9(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/teamApi.ts -var defaultBasePath10 = "https://api.hellosign.com/v3"; -var TeamApi = class { - constructor(basePath) { - this._basePath = defaultBasePath10; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; - } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); - } - /** - * Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. - * @summary Add User to Team - * @param teamAddMemberRequest - * @param teamId The id of the team. - * @param options - */ - async teamAddMember(teamAddMemberRequest, teamId, options = { headers: {} }) { - teamAddMemberRequest = deserializeIfNeeded9( - teamAddMemberRequest, - "TeamAddMemberRequest" - ); - const localVarPath = this.basePath + "/team/add_member"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (teamAddMemberRequest === null || teamAddMemberRequest === void 0) { - throw new Error( - "Required parameter teamAddMemberRequest was null or undefined when calling teamAddMember." - ); - } - if (teamId !== void 0) { - localVarQueryParameters["team_id"] = ObjectSerializer.serialize( - teamId, - "string" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - teamAddMemberRequest, - TeamAddMemberRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - teamAddMemberRequest, - "TeamAddMemberRequest" - ); - } - let localVarRequestOptions = { - method: "PUT", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse10( - resolve, - reject, - response, - "TeamGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse10( - reject, - error.response, - 200, - "TeamGetResponse" - )) { - return; - } - if (handleErrorRangeResponse10( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. - * @summary Create Team - * @param teamCreateRequest - * @param options - */ - async teamCreate(teamCreateRequest, options = { headers: {} }) { - teamCreateRequest = deserializeIfNeeded9( - teamCreateRequest, - "TeamCreateRequest" - ); - const localVarPath = this.basePath + "/team/create"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (teamCreateRequest === null || teamCreateRequest === void 0) { - throw new Error( - "Required parameter teamCreateRequest was null or undefined when calling teamCreate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - teamCreateRequest, - TeamCreateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize(teamCreateRequest, "TeamCreateRequest"); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse10( - resolve, - reject, - response, - "TeamGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse10( - reject, - error.response, - 200, - "TeamGetResponse" - )) { - return; - } - if (handleErrorRangeResponse10( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). - * @summary Delete Team - * @param options - */ - async teamDelete(options = { headers: {} }) { - const localVarPath = this.basePath + "/team/destroy"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "DELETE", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse10(resolve, reject, response); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorRangeResponse10( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. - * @summary Get Team - * @param options - */ - async teamGet(options = { headers: {} }) { - const localVarPath = this.basePath + "/team"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse10( - resolve, - reject, - response, - "TeamGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse10( - reject, - error.response, - 200, - "TeamGetResponse" - )) { - return; - } - if (handleErrorRangeResponse10( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Provides information about a team. - * @summary Get Team Info - * @param teamId The id of the team. - * @param options - */ - async teamInfo(teamId, options = { headers: {} }) { - const localVarPath = this.basePath + "/team/info"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (teamId !== void 0) { - localVarQueryParameters["team_id"] = ObjectSerializer.serialize( - teamId, - "string" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse10( - resolve, - reject, - response, - "TeamGetInfoResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse10( - reject, - error.response, - 200, - "TeamGetInfoResponse" - )) { - return; - } - if (handleErrorRangeResponse10( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Provides a list of team invites (and their roles). - * @summary List Team Invites - * @param emailAddress The email address for which to display the team invites. - * @param options - */ - async teamInvites(emailAddress, options = { headers: {} }) { - const localVarPath = this.basePath + "/team/invites"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (emailAddress !== void 0) { - localVarQueryParameters["email_address"] = ObjectSerializer.serialize( - emailAddress, - "string" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse10( - resolve, - reject, - response, - "TeamInvitesResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse10( - reject, - error.response, - 200, - "TeamInvitesResponse" - )) { - return; - } - if (handleErrorRangeResponse10( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Provides a paginated list of members (and their roles) that belong to a given team. - * @summary List Team Members - * @param teamId The id of the team that a member list is being requested from. - * @param page Which page number of the team member list to return. Defaults to `1`. - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. - * @param options - */ - async teamMembers(teamId, page, pageSize, options = { headers: {} }) { - const localVarPath = this.basePath + "/team/members/{team_id}".replace( - "{team_id}", - encodeURIComponent(String(teamId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (teamId === null || teamId === void 0) { - throw new Error( - "Required parameter teamId was null or undefined when calling teamMembers." - ); - } - if (page !== void 0) { - localVarQueryParameters["page"] = ObjectSerializer.serialize( - page, - "number" - ); - } - if (pageSize !== void 0) { - localVarQueryParameters["page_size"] = ObjectSerializer.serialize( - pageSize, - "number" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse10( - resolve, - reject, - response, - "TeamMembersResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse10( - reject, - error.response, - 200, - "TeamMembersResponse" - )) { - return; - } - if (handleErrorRangeResponse10( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. - * @summary Remove User from Team - * @param teamRemoveMemberRequest - * @param options - */ - async teamRemoveMember(teamRemoveMemberRequest, options = { headers: {} }) { - teamRemoveMemberRequest = deserializeIfNeeded9( - teamRemoveMemberRequest, - "TeamRemoveMemberRequest" - ); - const localVarPath = this.basePath + "/team/remove_member"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (teamRemoveMemberRequest === null || teamRemoveMemberRequest === void 0) { - throw new Error( - "Required parameter teamRemoveMemberRequest was null or undefined when calling teamRemoveMember." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - teamRemoveMemberRequest, - TeamRemoveMemberRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - teamRemoveMemberRequest, - "TeamRemoveMemberRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse10( - resolve, - reject, - response, - "TeamGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse10( - reject, - error.response, - 201, - "TeamGetResponse" - )) { - return; - } - if (handleErrorRangeResponse10( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Provides a paginated list of sub teams that belong to a given team. - * @summary List Sub Teams - * @param teamId The id of the parent Team. - * @param page Which page number of the SubTeam List to return. Defaults to `1`. - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. - * @param options - */ - async teamSubTeams(teamId, page, pageSize, options = { headers: {} }) { - const localVarPath = this.basePath + "/team/sub_teams/{team_id}".replace( - "{team_id}", - encodeURIComponent(String(teamId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (teamId === null || teamId === void 0) { - throw new Error( - "Required parameter teamId was null or undefined when calling teamSubTeams." - ); - } - if (page !== void 0) { - localVarQueryParameters["page"] = ObjectSerializer.serialize( - page, - "number" - ); - } - if (pageSize !== void 0) { - localVarQueryParameters["page_size"] = ObjectSerializer.serialize( - pageSize, - "number" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse10( - resolve, - reject, - response, - "TeamSubTeamsResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse10( - reject, - error.response, - 200, - "TeamSubTeamsResponse" - )) { - return; - } - if (handleErrorRangeResponse10( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Updates the name of your Team. - * @summary Update Team - * @param teamUpdateRequest - * @param options - */ - async teamUpdate(teamUpdateRequest, options = { headers: {} }) { - teamUpdateRequest = deserializeIfNeeded9( - teamUpdateRequest, - "TeamUpdateRequest" - ); - const localVarPath = this.basePath + "/team"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (teamUpdateRequest === null || teamUpdateRequest === void 0) { - throw new Error( - "Required parameter teamUpdateRequest was null or undefined when calling teamUpdate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - teamUpdateRequest, - TeamUpdateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize(teamUpdateRequest, "TeamUpdateRequest"); - } - let localVarRequestOptions = { - method: "PUT", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse10( - resolve, - reject, - response, - "TeamGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse10( - reject, - error.response, - 200, - "TeamGetResponse" - )) { - return; - } - if (handleErrorRangeResponse10( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } -}; -function deserializeIfNeeded9(obj, classname) { - if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { - return ObjectSerializer.deserialize(obj, classname); - } - return obj; -} -function handleSuccessfulResponse10(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse10(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse10(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/templateApi.ts -var defaultBasePath11 = "https://api.hellosign.com/v3"; -var TemplateApi = class { - constructor(basePath) { - this._basePath = defaultBasePath11; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; - } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); - } - /** - * Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. - * @summary Add User to Template - * @param templateId The id of the Template to give the Account access to. - * @param templateAddUserRequest - * @param options - */ - async templateAddUser(templateId, templateAddUserRequest, options = { headers: {} }) { - templateAddUserRequest = deserializeIfNeeded10( - templateAddUserRequest, - "TemplateAddUserRequest" - ); - const localVarPath = this.basePath + "/template/add_user/{template_id}".replace( - "{template_id}", - encodeURIComponent(String(templateId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (templateId === null || templateId === void 0) { - throw new Error( - "Required parameter templateId was null or undefined when calling templateAddUser." - ); - } - if (templateAddUserRequest === null || templateAddUserRequest === void 0) { - throw new Error( - "Required parameter templateAddUserRequest was null or undefined when calling templateAddUser." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - templateAddUserRequest, - TemplateAddUserRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - templateAddUserRequest, - "TemplateAddUserRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse11( - resolve, - reject, - response, - "TemplateGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse11( - reject, - error.response, - 200, - "TemplateGetResponse" - )) { - return; - } - if (handleErrorRangeResponse11( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Creates a template that can then be used. - * @summary Create Template - * @param templateCreateRequest - * @param options - */ - async templateCreate(templateCreateRequest, options = { headers: {} }) { - templateCreateRequest = deserializeIfNeeded10( - templateCreateRequest, - "TemplateCreateRequest" - ); - const localVarPath = this.basePath + "/template/create"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (templateCreateRequest === null || templateCreateRequest === void 0) { - throw new Error( - "Required parameter templateCreateRequest was null or undefined when calling templateCreate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - templateCreateRequest, - TemplateCreateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - templateCreateRequest, - "TemplateCreateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse11( - resolve, - reject, - response, - "TemplateCreateResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse11( - reject, - error.response, - 200, - "TemplateCreateResponse" - )) { - return; - } - if (handleErrorRangeResponse11( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template \'edit\' stage. - * @summary Create Embedded Template Draft - * @param templateCreateEmbeddedDraftRequest - * @param options - */ - async templateCreateEmbeddedDraft(templateCreateEmbeddedDraftRequest, options = { headers: {} }) { - templateCreateEmbeddedDraftRequest = deserializeIfNeeded10( - templateCreateEmbeddedDraftRequest, - "TemplateCreateEmbeddedDraftRequest" - ); - const localVarPath = this.basePath + "/template/create_embedded_draft"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (templateCreateEmbeddedDraftRequest === null || templateCreateEmbeddedDraftRequest === void 0) { - throw new Error( - "Required parameter templateCreateEmbeddedDraftRequest was null or undefined when calling templateCreateEmbeddedDraft." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - templateCreateEmbeddedDraftRequest, - TemplateCreateEmbeddedDraftRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - templateCreateEmbeddedDraftRequest, - "TemplateCreateEmbeddedDraftRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse11( - resolve, - reject, - response, - "TemplateCreateEmbeddedDraftResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse11( - reject, - error.response, - 200, - "TemplateCreateEmbeddedDraftResponse" - )) { - return; - } - if (handleErrorRangeResponse11( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Completely deletes the template specified from the account. - * @summary Delete Template - * @param templateId The id of the Template to delete. - * @param options - */ - async templateDelete(templateId, options = { headers: {} }) { - const localVarPath = this.basePath + "/template/delete/{template_id}".replace( - "{template_id}", - encodeURIComponent(String(templateId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (templateId === null || templateId === void 0) { - throw new Error( - "Required parameter templateId was null or undefined when calling templateDelete." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse11(resolve, reject, response); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorRangeResponse11( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. - * @summary Get Template Files - * @param templateId The id of the template files to retrieve. - * @param fileType Set to `pdf` for a single merged document or `zip` for a collection of individual documents. - * @param options - */ - async templateFiles(templateId, fileType, options = { headers: {} }) { - const localVarPath = this.basePath + "/template/files/{template_id}".replace( - "{template_id}", - encodeURIComponent(String(templateId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/pdf", "application/zip", "application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (templateId === null || templateId === void 0) { - throw new Error( - "Required parameter templateId was null or undefined when calling templateFiles." - ); - } - if (fileType !== void 0) { - localVarQueryParameters["file_type"] = ObjectSerializer.serialize( - fileType, - "'pdf' | 'zip'" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "arraybuffer" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse11( - resolve, - reject, - response, - "Buffer" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse11( - reject, - error.response, - 200, - "RequestFile" - )) { - return; - } - if (handleErrorRangeResponse11( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. - * @summary Get Template Files as Data Uri - * @param templateId The id of the template files to retrieve. - * @param options - */ - async templateFilesAsDataUri(templateId, options = { headers: {} }) { - const localVarPath = this.basePath + "/template/files_as_data_uri/{template_id}".replace( - "{template_id}", - encodeURIComponent(String(templateId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (templateId === null || templateId === void 0) { - throw new Error( - "Required parameter templateId was null or undefined when calling templateFilesAsDataUri." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse11( - resolve, - reject, - response, - "FileResponseDataUri" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse11( - reject, - error.response, - 200, - "FileResponseDataUri" - )) { - return; - } - if (handleErrorRangeResponse11( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. - * @summary Get Template Files as File Url - * @param templateId The id of the template files to retrieve. - * @param forceDownload By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. - * @param options - */ - async templateFilesAsFileUrl(templateId, forceDownload, options = { headers: {} }) { - const localVarPath = this.basePath + "/template/files_as_file_url/{template_id}".replace( - "{template_id}", - encodeURIComponent(String(templateId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (templateId === null || templateId === void 0) { - throw new Error( - "Required parameter templateId was null or undefined when calling templateFilesAsFileUrl." - ); - } - if (forceDownload !== void 0) { - localVarQueryParameters["force_download"] = ObjectSerializer.serialize( - forceDownload, - "number" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse11( - resolve, - reject, - response, - "FileResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse11( - reject, - error.response, - 200, - "FileResponse" - )) { - return; - } - if (handleErrorRangeResponse11( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - }); - }); - } - /** - * Returns the Template specified by the `template_id` parameter. - * @summary Get Template - * @param templateId The id of the Template to retrieve. - * @param options - */ - async templateGet(templateId, options = { headers: {} }) { - const localVarPath = this.basePath + "/template/{template_id}".replace( - "{template_id}", - encodeURIComponent(String(templateId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (templateId === null || templateId === void 0) { - throw new Error( - "Required parameter templateId was null or undefined when calling templateGet." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse11( - resolve, - reject, - response, - "TemplateGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse11( - reject, - error.response, - 200, - "TemplateGetResponse" - )) { - return; - } - if (handleErrorRangeResponse11( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. - * @summary List Templates - * @param accountId Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. - * @param page Which page number of the Template List to return. Defaults to `1`. - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. - * @param query String that includes search terms and/or fields to be used to filter the Template objects. - * @param options - */ - async templateList(accountId, page, pageSize, query, options = { headers: {} }) { - const localVarPath = this.basePath + "/template/list"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (accountId !== void 0) { - localVarQueryParameters["account_id"] = ObjectSerializer.serialize( - accountId, - "string" - ); - } - if (page !== void 0) { - localVarQueryParameters["page"] = ObjectSerializer.serialize( - page, - "number" - ); - } - if (pageSize !== void 0) { - localVarQueryParameters["page_size"] = ObjectSerializer.serialize( - pageSize, - "number" - ); - } - if (query !== void 0) { - localVarQueryParameters["query"] = ObjectSerializer.serialize( - query, - "string" - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - let localVarRequestOptions = { - method: "GET", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json" - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse11( - resolve, - reject, - response, - "TemplateListResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse11( - reject, - error.response, - 200, - "TemplateListResponse" - )) { - return; - } - if (handleErrorRangeResponse11( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Removes the specified Account\'s access to the specified Template. - * @summary Remove User from Template - * @param templateId The id of the Template to remove the Account\'s access to. - * @param templateRemoveUserRequest - * @param options - */ - async templateRemoveUser(templateId, templateRemoveUserRequest, options = { headers: {} }) { - templateRemoveUserRequest = deserializeIfNeeded10( - templateRemoveUserRequest, - "TemplateRemoveUserRequest" - ); - const localVarPath = this.basePath + "/template/remove_user/{template_id}".replace( - "{template_id}", - encodeURIComponent(String(templateId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (templateId === null || templateId === void 0) { - throw new Error( - "Required parameter templateId was null or undefined when calling templateRemoveUser." - ); - } - if (templateRemoveUserRequest === null || templateRemoveUserRequest === void 0) { - throw new Error( - "Required parameter templateRemoveUserRequest was null or undefined when calling templateRemoveUser." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - templateRemoveUserRequest, - TemplateRemoveUserRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - templateRemoveUserRequest, - "TemplateRemoveUserRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse11( - resolve, - reject, - response, - "TemplateGetResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse11( - reject, - error.response, - 200, - "TemplateGetResponse" - )) { - return; - } - if (handleErrorRangeResponse11( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). - * @summary Update Template Files - * @param templateId The ID of the template whose files to update. - * @param templateUpdateFilesRequest - * @param options - */ - async templateUpdateFiles(templateId, templateUpdateFilesRequest, options = { headers: {} }) { - templateUpdateFilesRequest = deserializeIfNeeded10( - templateUpdateFilesRequest, - "TemplateUpdateFilesRequest" - ); - const localVarPath = this.basePath + "/template/update_files/{template_id}".replace( - "{template_id}", - encodeURIComponent(String(templateId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (templateId === null || templateId === void 0) { - throw new Error( - "Required parameter templateId was null or undefined when calling templateUpdateFiles." - ); - } - if (templateUpdateFilesRequest === null || templateUpdateFilesRequest === void 0) { - throw new Error( - "Required parameter templateUpdateFilesRequest was null or undefined when calling templateUpdateFiles." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - templateUpdateFilesRequest, - TemplateUpdateFilesRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - templateUpdateFilesRequest, - "TemplateUpdateFilesRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse11( - resolve, - reject, - response, - "TemplateUpdateFilesResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse11( - reject, - error.response, - 200, - "TemplateUpdateFilesResponse" - )) { - return; - } - if (handleErrorRangeResponse11( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } -}; -function deserializeIfNeeded10(obj, classname) { - if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { - return ObjectSerializer.deserialize(obj, classname); - } - return obj; -} -function handleSuccessfulResponse11(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse11(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse11(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/unclaimedDraftApi.ts -var defaultBasePath12 = "https://api.hellosign.com/v3"; -var UnclaimedDraftApi = class { - constructor(basePath) { - this._basePath = defaultBasePath12; - this._defaultHeaders = { "User-Agent": USER_AGENT }; - this._useQuerystring = false; - this.authentications = { - default: new VoidAuth(), - api_key: new HttpBasicAuth(), - oauth2: new HttpBearerAuth() - }; - this.interceptors = []; - if (basePath) { - this.basePath = basePath; - } - } - set useQuerystring(value) { - this._useQuerystring = value; - } - set basePath(basePath) { - this._basePath = basePath; - } - set defaultHeaders(defaultHeaders) { - this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; - } - get defaultHeaders() { - return this._defaultHeaders; - } - get basePath() { - return this._basePath; - } - setDefaultAuthentication(auth) { - this.authentications.default = auth; - } - setApiKey(key) { - this.authentications.api_key.username = key; - } - set username(username) { - this.authentications.api_key.username = username; - } - set password(password) { - this.authentications.api_key.password = password; - } - set accessToken(accessToken) { - this.authentications.oauth2.accessToken = accessToken; - } - addInterceptor(interceptor) { - this.interceptors.push(interceptor); - } - /** - * Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the \"Sign and send\" or the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. - * @summary Create Unclaimed Draft - * @param unclaimedDraftCreateRequest - * @param options - */ - async unclaimedDraftCreate(unclaimedDraftCreateRequest, options = { headers: {} }) { - unclaimedDraftCreateRequest = deserializeIfNeeded11( - unclaimedDraftCreateRequest, - "UnclaimedDraftCreateRequest" - ); - const localVarPath = this.basePath + "/unclaimed_draft/create"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (unclaimedDraftCreateRequest === null || unclaimedDraftCreateRequest === void 0) { - throw new Error( - "Required parameter unclaimedDraftCreateRequest was null or undefined when calling unclaimedDraftCreate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - unclaimedDraftCreateRequest, - UnclaimedDraftCreateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - unclaimedDraftCreateRequest, - "UnclaimedDraftCreateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse12( - resolve, - reject, - response, - "UnclaimedDraftCreateResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse12( - reject, - error.response, - 200, - "UnclaimedDraftCreateResponse" - )) { - return; - } - if (handleErrorRangeResponse12( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. - * @summary Create Embedded Unclaimed Draft - * @param unclaimedDraftCreateEmbeddedRequest - * @param options - */ - async unclaimedDraftCreateEmbedded(unclaimedDraftCreateEmbeddedRequest, options = { headers: {} }) { - unclaimedDraftCreateEmbeddedRequest = deserializeIfNeeded11( - unclaimedDraftCreateEmbeddedRequest, - "UnclaimedDraftCreateEmbeddedRequest" - ); - const localVarPath = this.basePath + "/unclaimed_draft/create_embedded"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (unclaimedDraftCreateEmbeddedRequest === null || unclaimedDraftCreateEmbeddedRequest === void 0) { - throw new Error( - "Required parameter unclaimedDraftCreateEmbeddedRequest was null or undefined when calling unclaimedDraftCreateEmbedded." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - unclaimedDraftCreateEmbeddedRequest, - UnclaimedDraftCreateEmbeddedRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - unclaimedDraftCreateEmbeddedRequest, - "UnclaimedDraftCreateEmbeddedRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse12( - resolve, - reject, - response, - "UnclaimedDraftCreateResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse12( - reject, - error.response, - 200, - "UnclaimedDraftCreateResponse" - )) { - return; - } - if (handleErrorRangeResponse12( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. - * @summary Create Embedded Unclaimed Draft with Template - * @param unclaimedDraftCreateEmbeddedWithTemplateRequest - * @param options - */ - async unclaimedDraftCreateEmbeddedWithTemplate(unclaimedDraftCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - unclaimedDraftCreateEmbeddedWithTemplateRequest = deserializeIfNeeded11( - unclaimedDraftCreateEmbeddedWithTemplateRequest, - "UnclaimedDraftCreateEmbeddedWithTemplateRequest" - ); - const localVarPath = this.basePath + "/unclaimed_draft/create_embedded_with_template"; - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (unclaimedDraftCreateEmbeddedWithTemplateRequest === null || unclaimedDraftCreateEmbeddedWithTemplateRequest === void 0) { - throw new Error( - "Required parameter unclaimedDraftCreateEmbeddedWithTemplateRequest was null or undefined when calling unclaimedDraftCreateEmbeddedWithTemplate." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - unclaimedDraftCreateEmbeddedWithTemplateRequest, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - unclaimedDraftCreateEmbeddedWithTemplateRequest, - "UnclaimedDraftCreateEmbeddedWithTemplateRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse12( - resolve, - reject, - response, - "UnclaimedDraftCreateResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse12( - reject, - error.response, - 200, - "UnclaimedDraftCreateResponse" - )) { - return; - } - if (handleErrorRangeResponse12( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } - /** - * Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester\'s email address will remain unchanged if `requester_email_address` parameter is not set. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. - * @summary Edit and Resend Unclaimed Draft - * @param signatureRequestId The ID of the signature request to edit and resend. - * @param unclaimedDraftEditAndResendRequest - * @param options - */ - async unclaimedDraftEditAndResend(signatureRequestId, unclaimedDraftEditAndResendRequest, options = { headers: {} }) { - unclaimedDraftEditAndResendRequest = deserializeIfNeeded11( - unclaimedDraftEditAndResendRequest, - "UnclaimedDraftEditAndResendRequest" - ); - const localVarPath = this.basePath + "/unclaimed_draft/edit_and_resend/{signature_request_id}".replace( - "{signature_request_id}", - encodeURIComponent(String(signatureRequestId)) - ); - let localVarQueryParameters = {}; - let localVarHeaderParams = Object.assign( - {}, - this._defaultHeaders - ); - const produces = ["application/json"]; - if (produces.indexOf("application/json") >= 0) { - localVarHeaderParams["content-type"] = "application/json"; - } else { - localVarHeaderParams["content-type"] = produces.join(","); - } - let localVarFormParams = {}; - let localVarBodyParams = void 0; - if (signatureRequestId === null || signatureRequestId === void 0) { - throw new Error( - "Required parameter signatureRequestId was null or undefined when calling unclaimedDraftEditAndResend." - ); - } - if (unclaimedDraftEditAndResendRequest === null || unclaimedDraftEditAndResendRequest === void 0) { - throw new Error( - "Required parameter unclaimedDraftEditAndResendRequest was null or undefined when calling unclaimedDraftEditAndResend." - ); - } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - unclaimedDraftEditAndResendRequest, - UnclaimedDraftEditAndResendRequest.attributeTypeMap - ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = { - ...localVarHeaderParams, - ...formData2.getHeaders() - }; - } else { - data = ObjectSerializer.serialize( - unclaimedDraftEditAndResendRequest, - "UnclaimedDraftEditAndResendRequest" - ); - } - let localVarRequestOptions = { - method: "POST", - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, - maxContentLength: Infinity, - maxBodyLength: Infinity, - responseType: "json", - data - }; - let authenticationPromise = Promise.resolve(); - if (this.authentications.api_key.username) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.api_key.applyToRequest(localVarRequestOptions) - ); - } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } - authenticationPromise = authenticationPromise.then( - () => this.authentications.default.applyToRequest(localVarRequestOptions) - ); - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then( - () => interceptor(localVarRequestOptions) - ); - } - return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - handleSuccessfulResponse12( - resolve, - reject, - response, - "UnclaimedDraftCreateResponse" - ); - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - if (handleErrorCodeResponse12( - reject, - error.response, - 200, - "UnclaimedDraftCreateResponse" - )) { - return; - } - if (handleErrorRangeResponse12( - reject, - error.response, - "4XX", - "ErrorResponse" - )) { - return; - } - reject(error); - } - ); - } - ); - }); - } -}; -function deserializeIfNeeded11(obj, classname) { - if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { - return ObjectSerializer.deserialize(obj, classname); - } - return obj; -} -function handleSuccessfulResponse12(resolve, reject, response, returnType) { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - if (returnType) { - body = ObjectSerializer.deserialize(body, returnType); - } - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } -} -function handleErrorCodeResponse12(reject, response, code, returnType) { - if (response.status !== code) { - return false; - } - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; -} -function handleErrorRangeResponse12(reject, response, code, returnType) { - let rangeCodeLeft = Number(code[0] + "00"); - let rangeCodeRight = Number(code[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - const body = ObjectSerializer.deserialize(response.data, returnType); - reject(new HttpError(response, body, response.status)); - return true; - } - return false; -} - -// api/apis.ts -var import_form_data2 = __toESM(require_form_data()); -var import_qs = __toESM(require_lib()); -var HttpError = class extends Error { - constructor(response, body, statusCode) { - super("HTTP request failed"); - this.response = response; - this.body = body; - this.statusCode = statusCode; - this.name = "HttpError"; - } -}; -var queryParamsSerializer = (params) => { - return import_qs.default.stringify(params, { arrayFormat: "brackets" }); -}; -var USER_AGENT = "OpenAPI-Generator/1.10-dev/node"; -var generateFormData = (obj, typemap) => { - const data = {}; - let localVarUseFormData = false; - if (typeof obj !== "object" || Array.isArray(obj) || obj === null) { - return { - localVarUseFormData, - data - }; - } - typemap.forEach((paramInfo) => { - if (obj[paramInfo.name] === void 0) { - return; - } - if (paramInfo.type.indexOf("RequestFile") !== -1) { - localVarUseFormData = true; - if (Array.isArray(obj[paramInfo.name])) { - obj[paramInfo.name].forEach((childObject, i) => { - const key = `${paramInfo.baseName}[${i}]`; - data[key] = childObject; - }); - return; - } - data[paramInfo.baseName] = obj[paramInfo.name]; - return; - } - if (paramInfo.type.indexOf("boolean") !== -1) { - data[paramInfo.baseName] = JSON.stringify(obj[paramInfo.name]); - return; - } - const serialized = ObjectSerializer.serialize( - obj[paramInfo.name], - paramInfo.type - ); - data[paramInfo.baseName] = shouldJsonify(serialized) ? JSON.stringify(serialized) : serialized; - }); - return { - localVarUseFormData, - data - }; -}; -var toFormData3 = (obj) => { - const form = new import_form_data2.default(); - Object.keys(obj).forEach((key) => { - if (isBufferDetailedFile(obj[key])) { - form.append(key, obj[key].value, obj[key].options); - return; - } - form.append(key, obj[key]); - }); - return form; -}; -function isBufferDetailedFile(obj) { - return obj.value !== void 0 && Buffer.isBuffer(obj.value) && obj.options !== void 0 && obj.options?.filename !== void 0 && obj.options?.contentType !== void 0; -} -var shouldJsonify = (val) => val === Object(val); - -// api/index.ts -var APIS = [ - AccountApi, - ApiAppApi, - BulkSendJobApi, - EmbeddedApi, - FaxApi, - FaxLineApi, - OAuthApi, - ReportApi, - SignatureRequestApi, - TeamApi, - TemplateApi, - UnclaimedDraftApi -]; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - APIS, - AccountApi, - AccountCreateRequest, - AccountCreateResponse, - AccountGetResponse, - AccountResponse, - AccountResponseQuotas, - AccountResponseUsage, - AccountUpdateRequest, - AccountVerifyRequest, - AccountVerifyResponse, - AccountVerifyResponseAccount, - ApiAppApi, - ApiAppCreateRequest, - ApiAppGetResponse, - ApiAppListResponse, - ApiAppResponse, - ApiAppResponseOAuth, - ApiAppResponseOptions, - ApiAppResponseOwnerAccount, - ApiAppResponseWhiteLabelingOptions, - ApiAppUpdateRequest, - ApiKeyAuth, - BulkSendJobApi, - BulkSendJobGetResponse, - BulkSendJobGetResponseSignatureRequests, - BulkSendJobListResponse, - BulkSendJobResponse, - BulkSendJobSendResponse, - EmbeddedApi, - EmbeddedEditUrlRequest, - EmbeddedEditUrlResponse, - EmbeddedEditUrlResponseEmbedded, - EmbeddedSignUrlResponse, - EmbeddedSignUrlResponseEmbedded, - ErrorResponse, - ErrorResponseError, - EventCallbackHelper, - EventCallbackRequest, - EventCallbackRequestEvent, - EventCallbackRequestEventMetadata, - FaxApi, - FaxGetResponse, - FaxLineAddUserRequest, - FaxLineApi, - FaxLineAreaCodeGetCountryEnum, - FaxLineAreaCodeGetProvinceEnum, - FaxLineAreaCodeGetResponse, - FaxLineAreaCodeGetStateEnum, - FaxLineCreateRequest, - FaxLineDeleteRequest, - FaxLineListResponse, - FaxLineRemoveUserRequest, - FaxLineResponse, - FaxLineResponseFaxLine, - FaxListResponse, - FaxResponse, - FaxResponseTransmission, - FaxSendRequest, - FileResponse, - FileResponseDataUri, - HttpBasicAuth, - HttpBearerAuth, - HttpError, - ListInfoResponse, - OAuth, - OAuthApi, - OAuthTokenGenerateRequest, - OAuthTokenRefreshRequest, - OAuthTokenResponse, - ObjectSerializer, - ReportApi, - ReportCreateRequest, - ReportCreateResponse, - ReportResponse, - SignatureRequestApi, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest, - SignatureRequestBulkSendWithTemplateRequest, - SignatureRequestCreateEmbeddedRequest, - SignatureRequestCreateEmbeddedWithTemplateRequest, - SignatureRequestEditEmbeddedRequest, - SignatureRequestEditEmbeddedWithTemplateRequest, - SignatureRequestEditRequest, - SignatureRequestEditWithTemplateRequest, - SignatureRequestGetResponse, - SignatureRequestListResponse, - SignatureRequestRemindRequest, - SignatureRequestResponse, - SignatureRequestResponseAttachment, - SignatureRequestResponseCustomFieldBase, - SignatureRequestResponseCustomFieldCheckbox, - SignatureRequestResponseCustomFieldText, - SignatureRequestResponseCustomFieldTypeEnum, - SignatureRequestResponseDataBase, - SignatureRequestResponseDataTypeEnum, - SignatureRequestResponseDataValueCheckbox, - SignatureRequestResponseDataValueCheckboxMerge, - SignatureRequestResponseDataValueDateSigned, - SignatureRequestResponseDataValueDropdown, - SignatureRequestResponseDataValueInitials, - SignatureRequestResponseDataValueRadio, - SignatureRequestResponseDataValueSignature, - SignatureRequestResponseDataValueText, - SignatureRequestResponseDataValueTextMerge, - SignatureRequestResponseSignatures, - SignatureRequestSendRequest, - SignatureRequestSendWithTemplateRequest, - SignatureRequestUpdateRequest, - SubAttachment, - SubBulkSignerList, - SubBulkSignerListCustomField, - SubCC, - SubCustomField, - SubEditorOptions, - SubFieldOptions, - SubFormFieldGroup, - SubFormFieldRule, - SubFormFieldRuleAction, - SubFormFieldRuleTrigger, - SubFormFieldsPerDocumentBase, - SubFormFieldsPerDocumentCheckbox, - SubFormFieldsPerDocumentCheckboxMerge, - SubFormFieldsPerDocumentDateSigned, - SubFormFieldsPerDocumentDropdown, - SubFormFieldsPerDocumentFontEnum, - SubFormFieldsPerDocumentHyperlink, - SubFormFieldsPerDocumentInitials, - SubFormFieldsPerDocumentRadio, - SubFormFieldsPerDocumentSignature, - SubFormFieldsPerDocumentText, - SubFormFieldsPerDocumentTextMerge, - SubFormFieldsPerDocumentTypeEnum, - SubMergeField, - SubOAuth, - SubOptions, - SubSignatureRequestGroupedSigners, - SubSignatureRequestSigner, - SubSignatureRequestTemplateSigner, - SubSigningOptions, - SubTeamResponse, - SubTemplateRole, - SubUnclaimedDraftSigner, - SubUnclaimedDraftTemplateSigner, - SubWhiteLabelingOptions, - TeamAddMemberRequest, - TeamApi, - TeamCreateRequest, - TeamGetInfoResponse, - TeamGetResponse, - TeamInfoResponse, - TeamInviteResponse, - TeamInvitesResponse, - TeamMemberResponse, - TeamMembersResponse, - TeamParentResponse, - TeamRemoveMemberRequest, - TeamResponse, - TeamSubTeamsResponse, - TeamUpdateRequest, - TemplateAddUserRequest, - TemplateApi, - TemplateCreateEmbeddedDraftRequest, - TemplateCreateEmbeddedDraftResponse, - TemplateCreateEmbeddedDraftResponseTemplate, - TemplateCreateRequest, - TemplateCreateResponse, - TemplateCreateResponseTemplate, - TemplateEditResponse, - TemplateGetResponse, - TemplateListResponse, - TemplateRemoveUserRequest, - TemplateResponse, - TemplateResponseAccount, - TemplateResponseAccountQuota, - TemplateResponseCCRole, - TemplateResponseDocument, - TemplateResponseDocumentCustomFieldBase, - TemplateResponseDocumentCustomFieldCheckbox, - TemplateResponseDocumentCustomFieldText, - TemplateResponseDocumentFieldGroup, - TemplateResponseDocumentFieldGroupRule, - TemplateResponseDocumentFormFieldBase, - TemplateResponseDocumentFormFieldCheckbox, - TemplateResponseDocumentFormFieldDateSigned, - TemplateResponseDocumentFormFieldDropdown, - TemplateResponseDocumentFormFieldHyperlink, - TemplateResponseDocumentFormFieldInitials, - TemplateResponseDocumentFormFieldRadio, - TemplateResponseDocumentFormFieldSignature, - TemplateResponseDocumentFormFieldText, - TemplateResponseDocumentStaticFieldBase, - TemplateResponseDocumentStaticFieldCheckbox, - TemplateResponseDocumentStaticFieldDateSigned, - TemplateResponseDocumentStaticFieldDropdown, - TemplateResponseDocumentStaticFieldHyperlink, - TemplateResponseDocumentStaticFieldInitials, - TemplateResponseDocumentStaticFieldRadio, - TemplateResponseDocumentStaticFieldSignature, - TemplateResponseDocumentStaticFieldText, - TemplateResponseFieldAvgTextLength, - TemplateResponseSignerRole, - TemplateUpdateFilesRequest, - TemplateUpdateFilesResponse, - TemplateUpdateFilesResponseTemplate, - USER_AGENT, - UnclaimedDraftApi, - UnclaimedDraftCreateEmbeddedRequest, - UnclaimedDraftCreateEmbeddedWithTemplateRequest, - UnclaimedDraftCreateRequest, - UnclaimedDraftCreateResponse, - UnclaimedDraftEditAndResendRequest, - UnclaimedDraftResponse, - VoidAuth, - WarningResponse, - enumsMap, - generateFormData, - queryParamsSerializer, - toFormData, - typeMap -}); -/*! Bundled license information: - -mime-db/index.js: - (*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015-2022 Douglas Christopher Wilson - * MIT Licensed - *) - -mime-types/index.js: - (*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - *) -*/ diff --git a/sdks/node/docs/api/TemplateApi.md b/sdks/node/docs/api/TemplateApi.md index d86551c72..2afac1956 100644 --- a/sdks/node/docs/api/TemplateApi.md +++ b/sdks/node/docs/api/TemplateApi.md @@ -8,6 +8,7 @@ All URIs are relative to https://api.hellosign.com/v3. | [**templateCreate()**](TemplateApi.md#templateCreate) | **POST** /template/create | Create Template | | [**templateCreateEmbeddedDraft()**](TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft | | [**templateDelete()**](TemplateApi.md#templateDelete) | **POST** /template/delete/{template_id} | Delete Template | +| [**templateEdit()**](TemplateApi.md#templateEdit) | **POST** /template/edit/{template_id} | _t__TemplateEdit::SUMMARY | | [**templateFiles()**](TemplateApi.md#templateFiles) | **GET** /template/files/{template_id} | Get Template Files | | [**templateFilesAsDataUri()**](TemplateApi.md#templateFilesAsDataUri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri | | [**templateFilesAsFileUrl()**](TemplateApi.md#templateFilesAsFileUrl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url | @@ -379,6 +380,46 @@ void (empty response body) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `templateEdit()` + +```typescript +templateEdit(templateId: string, templateEditRequest: TemplateEditRequest): TemplateEditResponse +``` + +_t__TemplateEdit::SUMMARY + +_t__TemplateEdit::DESCRIPTION + +### TypeScript Example + +```typescript +REPLACE_ME_WITH_EXAMPLE_FOR__templateEdit_TypeScript_CODE +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **templateId** | **string**| _t__TemplateEdit::TEMPLATE_ID | | +| **templateEditRequest** | [**TemplateEditRequest**](../model/TemplateEditRequest.md)| | | + +### Return type + +[**TemplateEditResponse**](../model/TemplateEditResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json`, `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `templateFiles()` ```typescript diff --git a/sdks/node/docs/model/TemplateEditRequest.md b/sdks/node/docs/model/TemplateEditRequest.md new file mode 100644 index 000000000..f39408230 --- /dev/null +++ b/sdks/node/docs/model/TemplateEditRequest.md @@ -0,0 +1,15 @@ +# # TemplateEditRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `ccRoles` | ```Array``` | _t__TemplateEdit::CC_ROLES | | +| `allowFormView` | ```boolean``` | _t__TemplateEdit::ALLOW_FORM_VIEW | | +| `title` | ```string``` | _t__TemplateEdit::TITLE | | +| `subject` | ```string``` | _t__TemplateEdit::SUBJECT | | +| `message` | ```string``` | _t__TemplateEdit::MESSAGE | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/TemplateEditResponse.md b/sdks/node/docs/model/TemplateEditResponse.md index 2f40ccbad..f3d2383b1 100644 --- a/sdks/node/docs/model/TemplateEditResponse.md +++ b/sdks/node/docs/model/TemplateEditResponse.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `templateId`*_required_ | ```string``` | The id of the Template. | | +| `template` | [```TemplateEditResponseTemplate```](TemplateEditResponseTemplate.md) | | | +| `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/TemplateEditResponseTemplate.md b/sdks/node/docs/model/TemplateEditResponseTemplate.md new file mode 100644 index 000000000..b2b4a25e0 --- /dev/null +++ b/sdks/node/docs/model/TemplateEditResponseTemplate.md @@ -0,0 +1,11 @@ +# # TemplateEditResponseTemplate + +_t__TemplateEditResponseTemplate::DESCRIPTION + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `templateId` | ```string``` | The id of the Template. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/model/index.ts b/sdks/node/model/index.ts index 1f2ea9c97..dd415da0e 100644 --- a/sdks/node/model/index.ts +++ b/sdks/node/model/index.ts @@ -160,7 +160,9 @@ import { TemplateCreateEmbeddedDraftResponseTemplate } from "./templateCreateEmb import { TemplateCreateRequest } from "./templateCreateRequest"; import { TemplateCreateResponse } from "./templateCreateResponse"; import { TemplateCreateResponseTemplate } from "./templateCreateResponseTemplate"; +import { TemplateEditRequest } from "./templateEditRequest"; import { TemplateEditResponse } from "./templateEditResponse"; +import { TemplateEditResponseTemplate } from "./templateEditResponseTemplate"; import { TemplateGetResponse } from "./templateGetResponse"; import { TemplateListResponse } from "./templateListResponse"; import { TemplateRemoveUserRequest } from "./templateRemoveUserRequest"; @@ -415,7 +417,9 @@ export let typeMap: { [index: string]: any } = { TemplateCreateRequest: TemplateCreateRequest, TemplateCreateResponse: TemplateCreateResponse, TemplateCreateResponseTemplate: TemplateCreateResponseTemplate, + TemplateEditRequest: TemplateEditRequest, TemplateEditResponse: TemplateEditResponse, + TemplateEditResponseTemplate: TemplateEditResponseTemplate, TemplateGetResponse: TemplateGetResponse, TemplateListResponse: TemplateListResponse, TemplateRemoveUserRequest: TemplateRemoveUserRequest, @@ -642,7 +646,9 @@ export { TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, + TemplateEditRequest, TemplateEditResponse, + TemplateEditResponseTemplate, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, diff --git a/sdks/node/model/subFormFieldRuleAction.ts b/sdks/node/model/subFormFieldRuleAction.ts index d1fe6f0ec..6e69881c6 100644 --- a/sdks/node/model/subFormFieldRuleAction.ts +++ b/sdks/node/model/subFormFieldRuleAction.ts @@ -77,8 +77,6 @@ export class SubFormFieldRuleAction { export namespace SubFormFieldRuleAction { export enum TypeEnum { ChangeFieldVisibility = "change-field-visibility", - FieldVisibility = "change-field-visibility", ChangeGroupVisibility = "change-group-visibility", - GroupVisibility = "change-group-visibility", } } diff --git a/sdks/node/model/templateEditRequest.ts b/sdks/node/model/templateEditRequest.ts new file mode 100644 index 000000000..8b62e1600 --- /dev/null +++ b/sdks/node/model/templateEditRequest.ts @@ -0,0 +1,87 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import { AttributeTypeMap, ObjectSerializer } from "./"; + +export class TemplateEditRequest { + /** + * _t__TemplateEdit::CC_ROLES + */ + "ccRoles"?: Array; + /** + * _t__TemplateEdit::ALLOW_FORM_VIEW + */ + "allowFormView"?: boolean; + /** + * _t__TemplateEdit::TITLE + */ + "title"?: string; + /** + * _t__TemplateEdit::SUBJECT + */ + "subject"?: string; + /** + * _t__TemplateEdit::MESSAGE + */ + "message"?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "ccRoles", + baseName: "cc_roles", + type: "Array", + }, + { + name: "allowFormView", + baseName: "allow_form_view", + type: "boolean", + }, + { + name: "title", + baseName: "title", + type: "string", + }, + { + name: "subject", + baseName: "subject", + type: "string", + }, + { + name: "message", + baseName: "message", + type: "string", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return TemplateEditRequest.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): TemplateEditRequest { + return ObjectSerializer.deserialize(data, "TemplateEditRequest"); + } +} diff --git a/sdks/node/model/templateEditResponse.ts b/sdks/node/model/templateEditResponse.ts index aa51f43d0..1441ffcd1 100644 --- a/sdks/node/model/templateEditResponse.ts +++ b/sdks/node/model/templateEditResponse.ts @@ -23,20 +23,28 @@ */ import { AttributeTypeMap, ObjectSerializer } from "./"; +import { TemplateEditResponseTemplate } from "./templateEditResponseTemplate"; +import { WarningResponse } from "./warningResponse"; export class TemplateEditResponse { + "template"?: TemplateEditResponseTemplate; /** - * The id of the Template. + * A list of warnings. */ - "templateId": string; + "warnings"?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: AttributeTypeMap = [ { - name: "templateId", - baseName: "template_id", - type: "string", + name: "template", + baseName: "template", + type: "TemplateEditResponseTemplate", + }, + { + name: "warnings", + baseName: "warnings", + type: "Array", }, ]; diff --git a/sdks/node/model/templateEditResponseTemplate.ts b/sdks/node/model/templateEditResponseTemplate.ts new file mode 100644 index 000000000..787207284 --- /dev/null +++ b/sdks/node/model/templateEditResponseTemplate.ts @@ -0,0 +1,54 @@ +/** + * The MIT License (MIT) + * + * Copyright (C) 2023 dropbox.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +import { AttributeTypeMap, ObjectSerializer } from "./"; + +/** + * _t__TemplateEditResponseTemplate::DESCRIPTION + */ +export class TemplateEditResponseTemplate { + /** + * The id of the Template. + */ + "templateId"?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "templateId", + baseName: "template_id", + type: "string", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return TemplateEditResponseTemplate.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): TemplateEditResponseTemplate { + return ObjectSerializer.deserialize(data, "TemplateEditResponseTemplate"); + } +} diff --git a/sdks/node/types/api.d.ts b/sdks/node/types/api.d.ts deleted file mode 100644 index fe1dc71ce..000000000 --- a/sdks/node/types/api.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './api/index'; -export * from './model/index'; diff --git a/sdks/node/types/api/accountApi.d.ts b/sdks/node/types/api/accountApi.d.ts deleted file mode 100644 index 21a0bc1c4..000000000 --- a/sdks/node/types/api/accountApi.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; -import { optionsI, returnTypeT } from "./"; -export declare enum AccountApiApiKeys { -} -export declare class AccountApi { - protected _basePath: string; - protected _defaultHeaders: any; - protected _useQuerystring: boolean; - protected authentications: { - default: Authentication; - api_key: HttpBasicAuth; - oauth2: HttpBearerAuth; - }; - protected interceptors: Interceptor[]; - constructor(basePath?: string); - set useQuerystring(value: boolean); - set basePath(basePath: string); - set defaultHeaders(defaultHeaders: any); - get defaultHeaders(): any; - get basePath(): string; - setDefaultAuthentication(auth: Authentication): void; - setApiKey(key: string): void; - set username(username: string); - set password(password: string); - set accessToken(accessToken: string | (() => string)); - addInterceptor(interceptor: Interceptor): void; - accountCreate(accountCreateRequest: AccountCreateRequest, options?: optionsI): Promise>; - accountGet(accountId?: string, emailAddress?: string, options?: optionsI): Promise>; - accountUpdate(accountUpdateRequest: AccountUpdateRequest, options?: optionsI): Promise>; - accountVerify(accountVerifyRequest: AccountVerifyRequest, options?: optionsI): Promise>; -} diff --git a/sdks/node/types/api/apiAppApi.d.ts b/sdks/node/types/api/apiAppApi.d.ts deleted file mode 100644 index c07f8bea3..000000000 --- a/sdks/node/types/api/apiAppApi.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppUpdateRequest, Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; -import { optionsI, returnTypeI, returnTypeT } from "./"; -export declare enum ApiAppApiApiKeys { -} -export declare class ApiAppApi { - protected _basePath: string; - protected _defaultHeaders: any; - protected _useQuerystring: boolean; - protected authentications: { - default: Authentication; - api_key: HttpBasicAuth; - oauth2: HttpBearerAuth; - }; - protected interceptors: Interceptor[]; - constructor(basePath?: string); - set useQuerystring(value: boolean); - set basePath(basePath: string); - set defaultHeaders(defaultHeaders: any); - get defaultHeaders(): any; - get basePath(): string; - setDefaultAuthentication(auth: Authentication): void; - setApiKey(key: string): void; - set username(username: string); - set password(password: string); - set accessToken(accessToken: string | (() => string)); - addInterceptor(interceptor: Interceptor): void; - apiAppCreate(apiAppCreateRequest: ApiAppCreateRequest, options?: optionsI): Promise>; - apiAppDelete(clientId: string, options?: optionsI): Promise; - apiAppGet(clientId: string, options?: optionsI): Promise>; - apiAppList(page?: number, pageSize?: number, options?: optionsI): Promise>; - apiAppUpdate(clientId: string, apiAppUpdateRequest: ApiAppUpdateRequest, options?: optionsI): Promise>; -} diff --git a/sdks/node/types/api/apis.d.ts b/sdks/node/types/api/apis.d.ts deleted file mode 100644 index 3e7e1c8eb..000000000 --- a/sdks/node/types/api/apis.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ErrorResponse } from "../model"; -export declare class HttpError extends Error { - response: AxiosResponse; - body: ErrorResponse; - statusCode?: number | undefined; - constructor(response: AxiosResponse, body: ErrorResponse, statusCode?: number | undefined); -} -export { RequestFile } from "../model"; -import { AxiosResponse } from "axios"; -import formData from "form-data"; -import { AttributeTypeMap } from "../model"; -export interface optionsI { - headers: { - [name: string]: string; - }; -} -export interface returnTypeT { - response: AxiosResponse; - body: T; -} -export interface returnTypeI { - response: AxiosResponse; - body?: any; -} -export declare const queryParamsSerializer: (params: any) => string; -export declare const USER_AGENT = "OpenAPI-Generator/1.10-dev/node"; -export declare const generateFormData: (obj: any, typemap: AttributeTypeMap) => { - localVarUseFormData: boolean; - data: object; -}; -export declare const toFormData: (obj: object) => formData; diff --git a/sdks/node/types/api/bulkSendJobApi.d.ts b/sdks/node/types/api/bulkSendJobApi.d.ts deleted file mode 100644 index 6d64cb54a..000000000 --- a/sdks/node/types/api/bulkSendJobApi.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Authentication, BulkSendJobGetResponse, BulkSendJobListResponse, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; -import { optionsI, returnTypeT } from "./"; -export declare enum BulkSendJobApiApiKeys { -} -export declare class BulkSendJobApi { - protected _basePath: string; - protected _defaultHeaders: any; - protected _useQuerystring: boolean; - protected authentications: { - default: Authentication; - api_key: HttpBasicAuth; - oauth2: HttpBearerAuth; - }; - protected interceptors: Interceptor[]; - constructor(basePath?: string); - set useQuerystring(value: boolean); - set basePath(basePath: string); - set defaultHeaders(defaultHeaders: any); - get defaultHeaders(): any; - get basePath(): string; - setDefaultAuthentication(auth: Authentication): void; - setApiKey(key: string): void; - set username(username: string); - set password(password: string); - set accessToken(accessToken: string | (() => string)); - addInterceptor(interceptor: Interceptor): void; - bulkSendJobGet(bulkSendJobId: string, page?: number, pageSize?: number, options?: optionsI): Promise>; - bulkSendJobList(page?: number, pageSize?: number, options?: optionsI): Promise>; -} diff --git a/sdks/node/types/api/embeddedApi.d.ts b/sdks/node/types/api/embeddedApi.d.ts deleted file mode 100644 index f66b6d702..000000000 --- a/sdks/node/types/api/embeddedApi.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Authentication, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedSignUrlResponse, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; -import { optionsI, returnTypeT } from "./"; -export declare enum EmbeddedApiApiKeys { -} -export declare class EmbeddedApi { - protected _basePath: string; - protected _defaultHeaders: any; - protected _useQuerystring: boolean; - protected authentications: { - default: Authentication; - api_key: HttpBasicAuth; - oauth2: HttpBearerAuth; - }; - protected interceptors: Interceptor[]; - constructor(basePath?: string); - set useQuerystring(value: boolean); - set basePath(basePath: string); - set defaultHeaders(defaultHeaders: any); - get defaultHeaders(): any; - get basePath(): string; - setDefaultAuthentication(auth: Authentication): void; - setApiKey(key: string): void; - set username(username: string); - set password(password: string); - set accessToken(accessToken: string | (() => string)); - addInterceptor(interceptor: Interceptor): void; - embeddedEditUrl(templateId: string, embeddedEditUrlRequest: EmbeddedEditUrlRequest, options?: optionsI): Promise>; - embeddedSignUrl(signatureId: string, options?: optionsI): Promise>; -} diff --git a/sdks/node/types/api/faxApi.d.ts b/sdks/node/types/api/faxApi.d.ts deleted file mode 100644 index f18e42259..000000000 --- a/sdks/node/types/api/faxApi.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Authentication, FaxGetResponse, FaxListResponse, FaxSendRequest, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; -import { optionsI, returnTypeI, returnTypeT } from "./"; -export declare enum FaxApiApiKeys { -} -export declare class FaxApi { - protected _basePath: string; - protected _defaultHeaders: any; - protected _useQuerystring: boolean; - protected authentications: { - default: Authentication; - api_key: HttpBasicAuth; - oauth2: HttpBearerAuth; - }; - protected interceptors: Interceptor[]; - constructor(basePath?: string); - set useQuerystring(value: boolean); - set basePath(basePath: string); - set defaultHeaders(defaultHeaders: any); - get defaultHeaders(): any; - get basePath(): string; - setDefaultAuthentication(auth: Authentication): void; - setApiKey(key: string): void; - set username(username: string); - set password(password: string); - set accessToken(accessToken: string | (() => string)); - addInterceptor(interceptor: Interceptor): void; - faxDelete(faxId: string, options?: optionsI): Promise; - faxFiles(faxId: string, options?: optionsI): Promise>; - faxGet(faxId: string, options?: optionsI): Promise>; - faxList(page?: number, pageSize?: number, options?: optionsI): Promise>; - faxSend(faxSendRequest: FaxSendRequest, options?: optionsI): Promise>; -} diff --git a/sdks/node/types/api/faxLineApi.d.ts b/sdks/node/types/api/faxLineApi.d.ts deleted file mode 100644 index 64b2a45a0..000000000 --- a/sdks/node/types/api/faxLineApi.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Authentication, FaxLineAddUserRequest, FaxLineAreaCodeGetResponse, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; -import { optionsI, returnTypeI, returnTypeT } from "./"; -export declare enum FaxLineApiApiKeys { -} -export declare class FaxLineApi { - protected _basePath: string; - protected _defaultHeaders: any; - protected _useQuerystring: boolean; - protected authentications: { - default: Authentication; - api_key: HttpBasicAuth; - oauth2: HttpBearerAuth; - }; - protected interceptors: Interceptor[]; - constructor(basePath?: string); - set useQuerystring(value: boolean); - set basePath(basePath: string); - set defaultHeaders(defaultHeaders: any); - get defaultHeaders(): any; - get basePath(): string; - setDefaultAuthentication(auth: Authentication): void; - setApiKey(key: string): void; - set username(username: string); - set password(password: string); - set accessToken(accessToken: string | (() => string)); - addInterceptor(interceptor: Interceptor): void; - faxLineAddUser(faxLineAddUserRequest: FaxLineAddUserRequest, options?: optionsI): Promise>; - faxLineAreaCodeGet(country: "CA" | "US" | "UK", state?: "AK" | "AL" | "AR" | "AZ" | "CA" | "CO" | "CT" | "DC" | "DE" | "FL" | "GA" | "HI" | "IA" | "ID" | "IL" | "IN" | "KS" | "KY" | "LA" | "MA" | "MD" | "ME" | "MI" | "MN" | "MO" | "MS" | "MT" | "NC" | "ND" | "NE" | "NH" | "NJ" | "NM" | "NV" | "NY" | "OH" | "OK" | "OR" | "PA" | "RI" | "SC" | "SD" | "TN" | "TX" | "UT" | "VA" | "VT" | "WA" | "WI" | "WV" | "WY", province?: "AB" | "BC" | "MB" | "NB" | "NL" | "NT" | "NS" | "NU" | "ON" | "PE" | "QC" | "SK" | "YT", city?: string, options?: optionsI): Promise>; - faxLineCreate(faxLineCreateRequest: FaxLineCreateRequest, options?: optionsI): Promise>; - faxLineDelete(faxLineDeleteRequest: FaxLineDeleteRequest, options?: optionsI): Promise; - faxLineGet(number: string, options?: optionsI): Promise>; - faxLineList(accountId?: string, page?: number, pageSize?: number, showTeamLines?: boolean, options?: optionsI): Promise>; - faxLineRemoveUser(faxLineRemoveUserRequest: FaxLineRemoveUserRequest, options?: optionsI): Promise>; -} diff --git a/sdks/node/types/api/index.d.ts b/sdks/node/types/api/index.d.ts deleted file mode 100644 index 4fb28dcef..000000000 --- a/sdks/node/types/api/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AccountApi } from "./accountApi"; -import { ApiAppApi } from "./apiAppApi"; -import { BulkSendJobApi } from "./bulkSendJobApi"; -import { EmbeddedApi } from "./embeddedApi"; -import { FaxApi } from "./faxApi"; -import { FaxLineApi } from "./faxLineApi"; -import { OAuthApi } from "./oAuthApi"; -import { ReportApi } from "./reportApi"; -import { SignatureRequestApi } from "./signatureRequestApi"; -import { TeamApi } from "./teamApi"; -import { TemplateApi } from "./templateApi"; -import { UnclaimedDraftApi } from "./unclaimedDraftApi"; -export { AccountApi, ApiAppApi, BulkSendJobApi, EmbeddedApi, FaxApi, FaxLineApi, OAuthApi, ReportApi, SignatureRequestApi, TeamApi, TemplateApi, UnclaimedDraftApi, }; -export { generateFormData, HttpError, optionsI, queryParamsSerializer, returnTypeI, returnTypeT, toFormData, USER_AGENT, } from "./apis"; -export declare const APIS: (typeof AccountApi | typeof ApiAppApi | typeof BulkSendJobApi | typeof EmbeddedApi | typeof FaxApi | typeof FaxLineApi | typeof OAuthApi | typeof ReportApi | typeof SignatureRequestApi | typeof TeamApi | typeof TemplateApi | typeof UnclaimedDraftApi)[]; diff --git a/sdks/node/types/api/oAuthApi.d.ts b/sdks/node/types/api/oAuthApi.d.ts deleted file mode 100644 index 28b40664c..000000000 --- a/sdks/node/types/api/oAuthApi.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse } from "../model"; -import { optionsI, returnTypeT } from "./"; -export declare enum OAuthApiApiKeys { -} -export declare class OAuthApi { - protected _basePath: string; - protected _defaultHeaders: any; - protected _useQuerystring: boolean; - protected authentications: { - default: Authentication; - api_key: HttpBasicAuth; - oauth2: HttpBearerAuth; - }; - protected interceptors: Interceptor[]; - constructor(basePath?: string); - set useQuerystring(value: boolean); - set basePath(basePath: string); - set defaultHeaders(defaultHeaders: any); - get defaultHeaders(): any; - get basePath(): string; - setDefaultAuthentication(auth: Authentication): void; - setApiKey(key: string): void; - set username(username: string); - set password(password: string); - set accessToken(accessToken: string | (() => string)); - addInterceptor(interceptor: Interceptor): void; - oauthTokenGenerate(oAuthTokenGenerateRequest: OAuthTokenGenerateRequest, options?: optionsI): Promise>; - oauthTokenRefresh(oAuthTokenRefreshRequest: OAuthTokenRefreshRequest, options?: optionsI): Promise>; -} diff --git a/sdks/node/types/api/reportApi.d.ts b/sdks/node/types/api/reportApi.d.ts deleted file mode 100644 index c32ef2358..000000000 --- a/sdks/node/types/api/reportApi.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, ReportCreateRequest, ReportCreateResponse } from "../model"; -import { optionsI, returnTypeT } from "./"; -export declare enum ReportApiApiKeys { -} -export declare class ReportApi { - protected _basePath: string; - protected _defaultHeaders: any; - protected _useQuerystring: boolean; - protected authentications: { - default: Authentication; - api_key: HttpBasicAuth; - oauth2: HttpBearerAuth; - }; - protected interceptors: Interceptor[]; - constructor(basePath?: string); - set useQuerystring(value: boolean); - set basePath(basePath: string); - set defaultHeaders(defaultHeaders: any); - get defaultHeaders(): any; - get basePath(): string; - setDefaultAuthentication(auth: Authentication): void; - setApiKey(key: string): void; - set username(username: string); - set password(password: string); - set accessToken(accessToken: string | (() => string)); - addInterceptor(interceptor: Interceptor): void; - reportCreate(reportCreateRequest: ReportCreateRequest, options?: optionsI): Promise>; -} diff --git a/sdks/node/types/api/signatureRequestApi.d.ts b/sdks/node/types/api/signatureRequestApi.d.ts deleted file mode 100644 index 54c21ae91..000000000 --- a/sdks/node/types/api/signatureRequestApi.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Authentication, BulkSendJobSendResponse, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestEditEmbeddedRequest, SignatureRequestEditEmbeddedWithTemplateRequest, SignatureRequestEditRequest, SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest } from "../model"; -import { optionsI, returnTypeI, returnTypeT } from "./"; -export declare enum SignatureRequestApiApiKeys { -} -export declare class SignatureRequestApi { - protected _basePath: string; - protected _defaultHeaders: any; - protected _useQuerystring: boolean; - protected authentications: { - default: Authentication; - api_key: HttpBasicAuth; - oauth2: HttpBearerAuth; - }; - protected interceptors: Interceptor[]; - constructor(basePath?: string); - set useQuerystring(value: boolean); - set basePath(basePath: string); - set defaultHeaders(defaultHeaders: any); - get defaultHeaders(): any; - get basePath(): string; - setDefaultAuthentication(auth: Authentication): void; - setApiKey(key: string): void; - set username(username: string); - set password(password: string); - set accessToken(accessToken: string | (() => string)); - addInterceptor(interceptor: Interceptor): void; - signatureRequestBulkCreateEmbeddedWithTemplate(signatureRequestBulkCreateEmbeddedWithTemplateRequest: SignatureRequestBulkCreateEmbeddedWithTemplateRequest, options?: optionsI): Promise>; - signatureRequestBulkSendWithTemplate(signatureRequestBulkSendWithTemplateRequest: SignatureRequestBulkSendWithTemplateRequest, options?: optionsI): Promise>; - signatureRequestCancel(signatureRequestId: string, options?: optionsI): Promise; - signatureRequestCreateEmbedded(signatureRequestCreateEmbeddedRequest: SignatureRequestCreateEmbeddedRequest, options?: optionsI): Promise>; - signatureRequestCreateEmbeddedWithTemplate(signatureRequestCreateEmbeddedWithTemplateRequest: SignatureRequestCreateEmbeddedWithTemplateRequest, options?: optionsI): Promise>; - signatureRequestEdit(signatureRequestId: string, signatureRequestEditRequest: SignatureRequestEditRequest, options?: optionsI): Promise>; - signatureRequestEditEmbedded(signatureRequestId: string, signatureRequestEditEmbeddedRequest: SignatureRequestEditEmbeddedRequest, options?: optionsI): Promise>; - signatureRequestEditEmbeddedWithTemplate(signatureRequestId: string, signatureRequestEditEmbeddedWithTemplateRequest: SignatureRequestEditEmbeddedWithTemplateRequest, options?: optionsI): Promise>; - signatureRequestEditWithTemplate(signatureRequestId: string, signatureRequestEditWithTemplateRequest: SignatureRequestEditWithTemplateRequest, options?: optionsI): Promise>; - signatureRequestFiles(signatureRequestId: string, fileType?: "pdf" | "zip", options?: optionsI): Promise>; - signatureRequestFilesAsDataUri(signatureRequestId: string, options?: optionsI): Promise>; - signatureRequestFilesAsFileUrl(signatureRequestId: string, forceDownload?: number, options?: optionsI): Promise>; - signatureRequestGet(signatureRequestId: string, options?: optionsI): Promise>; - signatureRequestList(accountId?: string, page?: number, pageSize?: number, query?: string, options?: optionsI): Promise>; - signatureRequestReleaseHold(signatureRequestId: string, options?: optionsI): Promise>; - signatureRequestRemind(signatureRequestId: string, signatureRequestRemindRequest: SignatureRequestRemindRequest, options?: optionsI): Promise>; - signatureRequestRemove(signatureRequestId: string, options?: optionsI): Promise; - signatureRequestSend(signatureRequestSendRequest: SignatureRequestSendRequest, options?: optionsI): Promise>; - signatureRequestSendWithTemplate(signatureRequestSendWithTemplateRequest: SignatureRequestSendWithTemplateRequest, options?: optionsI): Promise>; - signatureRequestUpdate(signatureRequestId: string, signatureRequestUpdateRequest: SignatureRequestUpdateRequest, options?: optionsI): Promise>; -} diff --git a/sdks/node/types/api/teamApi.d.ts b/sdks/node/types/api/teamApi.d.ts deleted file mode 100644 index 31b05a503..000000000 --- a/sdks/node/types/api/teamApi.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInvitesResponse, TeamMembersResponse, TeamRemoveMemberRequest, TeamSubTeamsResponse, TeamUpdateRequest } from "../model"; -import { optionsI, returnTypeI, returnTypeT } from "./"; -export declare enum TeamApiApiKeys { -} -export declare class TeamApi { - protected _basePath: string; - protected _defaultHeaders: any; - protected _useQuerystring: boolean; - protected authentications: { - default: Authentication; - api_key: HttpBasicAuth; - oauth2: HttpBearerAuth; - }; - protected interceptors: Interceptor[]; - constructor(basePath?: string); - set useQuerystring(value: boolean); - set basePath(basePath: string); - set defaultHeaders(defaultHeaders: any); - get defaultHeaders(): any; - get basePath(): string; - setDefaultAuthentication(auth: Authentication): void; - setApiKey(key: string): void; - set username(username: string); - set password(password: string); - set accessToken(accessToken: string | (() => string)); - addInterceptor(interceptor: Interceptor): void; - teamAddMember(teamAddMemberRequest: TeamAddMemberRequest, teamId?: string, options?: optionsI): Promise>; - teamCreate(teamCreateRequest: TeamCreateRequest, options?: optionsI): Promise>; - teamDelete(options?: optionsI): Promise; - teamGet(options?: optionsI): Promise>; - teamInfo(teamId?: string, options?: optionsI): Promise>; - teamInvites(emailAddress?: string, options?: optionsI): Promise>; - teamMembers(teamId: string, page?: number, pageSize?: number, options?: optionsI): Promise>; - teamRemoveMember(teamRemoveMemberRequest: TeamRemoveMemberRequest, options?: optionsI): Promise>; - teamSubTeams(teamId: string, page?: number, pageSize?: number, options?: optionsI): Promise>; - teamUpdate(teamUpdateRequest: TeamUpdateRequest, options?: optionsI): Promise>; -} diff --git a/sdks/node/types/api/templateApi.d.ts b/sdks/node/types/api/templateApi.d.ts deleted file mode 100644 index aeaa69a46..000000000 --- a/sdks/node/types/api/templateApi.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Authentication, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateRequest, TemplateCreateResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse } from "../model"; -import { optionsI, returnTypeI, returnTypeT } from "./"; -export declare enum TemplateApiApiKeys { -} -export declare class TemplateApi { - protected _basePath: string; - protected _defaultHeaders: any; - protected _useQuerystring: boolean; - protected authentications: { - default: Authentication; - api_key: HttpBasicAuth; - oauth2: HttpBearerAuth; - }; - protected interceptors: Interceptor[]; - constructor(basePath?: string); - set useQuerystring(value: boolean); - set basePath(basePath: string); - set defaultHeaders(defaultHeaders: any); - get defaultHeaders(): any; - get basePath(): string; - setDefaultAuthentication(auth: Authentication): void; - setApiKey(key: string): void; - set username(username: string); - set password(password: string); - set accessToken(accessToken: string | (() => string)); - addInterceptor(interceptor: Interceptor): void; - templateAddUser(templateId: string, templateAddUserRequest: TemplateAddUserRequest, options?: optionsI): Promise>; - templateCreate(templateCreateRequest: TemplateCreateRequest, options?: optionsI): Promise>; - templateCreateEmbeddedDraft(templateCreateEmbeddedDraftRequest: TemplateCreateEmbeddedDraftRequest, options?: optionsI): Promise>; - templateDelete(templateId: string, options?: optionsI): Promise; - templateFiles(templateId: string, fileType?: "pdf" | "zip", options?: optionsI): Promise>; - templateFilesAsDataUri(templateId: string, options?: optionsI): Promise>; - templateFilesAsFileUrl(templateId: string, forceDownload?: number, options?: optionsI): Promise>; - templateGet(templateId: string, options?: optionsI): Promise>; - templateList(accountId?: string, page?: number, pageSize?: number, query?: string, options?: optionsI): Promise>; - templateRemoveUser(templateId: string, templateRemoveUserRequest: TemplateRemoveUserRequest, options?: optionsI): Promise>; - templateUpdateFiles(templateId: string, templateUpdateFilesRequest: TemplateUpdateFilesRequest, options?: optionsI): Promise>; -} diff --git a/sdks/node/types/api/unclaimedDraftApi.d.ts b/sdks/node/types/api/unclaimedDraftApi.d.ts deleted file mode 100644 index df8e1699c..000000000 --- a/sdks/node/types/api/unclaimedDraftApi.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest } from "../model"; -import { optionsI, returnTypeT } from "./"; -export declare enum UnclaimedDraftApiApiKeys { -} -export declare class UnclaimedDraftApi { - protected _basePath: string; - protected _defaultHeaders: any; - protected _useQuerystring: boolean; - protected authentications: { - default: Authentication; - api_key: HttpBasicAuth; - oauth2: HttpBearerAuth; - }; - protected interceptors: Interceptor[]; - constructor(basePath?: string); - set useQuerystring(value: boolean); - set basePath(basePath: string); - set defaultHeaders(defaultHeaders: any); - get defaultHeaders(): any; - get basePath(): string; - setDefaultAuthentication(auth: Authentication): void; - setApiKey(key: string): void; - set username(username: string); - set password(password: string); - set accessToken(accessToken: string | (() => string)); - addInterceptor(interceptor: Interceptor): void; - unclaimedDraftCreate(unclaimedDraftCreateRequest: UnclaimedDraftCreateRequest, options?: optionsI): Promise>; - unclaimedDraftCreateEmbedded(unclaimedDraftCreateEmbeddedRequest: UnclaimedDraftCreateEmbeddedRequest, options?: optionsI): Promise>; - unclaimedDraftCreateEmbeddedWithTemplate(unclaimedDraftCreateEmbeddedWithTemplateRequest: UnclaimedDraftCreateEmbeddedWithTemplateRequest, options?: optionsI): Promise>; - unclaimedDraftEditAndResend(signatureRequestId: string, unclaimedDraftEditAndResendRequest: UnclaimedDraftEditAndResendRequest, options?: optionsI): Promise>; -} diff --git a/sdks/node/types/model/accountCreateRequest.d.ts b/sdks/node/types/model/accountCreateRequest.d.ts deleted file mode 100644 index 1840fc5b3..000000000 --- a/sdks/node/types/model/accountCreateRequest.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class AccountCreateRequest { - "emailAddress": string; - "clientId"?: string; - "clientSecret"?: string; - "locale"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): AccountCreateRequest; -} diff --git a/sdks/node/types/model/accountCreateResponse.d.ts b/sdks/node/types/model/accountCreateResponse.d.ts deleted file mode 100644 index b0739f3d6..000000000 --- a/sdks/node/types/model/accountCreateResponse.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { AccountResponse } from "./accountResponse"; -import { OAuthTokenResponse } from "./oAuthTokenResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class AccountCreateResponse { - "account": AccountResponse; - "oauthData"?: OAuthTokenResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): AccountCreateResponse; -} diff --git a/sdks/node/types/model/accountGetResponse.d.ts b/sdks/node/types/model/accountGetResponse.d.ts deleted file mode 100644 index d46206b49..000000000 --- a/sdks/node/types/model/accountGetResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { AccountResponse } from "./accountResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class AccountGetResponse { - "account": AccountResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): AccountGetResponse; -} diff --git a/sdks/node/types/model/accountResponse.d.ts b/sdks/node/types/model/accountResponse.d.ts deleted file mode 100644 index c38fde985..000000000 --- a/sdks/node/types/model/accountResponse.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { AccountResponseQuotas } from "./accountResponseQuotas"; -import { AccountResponseUsage } from "./accountResponseUsage"; -export declare class AccountResponse { - "accountId"?: string; - "emailAddress"?: string; - "isLocked"?: boolean; - "isPaidHs"?: boolean; - "isPaidHf"?: boolean; - "quotas"?: AccountResponseQuotas; - "callbackUrl"?: string | null; - "roleCode"?: string | null; - "teamId"?: string | null; - "locale"?: string | null; - "usage"?: AccountResponseUsage; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): AccountResponse; -} diff --git a/sdks/node/types/model/accountResponseQuotas.d.ts b/sdks/node/types/model/accountResponseQuotas.d.ts deleted file mode 100644 index 6bbcc52c6..000000000 --- a/sdks/node/types/model/accountResponseQuotas.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class AccountResponseQuotas { - "apiSignatureRequestsLeft"?: number | null; - "documentsLeft"?: number | null; - "templatesTotal"?: number | null; - "templatesLeft"?: number | null; - "smsVerificationsLeft"?: number | null; - "numFaxPagesLeft"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): AccountResponseQuotas; -} diff --git a/sdks/node/types/model/accountResponseUsage.d.ts b/sdks/node/types/model/accountResponseUsage.d.ts deleted file mode 100644 index 7506ca0ee..000000000 --- a/sdks/node/types/model/accountResponseUsage.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class AccountResponseUsage { - "faxPagesSent"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): AccountResponseUsage; -} diff --git a/sdks/node/types/model/accountUpdateRequest.d.ts b/sdks/node/types/model/accountUpdateRequest.d.ts deleted file mode 100644 index a5913aaf7..000000000 --- a/sdks/node/types/model/accountUpdateRequest.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class AccountUpdateRequest { - "accountId"?: string | null; - "callbackUrl"?: string; - "locale"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): AccountUpdateRequest; -} diff --git a/sdks/node/types/model/accountVerifyRequest.d.ts b/sdks/node/types/model/accountVerifyRequest.d.ts deleted file mode 100644 index 7f06194f8..000000000 --- a/sdks/node/types/model/accountVerifyRequest.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class AccountVerifyRequest { - "emailAddress": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): AccountVerifyRequest; -} diff --git a/sdks/node/types/model/accountVerifyResponse.d.ts b/sdks/node/types/model/accountVerifyResponse.d.ts deleted file mode 100644 index ff3122780..000000000 --- a/sdks/node/types/model/accountVerifyResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { AccountVerifyResponseAccount } from "./accountVerifyResponseAccount"; -import { WarningResponse } from "./warningResponse"; -export declare class AccountVerifyResponse { - "account"?: AccountVerifyResponseAccount; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): AccountVerifyResponse; -} diff --git a/sdks/node/types/model/accountVerifyResponseAccount.d.ts b/sdks/node/types/model/accountVerifyResponseAccount.d.ts deleted file mode 100644 index 9e62ae9e6..000000000 --- a/sdks/node/types/model/accountVerifyResponseAccount.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class AccountVerifyResponseAccount { - "emailAddress"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): AccountVerifyResponseAccount; -} diff --git a/sdks/node/types/model/apiAppCreateRequest.d.ts b/sdks/node/types/model/apiAppCreateRequest.d.ts deleted file mode 100644 index 03553d98e..000000000 --- a/sdks/node/types/model/apiAppCreateRequest.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubOAuth } from "./subOAuth"; -import { SubOptions } from "./subOptions"; -import { SubWhiteLabelingOptions } from "./subWhiteLabelingOptions"; -export declare class ApiAppCreateRequest { - "domains": Array; - "name": string; - "callbackUrl"?: string; - "customLogoFile"?: RequestFile; - "oauth"?: SubOAuth; - "options"?: SubOptions; - "whiteLabelingOptions"?: SubWhiteLabelingOptions; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ApiAppCreateRequest; -} diff --git a/sdks/node/types/model/apiAppGetResponse.d.ts b/sdks/node/types/model/apiAppGetResponse.d.ts deleted file mode 100644 index 9d7c45639..000000000 --- a/sdks/node/types/model/apiAppGetResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { ApiAppResponse } from "./apiAppResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class ApiAppGetResponse { - "apiApp": ApiAppResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ApiAppGetResponse; -} diff --git a/sdks/node/types/model/apiAppListResponse.d.ts b/sdks/node/types/model/apiAppListResponse.d.ts deleted file mode 100644 index 214dac34b..000000000 --- a/sdks/node/types/model/apiAppListResponse.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { ApiAppResponse } from "./apiAppResponse"; -import { ListInfoResponse } from "./listInfoResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class ApiAppListResponse { - "apiApps": Array; - "listInfo": ListInfoResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ApiAppListResponse; -} diff --git a/sdks/node/types/model/apiAppResponse.d.ts b/sdks/node/types/model/apiAppResponse.d.ts deleted file mode 100644 index f0646b2c4..000000000 --- a/sdks/node/types/model/apiAppResponse.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { ApiAppResponseOAuth } from "./apiAppResponseOAuth"; -import { ApiAppResponseOptions } from "./apiAppResponseOptions"; -import { ApiAppResponseOwnerAccount } from "./apiAppResponseOwnerAccount"; -import { ApiAppResponseWhiteLabelingOptions } from "./apiAppResponseWhiteLabelingOptions"; -export declare class ApiAppResponse { - "callbackUrl"?: string | null; - "clientId"?: string; - "createdAt"?: number; - "domains"?: Array; - "name"?: string; - "isApproved"?: boolean; - "oauth"?: ApiAppResponseOAuth | null; - "options"?: ApiAppResponseOptions | null; - "ownerAccount"?: ApiAppResponseOwnerAccount; - "whiteLabelingOptions"?: ApiAppResponseWhiteLabelingOptions | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ApiAppResponse; -} diff --git a/sdks/node/types/model/apiAppResponseOAuth.d.ts b/sdks/node/types/model/apiAppResponseOAuth.d.ts deleted file mode 100644 index cd298f6fb..000000000 --- a/sdks/node/types/model/apiAppResponseOAuth.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class ApiAppResponseOAuth { - "callbackUrl"?: string; - "secret"?: string | null; - "scopes"?: Array; - "chargesUsers"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ApiAppResponseOAuth; -} diff --git a/sdks/node/types/model/apiAppResponseOptions.d.ts b/sdks/node/types/model/apiAppResponseOptions.d.ts deleted file mode 100644 index 2b869e068..000000000 --- a/sdks/node/types/model/apiAppResponseOptions.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class ApiAppResponseOptions { - "canInsertEverywhere"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ApiAppResponseOptions; -} diff --git a/sdks/node/types/model/apiAppResponseOwnerAccount.d.ts b/sdks/node/types/model/apiAppResponseOwnerAccount.d.ts deleted file mode 100644 index a1e4d7c5f..000000000 --- a/sdks/node/types/model/apiAppResponseOwnerAccount.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class ApiAppResponseOwnerAccount { - "accountId"?: string; - "emailAddress"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ApiAppResponseOwnerAccount; -} diff --git a/sdks/node/types/model/apiAppResponseWhiteLabelingOptions.d.ts b/sdks/node/types/model/apiAppResponseWhiteLabelingOptions.d.ts deleted file mode 100644 index 67ce3d5e8..000000000 --- a/sdks/node/types/model/apiAppResponseWhiteLabelingOptions.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class ApiAppResponseWhiteLabelingOptions { - "headerBackgroundColor"?: string; - "legalVersion"?: string; - "linkColor"?: string; - "pageBackgroundColor"?: string; - "primaryButtonColor"?: string; - "primaryButtonColorHover"?: string; - "primaryButtonTextColor"?: string; - "primaryButtonTextColorHover"?: string; - "secondaryButtonColor"?: string; - "secondaryButtonColorHover"?: string; - "secondaryButtonTextColor"?: string; - "secondaryButtonTextColorHover"?: string; - "textColor1"?: string; - "textColor2"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ApiAppResponseWhiteLabelingOptions; -} diff --git a/sdks/node/types/model/apiAppUpdateRequest.d.ts b/sdks/node/types/model/apiAppUpdateRequest.d.ts deleted file mode 100644 index 9debf019a..000000000 --- a/sdks/node/types/model/apiAppUpdateRequest.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubOAuth } from "./subOAuth"; -import { SubOptions } from "./subOptions"; -import { SubWhiteLabelingOptions } from "./subWhiteLabelingOptions"; -export declare class ApiAppUpdateRequest { - "callbackUrl"?: string; - "customLogoFile"?: RequestFile; - "domains"?: Array; - "name"?: string; - "oauth"?: SubOAuth; - "options"?: SubOptions; - "whiteLabelingOptions"?: SubWhiteLabelingOptions; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ApiAppUpdateRequest; -} diff --git a/sdks/node/types/model/bulkSendJobGetResponse.d.ts b/sdks/node/types/model/bulkSendJobGetResponse.d.ts deleted file mode 100644 index b4d39ed9d..000000000 --- a/sdks/node/types/model/bulkSendJobGetResponse.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { BulkSendJobGetResponseSignatureRequests } from "./bulkSendJobGetResponseSignatureRequests"; -import { BulkSendJobResponse } from "./bulkSendJobResponse"; -import { ListInfoResponse } from "./listInfoResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class BulkSendJobGetResponse { - "bulkSendJob": BulkSendJobResponse; - "listInfo": ListInfoResponse; - "signatureRequests": Array; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): BulkSendJobGetResponse; -} diff --git a/sdks/node/types/model/bulkSendJobGetResponseSignatureRequests.d.ts b/sdks/node/types/model/bulkSendJobGetResponseSignatureRequests.d.ts deleted file mode 100644 index 8f20a3fec..000000000 --- a/sdks/node/types/model/bulkSendJobGetResponseSignatureRequests.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseAttachment } from "./signatureRequestResponseAttachment"; -import { SignatureRequestResponseCustomFieldBase } from "./signatureRequestResponseCustomFieldBase"; -import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; -import { SignatureRequestResponseSignatures } from "./signatureRequestResponseSignatures"; -export declare class BulkSendJobGetResponseSignatureRequests { - "testMode"?: boolean; - "signatureRequestId"?: string; - "requesterEmailAddress"?: string | null; - "title"?: string; - "originalTitle"?: string; - "subject"?: string | null; - "message"?: string | null; - "metadata"?: { - [key: string]: any; - }; - "createdAt"?: number; - "expiresAt"?: number | null; - "isComplete"?: boolean; - "isDeclined"?: boolean; - "hasError"?: boolean; - "filesUrl"?: string; - "signingUrl"?: string | null; - "detailsUrl"?: string; - "ccEmailAddresses"?: Array; - "signingRedirectUrl"?: string | null; - "finalCopyUri"?: string | null; - "templateIds"?: Array | null; - "customFields"?: Array | null; - "attachments"?: Array | null; - "responseData"?: Array | null; - "signatures"?: Array; - "bulkSendJobId"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): BulkSendJobGetResponseSignatureRequests; -} diff --git a/sdks/node/types/model/bulkSendJobListResponse.d.ts b/sdks/node/types/model/bulkSendJobListResponse.d.ts deleted file mode 100644 index 11b6be2e5..000000000 --- a/sdks/node/types/model/bulkSendJobListResponse.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { BulkSendJobResponse } from "./bulkSendJobResponse"; -import { ListInfoResponse } from "./listInfoResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class BulkSendJobListResponse { - "bulkSendJobs": Array; - "listInfo": ListInfoResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): BulkSendJobListResponse; -} diff --git a/sdks/node/types/model/bulkSendJobResponse.d.ts b/sdks/node/types/model/bulkSendJobResponse.d.ts deleted file mode 100644 index 11fa231bb..000000000 --- a/sdks/node/types/model/bulkSendJobResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class BulkSendJobResponse { - "bulkSendJobId"?: string | null; - "total"?: number; - "isCreator"?: boolean; - "createdAt"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): BulkSendJobResponse; -} diff --git a/sdks/node/types/model/bulkSendJobSendResponse.d.ts b/sdks/node/types/model/bulkSendJobSendResponse.d.ts deleted file mode 100644 index 7a82bf1e5..000000000 --- a/sdks/node/types/model/bulkSendJobSendResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { BulkSendJobResponse } from "./bulkSendJobResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class BulkSendJobSendResponse { - "bulkSendJob": BulkSendJobResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): BulkSendJobSendResponse; -} diff --git a/sdks/node/types/model/embeddedEditUrlRequest.d.ts b/sdks/node/types/model/embeddedEditUrlRequest.d.ts deleted file mode 100644 index 5a4614a93..000000000 --- a/sdks/node/types/model/embeddedEditUrlRequest.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubEditorOptions } from "./subEditorOptions"; -import { SubMergeField } from "./subMergeField"; -export declare class EmbeddedEditUrlRequest { - "allowEditCcs"?: boolean; - "allowFormView"?: boolean; - "ccRoles"?: Array; - "editorOptions"?: SubEditorOptions; - "forceSignerRoles"?: boolean; - "forceSubjectMessage"?: boolean; - "mergeFields"?: Array; - "previewOnly"?: boolean; - "showPreview"?: boolean; - "showProgressStepper"?: boolean; - "testMode"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): EmbeddedEditUrlRequest; -} diff --git a/sdks/node/types/model/embeddedEditUrlResponse.d.ts b/sdks/node/types/model/embeddedEditUrlResponse.d.ts deleted file mode 100644 index bb01ab223..000000000 --- a/sdks/node/types/model/embeddedEditUrlResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { EmbeddedEditUrlResponseEmbedded } from "./embeddedEditUrlResponseEmbedded"; -import { WarningResponse } from "./warningResponse"; -export declare class EmbeddedEditUrlResponse { - "embedded": EmbeddedEditUrlResponseEmbedded; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): EmbeddedEditUrlResponse; -} diff --git a/sdks/node/types/model/embeddedEditUrlResponseEmbedded.d.ts b/sdks/node/types/model/embeddedEditUrlResponseEmbedded.d.ts deleted file mode 100644 index ff50f4ddc..000000000 --- a/sdks/node/types/model/embeddedEditUrlResponseEmbedded.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class EmbeddedEditUrlResponseEmbedded { - "editUrl"?: string; - "expiresAt"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): EmbeddedEditUrlResponseEmbedded; -} diff --git a/sdks/node/types/model/embeddedSignUrlResponse.d.ts b/sdks/node/types/model/embeddedSignUrlResponse.d.ts deleted file mode 100644 index 8a739647e..000000000 --- a/sdks/node/types/model/embeddedSignUrlResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { EmbeddedSignUrlResponseEmbedded } from "./embeddedSignUrlResponseEmbedded"; -import { WarningResponse } from "./warningResponse"; -export declare class EmbeddedSignUrlResponse { - "embedded": EmbeddedSignUrlResponseEmbedded; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): EmbeddedSignUrlResponse; -} diff --git a/sdks/node/types/model/embeddedSignUrlResponseEmbedded.d.ts b/sdks/node/types/model/embeddedSignUrlResponseEmbedded.d.ts deleted file mode 100644 index 3ac81d78f..000000000 --- a/sdks/node/types/model/embeddedSignUrlResponseEmbedded.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class EmbeddedSignUrlResponseEmbedded { - "signUrl"?: string; - "expiresAt"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): EmbeddedSignUrlResponseEmbedded; -} diff --git a/sdks/node/types/model/errorResponse.d.ts b/sdks/node/types/model/errorResponse.d.ts deleted file mode 100644 index 658268ddd..000000000 --- a/sdks/node/types/model/errorResponse.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { ErrorResponseError } from "./errorResponseError"; -export declare class ErrorResponse { - "error": ErrorResponseError; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ErrorResponse; -} diff --git a/sdks/node/types/model/errorResponseError.d.ts b/sdks/node/types/model/errorResponseError.d.ts deleted file mode 100644 index 084f883b1..000000000 --- a/sdks/node/types/model/errorResponseError.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class ErrorResponseError { - "errorMsg": string; - "errorName": string; - "errorPath"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ErrorResponseError; -} diff --git a/sdks/node/types/model/eventCallbackHelper.d.ts b/sdks/node/types/model/eventCallbackHelper.d.ts deleted file mode 100644 index 4ca20c480..000000000 --- a/sdks/node/types/model/eventCallbackHelper.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { EventCallbackRequest } from "./"; -export declare class EventCallbackHelper { - static readonly EVENT_TYPE_ACCOUNT_CALLBACK = "account_callback"; - static readonly EVENT_TYPE_APP_CALLBACK = "app_callback"; - static isValid: (apiKey: string, eventCallback: EventCallbackRequest) => boolean; - static getCallbackType: (eventCallback: EventCallbackRequest) => string; -} diff --git a/sdks/node/types/model/eventCallbackRequest.d.ts b/sdks/node/types/model/eventCallbackRequest.d.ts deleted file mode 100644 index d71e81a2e..000000000 --- a/sdks/node/types/model/eventCallbackRequest.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { AccountResponse } from "./accountResponse"; -import { EventCallbackRequestEvent } from "./eventCallbackRequestEvent"; -import { SignatureRequestResponse } from "./signatureRequestResponse"; -import { TemplateResponse } from "./templateResponse"; -export declare class EventCallbackRequest { - "event": EventCallbackRequestEvent; - "account"?: AccountResponse; - "signatureRequest"?: SignatureRequestResponse; - "template"?: TemplateResponse; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): EventCallbackRequest; -} diff --git a/sdks/node/types/model/eventCallbackRequestEvent.d.ts b/sdks/node/types/model/eventCallbackRequestEvent.d.ts deleted file mode 100644 index ffacc7aea..000000000 --- a/sdks/node/types/model/eventCallbackRequestEvent.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { EventCallbackRequestEventMetadata } from "./eventCallbackRequestEventMetadata"; -export declare class EventCallbackRequestEvent { - "eventTime": string; - "eventType": EventCallbackRequestEvent.EventTypeEnum; - "eventHash": string; - "eventMetadata"?: EventCallbackRequestEventMetadata; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): EventCallbackRequestEvent; -} -export declare namespace EventCallbackRequestEvent { - enum EventTypeEnum { - AccountConfirmed = "account_confirmed", - UnknownError = "unknown_error", - FileError = "file_error", - SignUrlInvalid = "sign_url_invalid", - SignatureRequestViewed = "signature_request_viewed", - SignatureRequestSigned = "signature_request_signed", - SignatureRequestSent = "signature_request_sent", - SignatureRequestAllSigned = "signature_request_all_signed", - SignatureRequestEmailBounce = "signature_request_email_bounce", - SignatureRequestRemind = "signature_request_remind", - SignatureRequestIncompleteQes = "signature_request_incomplete_qes", - SignatureRequestDestroyed = "signature_request_destroyed", - SignatureRequestCanceled = "signature_request_canceled", - SignatureRequestDownloadable = "signature_request_downloadable", - SignatureRequestDeclined = "signature_request_declined", - SignatureRequestReassigned = "signature_request_reassigned", - SignatureRequestInvalid = "signature_request_invalid", - SignatureRequestPrepared = "signature_request_prepared", - SignatureRequestExpired = "signature_request_expired", - TemplateCreated = "template_created", - TemplateError = "template_error", - CallbackTest = "callback_test", - SignatureRequestSignerRemoved = "signature_request_signer_removed" - } -} diff --git a/sdks/node/types/model/eventCallbackRequestEventMetadata.d.ts b/sdks/node/types/model/eventCallbackRequestEventMetadata.d.ts deleted file mode 100644 index 82f6b724e..000000000 --- a/sdks/node/types/model/eventCallbackRequestEventMetadata.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class EventCallbackRequestEventMetadata { - "relatedSignatureId"?: string | null; - "reportedForAccountId"?: string | null; - "reportedForAppId"?: string | null; - "eventMessage"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): EventCallbackRequestEventMetadata; -} diff --git a/sdks/node/types/model/faxGetResponse.d.ts b/sdks/node/types/model/faxGetResponse.d.ts deleted file mode 100644 index 05b6196dd..000000000 --- a/sdks/node/types/model/faxGetResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { FaxResponse } from "./faxResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class FaxGetResponse { - "fax": FaxResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxGetResponse; -} diff --git a/sdks/node/types/model/faxLineAddUserRequest.d.ts b/sdks/node/types/model/faxLineAddUserRequest.d.ts deleted file mode 100644 index 56fefd2f3..000000000 --- a/sdks/node/types/model/faxLineAddUserRequest.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class FaxLineAddUserRequest { - "number": string; - "accountId"?: string; - "emailAddress"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxLineAddUserRequest; -} diff --git a/sdks/node/types/model/faxLineAreaCodeGetCountryEnum.d.ts b/sdks/node/types/model/faxLineAreaCodeGetCountryEnum.d.ts deleted file mode 100644 index 8352fd878..000000000 --- a/sdks/node/types/model/faxLineAreaCodeGetCountryEnum.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare enum FaxLineAreaCodeGetCountryEnum { - Ca = "CA", - Us = "US", - Uk = "UK" -} diff --git a/sdks/node/types/model/faxLineAreaCodeGetProvinceEnum.d.ts b/sdks/node/types/model/faxLineAreaCodeGetProvinceEnum.d.ts deleted file mode 100644 index e43edf5df..000000000 --- a/sdks/node/types/model/faxLineAreaCodeGetProvinceEnum.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export declare enum FaxLineAreaCodeGetProvinceEnum { - Ab = "AB", - Bc = "BC", - Mb = "MB", - Nb = "NB", - Nl = "NL", - Nt = "NT", - Ns = "NS", - Nu = "NU", - On = "ON", - Pe = "PE", - Qc = "QC", - Sk = "SK", - Yt = "YT" -} diff --git a/sdks/node/types/model/faxLineAreaCodeGetResponse.d.ts b/sdks/node/types/model/faxLineAreaCodeGetResponse.d.ts deleted file mode 100644 index 5a55319d2..000000000 --- a/sdks/node/types/model/faxLineAreaCodeGetResponse.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class FaxLineAreaCodeGetResponse { - "areaCodes": Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxLineAreaCodeGetResponse; -} diff --git a/sdks/node/types/model/faxLineAreaCodeGetStateEnum.d.ts b/sdks/node/types/model/faxLineAreaCodeGetStateEnum.d.ts deleted file mode 100644 index 4193d07bd..000000000 --- a/sdks/node/types/model/faxLineAreaCodeGetStateEnum.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -export declare enum FaxLineAreaCodeGetStateEnum { - Ak = "AK", - Al = "AL", - Ar = "AR", - Az = "AZ", - Ca = "CA", - Co = "CO", - Ct = "CT", - Dc = "DC", - De = "DE", - Fl = "FL", - Ga = "GA", - Hi = "HI", - Ia = "IA", - Id = "ID", - Il = "IL", - In = "IN", - Ks = "KS", - Ky = "KY", - La = "LA", - Ma = "MA", - Md = "MD", - Me = "ME", - Mi = "MI", - Mn = "MN", - Mo = "MO", - Ms = "MS", - Mt = "MT", - Nc = "NC", - Nd = "ND", - Ne = "NE", - Nh = "NH", - Nj = "NJ", - Nm = "NM", - Nv = "NV", - Ny = "NY", - Oh = "OH", - Ok = "OK", - Or = "OR", - Pa = "PA", - Ri = "RI", - Sc = "SC", - Sd = "SD", - Tn = "TN", - Tx = "TX", - Ut = "UT", - Va = "VA", - Vt = "VT", - Wa = "WA", - Wi = "WI", - Wv = "WV", - Wy = "WY" -} diff --git a/sdks/node/types/model/faxLineCreateRequest.d.ts b/sdks/node/types/model/faxLineCreateRequest.d.ts deleted file mode 100644 index a91bcda4d..000000000 --- a/sdks/node/types/model/faxLineCreateRequest.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class FaxLineCreateRequest { - "areaCode": number; - "country": FaxLineCreateRequest.CountryEnum; - "city"?: string; - "accountId"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxLineCreateRequest; -} -export declare namespace FaxLineCreateRequest { - enum CountryEnum { - Ca = "CA", - Us = "US", - Uk = "UK" - } -} diff --git a/sdks/node/types/model/faxLineDeleteRequest.d.ts b/sdks/node/types/model/faxLineDeleteRequest.d.ts deleted file mode 100644 index 3dd720983..000000000 --- a/sdks/node/types/model/faxLineDeleteRequest.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class FaxLineDeleteRequest { - "number": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxLineDeleteRequest; -} diff --git a/sdks/node/types/model/faxLineListResponse.d.ts b/sdks/node/types/model/faxLineListResponse.d.ts deleted file mode 100644 index b426f1eab..000000000 --- a/sdks/node/types/model/faxLineListResponse.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { FaxLineResponseFaxLine } from "./faxLineResponseFaxLine"; -import { ListInfoResponse } from "./listInfoResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class FaxLineListResponse { - "listInfo": ListInfoResponse; - "faxLines": Array; - "warnings"?: WarningResponse; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxLineListResponse; -} diff --git a/sdks/node/types/model/faxLineRemoveUserRequest.d.ts b/sdks/node/types/model/faxLineRemoveUserRequest.d.ts deleted file mode 100644 index a57a09421..000000000 --- a/sdks/node/types/model/faxLineRemoveUserRequest.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class FaxLineRemoveUserRequest { - "number": string; - "accountId"?: string; - "emailAddress"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxLineRemoveUserRequest; -} diff --git a/sdks/node/types/model/faxLineResponse.d.ts b/sdks/node/types/model/faxLineResponse.d.ts deleted file mode 100644 index 41d8248b1..000000000 --- a/sdks/node/types/model/faxLineResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { FaxLineResponseFaxLine } from "./faxLineResponseFaxLine"; -import { WarningResponse } from "./warningResponse"; -export declare class FaxLineResponse { - "faxLine": FaxLineResponseFaxLine; - "warnings"?: WarningResponse; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxLineResponse; -} diff --git a/sdks/node/types/model/faxLineResponseFaxLine.d.ts b/sdks/node/types/model/faxLineResponseFaxLine.d.ts deleted file mode 100644 index d5f8c4aa7..000000000 --- a/sdks/node/types/model/faxLineResponseFaxLine.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { AccountResponse } from "./accountResponse"; -export declare class FaxLineResponseFaxLine { - "number"?: string; - "createdAt"?: number; - "updatedAt"?: number; - "accounts"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxLineResponseFaxLine; -} diff --git a/sdks/node/types/model/faxListResponse.d.ts b/sdks/node/types/model/faxListResponse.d.ts deleted file mode 100644 index e36e8a061..000000000 --- a/sdks/node/types/model/faxListResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { FaxResponse } from "./faxResponse"; -import { ListInfoResponse } from "./listInfoResponse"; -export declare class FaxListResponse { - "faxes": Array; - "listInfo": ListInfoResponse; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxListResponse; -} diff --git a/sdks/node/types/model/faxResponse.d.ts b/sdks/node/types/model/faxResponse.d.ts deleted file mode 100644 index 89c96f004..000000000 --- a/sdks/node/types/model/faxResponse.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { FaxResponseTransmission } from "./faxResponseTransmission"; -export declare class FaxResponse { - "faxId": string; - "title": string; - "originalTitle": string; - "metadata": { - [key: string]: any; - }; - "createdAt": number; - "sender": string; - "filesUrl": string; - "transmissions": Array; - "subject"?: string | null; - "message"?: string | null; - "finalCopyUri"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxResponse; -} diff --git a/sdks/node/types/model/faxResponseTransmission.d.ts b/sdks/node/types/model/faxResponseTransmission.d.ts deleted file mode 100644 index 250f341e6..000000000 --- a/sdks/node/types/model/faxResponseTransmission.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class FaxResponseTransmission { - "recipient": string; - "statusCode": FaxResponseTransmission.StatusCodeEnum; - "sentAt"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxResponseTransmission; -} -export declare namespace FaxResponseTransmission { - enum StatusCodeEnum { - Success = "success", - Transmitting = "transmitting", - ErrorCouldNotFax = "error_could_not_fax", - ErrorUnknown = "error_unknown", - ErrorBusy = "error_busy", - ErrorNoAnswer = "error_no_answer", - ErrorDisconnected = "error_disconnected", - ErrorBadDestination = "error_bad_destination" - } -} diff --git a/sdks/node/types/model/faxSendRequest.d.ts b/sdks/node/types/model/faxSendRequest.d.ts deleted file mode 100644 index 95454724e..000000000 --- a/sdks/node/types/model/faxSendRequest.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -export declare class FaxSendRequest { - "recipient": string; - "sender"?: string; - "files"?: Array; - "fileUrls"?: Array; - "testMode"?: boolean; - "coverPageTo"?: string; - "coverPageFrom"?: string; - "coverPageMessage"?: string; - "title"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FaxSendRequest; -} diff --git a/sdks/node/types/model/fileResponse.d.ts b/sdks/node/types/model/fileResponse.d.ts deleted file mode 100644 index aaeac2159..000000000 --- a/sdks/node/types/model/fileResponse.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class FileResponse { - "fileUrl": string; - "expiresAt": number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FileResponse; -} diff --git a/sdks/node/types/model/fileResponseDataUri.d.ts b/sdks/node/types/model/fileResponseDataUri.d.ts deleted file mode 100644 index 9b04c5631..000000000 --- a/sdks/node/types/model/fileResponseDataUri.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class FileResponseDataUri { - "dataUri": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): FileResponseDataUri; -} diff --git a/sdks/node/types/model/index.d.ts b/sdks/node/types/model/index.d.ts deleted file mode 100644 index 99010c62f..000000000 --- a/sdks/node/types/model/index.d.ts +++ /dev/null @@ -1,201 +0,0 @@ -import { AccountCreateRequest } from "./accountCreateRequest"; -import { AccountCreateResponse } from "./accountCreateResponse"; -import { AccountGetResponse } from "./accountGetResponse"; -import { AccountResponse } from "./accountResponse"; -import { AccountResponseQuotas } from "./accountResponseQuotas"; -import { AccountResponseUsage } from "./accountResponseUsage"; -import { AccountUpdateRequest } from "./accountUpdateRequest"; -import { AccountVerifyRequest } from "./accountVerifyRequest"; -import { AccountVerifyResponse } from "./accountVerifyResponse"; -import { AccountVerifyResponseAccount } from "./accountVerifyResponseAccount"; -import { ApiAppCreateRequest } from "./apiAppCreateRequest"; -import { ApiAppGetResponse } from "./apiAppGetResponse"; -import { ApiAppListResponse } from "./apiAppListResponse"; -import { ApiAppResponse } from "./apiAppResponse"; -import { ApiAppResponseOAuth } from "./apiAppResponseOAuth"; -import { ApiAppResponseOptions } from "./apiAppResponseOptions"; -import { ApiAppResponseOwnerAccount } from "./apiAppResponseOwnerAccount"; -import { ApiAppResponseWhiteLabelingOptions } from "./apiAppResponseWhiteLabelingOptions"; -import { ApiAppUpdateRequest } from "./apiAppUpdateRequest"; -import { BulkSendJobGetResponse } from "./bulkSendJobGetResponse"; -import { BulkSendJobGetResponseSignatureRequests } from "./bulkSendJobGetResponseSignatureRequests"; -import { BulkSendJobListResponse } from "./bulkSendJobListResponse"; -import { BulkSendJobResponse } from "./bulkSendJobResponse"; -import { BulkSendJobSendResponse } from "./bulkSendJobSendResponse"; -import { EmbeddedEditUrlRequest } from "./embeddedEditUrlRequest"; -import { EmbeddedEditUrlResponse } from "./embeddedEditUrlResponse"; -import { EmbeddedEditUrlResponseEmbedded } from "./embeddedEditUrlResponseEmbedded"; -import { EmbeddedSignUrlResponse } from "./embeddedSignUrlResponse"; -import { EmbeddedSignUrlResponseEmbedded } from "./embeddedSignUrlResponseEmbedded"; -import { ErrorResponse } from "./errorResponse"; -import { ErrorResponseError } from "./errorResponseError"; -import { EventCallbackHelper } from "./eventCallbackHelper"; -import { EventCallbackRequest } from "./eventCallbackRequest"; -import { EventCallbackRequestEvent } from "./eventCallbackRequestEvent"; -import { EventCallbackRequestEventMetadata } from "./eventCallbackRequestEventMetadata"; -import { FaxGetResponse } from "./faxGetResponse"; -import { FaxLineAddUserRequest } from "./faxLineAddUserRequest"; -import { FaxLineAreaCodeGetCountryEnum } from "./faxLineAreaCodeGetCountryEnum"; -import { FaxLineAreaCodeGetProvinceEnum } from "./faxLineAreaCodeGetProvinceEnum"; -import { FaxLineAreaCodeGetResponse } from "./faxLineAreaCodeGetResponse"; -import { FaxLineAreaCodeGetStateEnum } from "./faxLineAreaCodeGetStateEnum"; -import { FaxLineCreateRequest } from "./faxLineCreateRequest"; -import { FaxLineDeleteRequest } from "./faxLineDeleteRequest"; -import { FaxLineListResponse } from "./faxLineListResponse"; -import { FaxLineRemoveUserRequest } from "./faxLineRemoveUserRequest"; -import { FaxLineResponse } from "./faxLineResponse"; -import { FaxLineResponseFaxLine } from "./faxLineResponseFaxLine"; -import { FaxListResponse } from "./faxListResponse"; -import { FaxResponse } from "./faxResponse"; -import { FaxResponseTransmission } from "./faxResponseTransmission"; -import { FaxSendRequest } from "./faxSendRequest"; -import { FileResponse } from "./fileResponse"; -import { FileResponseDataUri } from "./fileResponseDataUri"; -import { ListInfoResponse } from "./listInfoResponse"; -import { ApiKeyAuth, AttributeTypeMap, Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, OAuth, ObjectSerializer, RequestDetailedFile, RequestFile, VoidAuth } from "./models"; -import { OAuthTokenGenerateRequest } from "./oAuthTokenGenerateRequest"; -import { OAuthTokenRefreshRequest } from "./oAuthTokenRefreshRequest"; -import { OAuthTokenResponse } from "./oAuthTokenResponse"; -import { ReportCreateRequest } from "./reportCreateRequest"; -import { ReportCreateResponse } from "./reportCreateResponse"; -import { ReportResponse } from "./reportResponse"; -import { SignatureRequestBulkCreateEmbeddedWithTemplateRequest } from "./signatureRequestBulkCreateEmbeddedWithTemplateRequest"; -import { SignatureRequestBulkSendWithTemplateRequest } from "./signatureRequestBulkSendWithTemplateRequest"; -import { SignatureRequestCreateEmbeddedRequest } from "./signatureRequestCreateEmbeddedRequest"; -import { SignatureRequestCreateEmbeddedWithTemplateRequest } from "./signatureRequestCreateEmbeddedWithTemplateRequest"; -import { SignatureRequestEditEmbeddedRequest } from "./signatureRequestEditEmbeddedRequest"; -import { SignatureRequestEditEmbeddedWithTemplateRequest } from "./signatureRequestEditEmbeddedWithTemplateRequest"; -import { SignatureRequestEditRequest } from "./signatureRequestEditRequest"; -import { SignatureRequestEditWithTemplateRequest } from "./signatureRequestEditWithTemplateRequest"; -import { SignatureRequestGetResponse } from "./signatureRequestGetResponse"; -import { SignatureRequestListResponse } from "./signatureRequestListResponse"; -import { SignatureRequestRemindRequest } from "./signatureRequestRemindRequest"; -import { SignatureRequestResponse } from "./signatureRequestResponse"; -import { SignatureRequestResponseAttachment } from "./signatureRequestResponseAttachment"; -import { SignatureRequestResponseCustomFieldBase } from "./signatureRequestResponseCustomFieldBase"; -import { SignatureRequestResponseCustomFieldCheckbox } from "./signatureRequestResponseCustomFieldCheckbox"; -import { SignatureRequestResponseCustomFieldText } from "./signatureRequestResponseCustomFieldText"; -import { SignatureRequestResponseCustomFieldTypeEnum } from "./signatureRequestResponseCustomFieldTypeEnum"; -import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; -import { SignatureRequestResponseDataTypeEnum } from "./signatureRequestResponseDataTypeEnum"; -import { SignatureRequestResponseDataValueCheckbox } from "./signatureRequestResponseDataValueCheckbox"; -import { SignatureRequestResponseDataValueCheckboxMerge } from "./signatureRequestResponseDataValueCheckboxMerge"; -import { SignatureRequestResponseDataValueDateSigned } from "./signatureRequestResponseDataValueDateSigned"; -import { SignatureRequestResponseDataValueDropdown } from "./signatureRequestResponseDataValueDropdown"; -import { SignatureRequestResponseDataValueInitials } from "./signatureRequestResponseDataValueInitials"; -import { SignatureRequestResponseDataValueRadio } from "./signatureRequestResponseDataValueRadio"; -import { SignatureRequestResponseDataValueSignature } from "./signatureRequestResponseDataValueSignature"; -import { SignatureRequestResponseDataValueText } from "./signatureRequestResponseDataValueText"; -import { SignatureRequestResponseDataValueTextMerge } from "./signatureRequestResponseDataValueTextMerge"; -import { SignatureRequestResponseSignatures } from "./signatureRequestResponseSignatures"; -import { SignatureRequestSendRequest } from "./signatureRequestSendRequest"; -import { SignatureRequestSendWithTemplateRequest } from "./signatureRequestSendWithTemplateRequest"; -import { SignatureRequestUpdateRequest } from "./signatureRequestUpdateRequest"; -import { SubAttachment } from "./subAttachment"; -import { SubBulkSignerList } from "./subBulkSignerList"; -import { SubBulkSignerListCustomField } from "./subBulkSignerListCustomField"; -import { SubCC } from "./subCC"; -import { SubCustomField } from "./subCustomField"; -import { SubEditorOptions } from "./subEditorOptions"; -import { SubFieldOptions } from "./subFieldOptions"; -import { SubFormFieldGroup } from "./subFormFieldGroup"; -import { SubFormFieldRule } from "./subFormFieldRule"; -import { SubFormFieldRuleAction } from "./subFormFieldRuleAction"; -import { SubFormFieldRuleTrigger } from "./subFormFieldRuleTrigger"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -import { SubFormFieldsPerDocumentCheckbox } from "./subFormFieldsPerDocumentCheckbox"; -import { SubFormFieldsPerDocumentCheckboxMerge } from "./subFormFieldsPerDocumentCheckboxMerge"; -import { SubFormFieldsPerDocumentDateSigned } from "./subFormFieldsPerDocumentDateSigned"; -import { SubFormFieldsPerDocumentDropdown } from "./subFormFieldsPerDocumentDropdown"; -import { SubFormFieldsPerDocumentFontEnum } from "./subFormFieldsPerDocumentFontEnum"; -import { SubFormFieldsPerDocumentHyperlink } from "./subFormFieldsPerDocumentHyperlink"; -import { SubFormFieldsPerDocumentInitials } from "./subFormFieldsPerDocumentInitials"; -import { SubFormFieldsPerDocumentRadio } from "./subFormFieldsPerDocumentRadio"; -import { SubFormFieldsPerDocumentSignature } from "./subFormFieldsPerDocumentSignature"; -import { SubFormFieldsPerDocumentText } from "./subFormFieldsPerDocumentText"; -import { SubFormFieldsPerDocumentTextMerge } from "./subFormFieldsPerDocumentTextMerge"; -import { SubFormFieldsPerDocumentTypeEnum } from "./subFormFieldsPerDocumentTypeEnum"; -import { SubMergeField } from "./subMergeField"; -import { SubOAuth } from "./subOAuth"; -import { SubOptions } from "./subOptions"; -import { SubSignatureRequestGroupedSigners } from "./subSignatureRequestGroupedSigners"; -import { SubSignatureRequestSigner } from "./subSignatureRequestSigner"; -import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; -import { SubSigningOptions } from "./subSigningOptions"; -import { SubTeamResponse } from "./subTeamResponse"; -import { SubTemplateRole } from "./subTemplateRole"; -import { SubUnclaimedDraftSigner } from "./subUnclaimedDraftSigner"; -import { SubUnclaimedDraftTemplateSigner } from "./subUnclaimedDraftTemplateSigner"; -import { SubWhiteLabelingOptions } from "./subWhiteLabelingOptions"; -import { TeamAddMemberRequest } from "./teamAddMemberRequest"; -import { TeamCreateRequest } from "./teamCreateRequest"; -import { TeamGetInfoResponse } from "./teamGetInfoResponse"; -import { TeamGetResponse } from "./teamGetResponse"; -import { TeamInfoResponse } from "./teamInfoResponse"; -import { TeamInviteResponse } from "./teamInviteResponse"; -import { TeamInvitesResponse } from "./teamInvitesResponse"; -import { TeamMemberResponse } from "./teamMemberResponse"; -import { TeamMembersResponse } from "./teamMembersResponse"; -import { TeamParentResponse } from "./teamParentResponse"; -import { TeamRemoveMemberRequest } from "./teamRemoveMemberRequest"; -import { TeamResponse } from "./teamResponse"; -import { TeamSubTeamsResponse } from "./teamSubTeamsResponse"; -import { TeamUpdateRequest } from "./teamUpdateRequest"; -import { TemplateAddUserRequest } from "./templateAddUserRequest"; -import { TemplateCreateEmbeddedDraftRequest } from "./templateCreateEmbeddedDraftRequest"; -import { TemplateCreateEmbeddedDraftResponse } from "./templateCreateEmbeddedDraftResponse"; -import { TemplateCreateEmbeddedDraftResponseTemplate } from "./templateCreateEmbeddedDraftResponseTemplate"; -import { TemplateCreateRequest } from "./templateCreateRequest"; -import { TemplateCreateResponse } from "./templateCreateResponse"; -import { TemplateCreateResponseTemplate } from "./templateCreateResponseTemplate"; -import { TemplateEditResponse } from "./templateEditResponse"; -import { TemplateGetResponse } from "./templateGetResponse"; -import { TemplateListResponse } from "./templateListResponse"; -import { TemplateRemoveUserRequest } from "./templateRemoveUserRequest"; -import { TemplateResponse } from "./templateResponse"; -import { TemplateResponseAccount } from "./templateResponseAccount"; -import { TemplateResponseAccountQuota } from "./templateResponseAccountQuota"; -import { TemplateResponseCCRole } from "./templateResponseCCRole"; -import { TemplateResponseDocument } from "./templateResponseDocument"; -import { TemplateResponseDocumentCustomFieldBase } from "./templateResponseDocumentCustomFieldBase"; -import { TemplateResponseDocumentCustomFieldCheckbox } from "./templateResponseDocumentCustomFieldCheckbox"; -import { TemplateResponseDocumentCustomFieldText } from "./templateResponseDocumentCustomFieldText"; -import { TemplateResponseDocumentFieldGroup } from "./templateResponseDocumentFieldGroup"; -import { TemplateResponseDocumentFieldGroupRule } from "./templateResponseDocumentFieldGroupRule"; -import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; -import { TemplateResponseDocumentFormFieldCheckbox } from "./templateResponseDocumentFormFieldCheckbox"; -import { TemplateResponseDocumentFormFieldDateSigned } from "./templateResponseDocumentFormFieldDateSigned"; -import { TemplateResponseDocumentFormFieldDropdown } from "./templateResponseDocumentFormFieldDropdown"; -import { TemplateResponseDocumentFormFieldHyperlink } from "./templateResponseDocumentFormFieldHyperlink"; -import { TemplateResponseDocumentFormFieldInitials } from "./templateResponseDocumentFormFieldInitials"; -import { TemplateResponseDocumentFormFieldRadio } from "./templateResponseDocumentFormFieldRadio"; -import { TemplateResponseDocumentFormFieldSignature } from "./templateResponseDocumentFormFieldSignature"; -import { TemplateResponseDocumentFormFieldText } from "./templateResponseDocumentFormFieldText"; -import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; -import { TemplateResponseDocumentStaticFieldCheckbox } from "./templateResponseDocumentStaticFieldCheckbox"; -import { TemplateResponseDocumentStaticFieldDateSigned } from "./templateResponseDocumentStaticFieldDateSigned"; -import { TemplateResponseDocumentStaticFieldDropdown } from "./templateResponseDocumentStaticFieldDropdown"; -import { TemplateResponseDocumentStaticFieldHyperlink } from "./templateResponseDocumentStaticFieldHyperlink"; -import { TemplateResponseDocumentStaticFieldInitials } from "./templateResponseDocumentStaticFieldInitials"; -import { TemplateResponseDocumentStaticFieldRadio } from "./templateResponseDocumentStaticFieldRadio"; -import { TemplateResponseDocumentStaticFieldSignature } from "./templateResponseDocumentStaticFieldSignature"; -import { TemplateResponseDocumentStaticFieldText } from "./templateResponseDocumentStaticFieldText"; -import { TemplateResponseFieldAvgTextLength } from "./templateResponseFieldAvgTextLength"; -import { TemplateResponseSignerRole } from "./templateResponseSignerRole"; -import { TemplateUpdateFilesRequest } from "./templateUpdateFilesRequest"; -import { TemplateUpdateFilesResponse } from "./templateUpdateFilesResponse"; -import { TemplateUpdateFilesResponseTemplate } from "./templateUpdateFilesResponseTemplate"; -import { UnclaimedDraftCreateEmbeddedRequest } from "./unclaimedDraftCreateEmbeddedRequest"; -import { UnclaimedDraftCreateEmbeddedWithTemplateRequest } from "./unclaimedDraftCreateEmbeddedWithTemplateRequest"; -import { UnclaimedDraftCreateRequest } from "./unclaimedDraftCreateRequest"; -import { UnclaimedDraftCreateResponse } from "./unclaimedDraftCreateResponse"; -import { UnclaimedDraftEditAndResendRequest } from "./unclaimedDraftEditAndResendRequest"; -import { UnclaimedDraftResponse } from "./unclaimedDraftResponse"; -import { WarningResponse } from "./warningResponse"; -export declare let enumsMap: { - [index: string]: any; -}; -export declare let typeMap: { - [index: string]: any; -}; -export { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountResponse, AccountResponseQuotas, AccountResponseUsage, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, AccountVerifyResponseAccount, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppResponse, ApiAppResponseOAuth, ApiAppResponseOptions, ApiAppResponseOwnerAccount, ApiAppResponseWhiteLabelingOptions, ApiAppUpdateRequest, ApiKeyAuth, AttributeTypeMap, Authentication, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackHelper, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FaxGetResponse, FaxLineAddUserRequest, FaxLineAreaCodeGetCountryEnum, FaxLineAreaCodeGetProvinceEnum, FaxLineAreaCodeGetResponse, FaxLineAreaCodeGetStateEnum, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, FaxLineResponseFaxLine, FaxListResponse, FaxResponse, FaxResponseTransmission, FaxSendRequest, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, ListInfoResponse, OAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ObjectSerializer, ReportCreateRequest, ReportCreateResponse, ReportResponse, RequestDetailedFile, RequestFile, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestEditEmbeddedRequest, SignatureRequestEditEmbeddedWithTemplateRequest, SignatureRequestEditRequest, SignatureRequestEditWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestResponse, SignatureRequestResponseAttachment, SignatureRequestResponseCustomFieldBase, SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText, SignatureRequestResponseCustomFieldTypeEnum, SignatureRequestResponseDataBase, SignatureRequestResponseDataTypeEnum, SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge, SignatureRequestResponseSignatures, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest, SubAttachment, SubBulkSignerList, SubBulkSignerListCustomField, SubCC, SubCustomField, SubEditorOptions, SubFieldOptions, SubFormFieldGroup, SubFormFieldRule, SubFormFieldRuleAction, SubFormFieldRuleTrigger, SubFormFieldsPerDocumentBase, SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentFontEnum, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge, SubFormFieldsPerDocumentTypeEnum, SubMergeField, SubOAuth, SubOptions, SubSignatureRequestGroupedSigners, SubSignatureRequestSigner, SubSignatureRequestTemplateSigner, SubSigningOptions, SubTeamResponse, SubTemplateRole, SubUnclaimedDraftSigner, SubUnclaimedDraftTemplateSigner, SubWhiteLabelingOptions, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInfoResponse, TeamInviteResponse, TeamInvitesResponse, TeamMemberResponse, TeamMembersResponse, TeamParentResponse, TeamRemoveMemberRequest, TeamResponse, TeamSubTeamsResponse, TeamUpdateRequest, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateEmbeddedDraftResponseTemplate, TemplateCreateRequest, TemplateCreateResponse, TemplateCreateResponseTemplate, TemplateEditResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateResponse, TemplateResponseAccount, TemplateResponseAccountQuota, TemplateResponseCCRole, TemplateResponseDocument, TemplateResponseDocumentCustomFieldBase, TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText, TemplateResponseDocumentFieldGroup, TemplateResponseDocumentFieldGroupRule, TemplateResponseDocumentFormFieldBase, TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText, TemplateResponseDocumentStaticFieldBase, TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText, TemplateResponseFieldAvgTextLength, TemplateResponseSignerRole, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, TemplateUpdateFilesResponseTemplate, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, VoidAuth, WarningResponse, }; diff --git a/sdks/node/types/model/listInfoResponse.d.ts b/sdks/node/types/model/listInfoResponse.d.ts deleted file mode 100644 index 2b02b96f5..000000000 --- a/sdks/node/types/model/listInfoResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class ListInfoResponse { - "numPages"?: number; - "numResults"?: number | null; - "page"?: number; - "pageSize"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ListInfoResponse; -} diff --git a/sdks/node/types/model/models.d.ts b/sdks/node/types/model/models.d.ts deleted file mode 100644 index de0de4629..000000000 --- a/sdks/node/types/model/models.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { AxiosRequestConfig } from "axios"; -import { Headers } from "form-data"; -import * as fs from "fs"; -export interface RequestDetailedFile { - value: Buffer; - options: { - filename: string; - contentType: string; - header?: string | Headers; - knownLength?: number; - filepath?: string; - }; -} -interface AttributeType { - name: string; - baseName: string; - type: string; -} -export interface AttributeTypeMap extends Array { -} -export type RequestFile = fs.ReadStream | RequestDetailedFile; -export declare class ObjectSerializer { - static findCorrectType(data: any, expectedType: string): any; - static serialize(data: any, type: string): any; - static deserialize(data: any, type: string): any; -} -export interface Authentication { - applyToRequest(requestOptions: AxiosRequestConfig): Promise | void; -} -export declare class HttpBasicAuth implements Authentication { - username: string; - password: string; - applyToRequest(requestOptions: AxiosRequestConfig): void; -} -export declare class HttpBearerAuth implements Authentication { - accessToken: string | (() => string); - applyToRequest(requestOptions: AxiosRequestConfig): void; -} -export declare class ApiKeyAuth implements Authentication { - private location; - private paramName; - apiKey: string; - constructor(location: string, paramName: string); - applyToRequest(requestOptions: AxiosRequestConfig): void; -} -export declare class OAuth implements Authentication { - accessToken: string; - applyToRequest(requestOptions: AxiosRequestConfig): void; -} -export declare class VoidAuth implements Authentication { - username: string; - password: string; - applyToRequest(_: AxiosRequestConfig): void; -} -export type Interceptor = (requestOptions: AxiosRequestConfig) => Promise | void; -export {}; diff --git a/sdks/node/types/model/oAuthTokenGenerateRequest.d.ts b/sdks/node/types/model/oAuthTokenGenerateRequest.d.ts deleted file mode 100644 index 757b7c3d4..000000000 --- a/sdks/node/types/model/oAuthTokenGenerateRequest.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class OAuthTokenGenerateRequest { - "clientId": string; - "clientSecret": string; - "code": string; - "grantType": string; - "state": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): OAuthTokenGenerateRequest; -} diff --git a/sdks/node/types/model/oAuthTokenRefreshRequest.d.ts b/sdks/node/types/model/oAuthTokenRefreshRequest.d.ts deleted file mode 100644 index 71f3d108f..000000000 --- a/sdks/node/types/model/oAuthTokenRefreshRequest.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class OAuthTokenRefreshRequest { - "grantType": string; - "refreshToken": string; - "clientId"?: string; - "clientSecret"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): OAuthTokenRefreshRequest; -} diff --git a/sdks/node/types/model/oAuthTokenResponse.d.ts b/sdks/node/types/model/oAuthTokenResponse.d.ts deleted file mode 100644 index 6b7a81935..000000000 --- a/sdks/node/types/model/oAuthTokenResponse.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class OAuthTokenResponse { - "accessToken"?: string; - "tokenType"?: string; - "refreshToken"?: string; - "expiresIn"?: number; - "state"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): OAuthTokenResponse; -} diff --git a/sdks/node/types/model/reportCreateRequest.d.ts b/sdks/node/types/model/reportCreateRequest.d.ts deleted file mode 100644 index 4bdd1f595..000000000 --- a/sdks/node/types/model/reportCreateRequest.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class ReportCreateRequest { - "endDate": string; - "reportType": Array; - "startDate": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ReportCreateRequest; -} -export declare namespace ReportCreateRequest { - enum ReportTypeEnum { - UserActivity = "user_activity", - DocumentStatus = "document_status", - SmsActivity = "sms_activity" - } -} diff --git a/sdks/node/types/model/reportCreateResponse.d.ts b/sdks/node/types/model/reportCreateResponse.d.ts deleted file mode 100644 index 07d6e0005..000000000 --- a/sdks/node/types/model/reportCreateResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { ReportResponse } from "./reportResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class ReportCreateResponse { - "report": ReportResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ReportCreateResponse; -} diff --git a/sdks/node/types/model/reportResponse.d.ts b/sdks/node/types/model/reportResponse.d.ts deleted file mode 100644 index 1490e79e9..000000000 --- a/sdks/node/types/model/reportResponse.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class ReportResponse { - "success"?: string; - "startDate"?: string; - "endDate"?: string; - "reportType"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): ReportResponse; -} -export declare namespace ReportResponse { - enum ReportTypeEnum { - UserActivity = "user_activity", - DocumentStatus = "document_status", - SmsActivity = "sms_activity" - } -} diff --git a/sdks/node/types/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.d.ts deleted file mode 100644 index 0846addef..000000000 --- a/sdks/node/types/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubBulkSignerList } from "./subBulkSignerList"; -import { SubCC } from "./subCC"; -import { SubCustomField } from "./subCustomField"; -export declare class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { - "templateIds": Array; - "clientId": string; - "signerFile"?: RequestFile; - "signerList"?: Array; - "allowDecline"?: boolean; - "ccs"?: Array; - "customFields"?: Array; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "signingRedirectUrl"?: string; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestBulkCreateEmbeddedWithTemplateRequest; -} diff --git a/sdks/node/types/model/signatureRequestBulkSendWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestBulkSendWithTemplateRequest.d.ts deleted file mode 100644 index e021f5165..000000000 --- a/sdks/node/types/model/signatureRequestBulkSendWithTemplateRequest.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubBulkSignerList } from "./subBulkSignerList"; -import { SubCC } from "./subCC"; -import { SubCustomField } from "./subCustomField"; -export declare class SignatureRequestBulkSendWithTemplateRequest { - "templateIds": Array; - "signerFile"?: RequestFile; - "signerList"?: Array; - "allowDecline"?: boolean; - "ccs"?: Array; - "clientId"?: string; - "customFields"?: Array; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "signingRedirectUrl"?: string; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestBulkSendWithTemplateRequest; -} diff --git a/sdks/node/types/model/signatureRequestCreateEmbeddedRequest.d.ts b/sdks/node/types/model/signatureRequestCreateEmbeddedRequest.d.ts deleted file mode 100644 index 3c3f58e05..000000000 --- a/sdks/node/types/model/signatureRequestCreateEmbeddedRequest.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubAttachment } from "./subAttachment"; -import { SubCustomField } from "./subCustomField"; -import { SubFieldOptions } from "./subFieldOptions"; -import { SubFormFieldGroup } from "./subFormFieldGroup"; -import { SubFormFieldRule } from "./subFormFieldRule"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -import { SubSignatureRequestGroupedSigners } from "./subSignatureRequestGroupedSigners"; -import { SubSignatureRequestSigner } from "./subSignatureRequestSigner"; -import { SubSigningOptions } from "./subSigningOptions"; -export declare class SignatureRequestCreateEmbeddedRequest { - "clientId": string; - "files"?: Array; - "fileUrls"?: Array; - "signers"?: Array; - "groupedSigners"?: Array; - "allowDecline"?: boolean; - "allowFormView"?: boolean; - "allowReassign"?: boolean; - "attachments"?: Array; - "ccEmailAddresses"?: Array; - "customFields"?: Array; - "fieldOptions"?: SubFieldOptions; - "formFieldGroups"?: Array; - "formFieldRules"?: Array; - "formFieldsPerDocument"?: Array; - "hideTextTags"?: boolean; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "signingOptions"?: SubSigningOptions; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - "useTextTags"?: boolean; - "populateAutoFillFields"?: boolean; - "expiresAt"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestCreateEmbeddedRequest; -} diff --git a/sdks/node/types/model/signatureRequestCreateEmbeddedWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestCreateEmbeddedWithTemplateRequest.d.ts deleted file mode 100644 index a707ac1a9..000000000 --- a/sdks/node/types/model/signatureRequestCreateEmbeddedWithTemplateRequest.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubCC } from "./subCC"; -import { SubCustomField } from "./subCustomField"; -import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; -import { SubSigningOptions } from "./subSigningOptions"; -export declare class SignatureRequestCreateEmbeddedWithTemplateRequest { - "templateIds": Array; - "clientId": string; - "signers": Array; - "allowDecline"?: boolean; - "ccs"?: Array; - "customFields"?: Array; - "files"?: Array; - "fileUrls"?: Array; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "signingOptions"?: SubSigningOptions; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - "populateAutoFillFields"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestCreateEmbeddedWithTemplateRequest; -} diff --git a/sdks/node/types/model/signatureRequestEditEmbeddedRequest.d.ts b/sdks/node/types/model/signatureRequestEditEmbeddedRequest.d.ts deleted file mode 100644 index 84d7c3e60..000000000 --- a/sdks/node/types/model/signatureRequestEditEmbeddedRequest.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubAttachment } from "./subAttachment"; -import { SubCustomField } from "./subCustomField"; -import { SubFieldOptions } from "./subFieldOptions"; -import { SubFormFieldGroup } from "./subFormFieldGroup"; -import { SubFormFieldRule } from "./subFormFieldRule"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -import { SubSignatureRequestGroupedSigners } from "./subSignatureRequestGroupedSigners"; -import { SubSignatureRequestSigner } from "./subSignatureRequestSigner"; -import { SubSigningOptions } from "./subSigningOptions"; -export declare class SignatureRequestEditEmbeddedRequest { - "clientId": string; - "files"?: Array; - "fileUrls"?: Array; - "signers"?: Array; - "groupedSigners"?: Array; - "allowDecline"?: boolean; - "allowFormView"?: boolean; - "allowReassign"?: boolean; - "attachments"?: Array; - "ccEmailAddresses"?: Array; - "customFields"?: Array; - "fieldOptions"?: SubFieldOptions; - "formFieldGroups"?: Array; - "formFieldRules"?: Array; - "formFieldsPerDocument"?: Array; - "hideTextTags"?: boolean; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "signingOptions"?: SubSigningOptions; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - "useTextTags"?: boolean; - "populateAutoFillFields"?: boolean; - "expiresAt"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestEditEmbeddedRequest; -} diff --git a/sdks/node/types/model/signatureRequestEditEmbeddedWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestEditEmbeddedWithTemplateRequest.d.ts deleted file mode 100644 index 6824ad17f..000000000 --- a/sdks/node/types/model/signatureRequestEditEmbeddedWithTemplateRequest.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubCC } from "./subCC"; -import { SubCustomField } from "./subCustomField"; -import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; -import { SubSigningOptions } from "./subSigningOptions"; -export declare class SignatureRequestEditEmbeddedWithTemplateRequest { - "templateIds": Array; - "clientId": string; - "signers": Array; - "allowDecline"?: boolean; - "ccs"?: Array; - "customFields"?: Array; - "files"?: Array; - "fileUrls"?: Array; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "signingOptions"?: SubSigningOptions; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - "populateAutoFillFields"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestEditEmbeddedWithTemplateRequest; -} diff --git a/sdks/node/types/model/signatureRequestEditRequest.d.ts b/sdks/node/types/model/signatureRequestEditRequest.d.ts deleted file mode 100644 index d80059a14..000000000 --- a/sdks/node/types/model/signatureRequestEditRequest.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubAttachment } from "./subAttachment"; -import { SubCustomField } from "./subCustomField"; -import { SubFieldOptions } from "./subFieldOptions"; -import { SubFormFieldGroup } from "./subFormFieldGroup"; -import { SubFormFieldRule } from "./subFormFieldRule"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -import { SubSignatureRequestGroupedSigners } from "./subSignatureRequestGroupedSigners"; -import { SubSignatureRequestSigner } from "./subSignatureRequestSigner"; -import { SubSigningOptions } from "./subSigningOptions"; -export declare class SignatureRequestEditRequest { - "files"?: Array; - "fileUrls"?: Array; - "signers"?: Array; - "groupedSigners"?: Array; - "allowDecline"?: boolean; - "allowFormView"?: boolean; - "allowReassign"?: boolean; - "attachments"?: Array; - "ccEmailAddresses"?: Array; - "clientId"?: string; - "customFields"?: Array; - "fieldOptions"?: SubFieldOptions; - "formFieldGroups"?: Array; - "formFieldRules"?: Array; - "formFieldsPerDocument"?: Array; - "hideTextTags"?: boolean; - "isEid"?: boolean; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "signingOptions"?: SubSigningOptions; - "signingRedirectUrl"?: string; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - "useTextTags"?: boolean; - "expiresAt"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestEditRequest; -} diff --git a/sdks/node/types/model/signatureRequestEditWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestEditWithTemplateRequest.d.ts deleted file mode 100644 index 5dc2d730a..000000000 --- a/sdks/node/types/model/signatureRequestEditWithTemplateRequest.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubCC } from "./subCC"; -import { SubCustomField } from "./subCustomField"; -import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; -import { SubSigningOptions } from "./subSigningOptions"; -export declare class SignatureRequestEditWithTemplateRequest { - "templateIds": Array; - "signers": Array; - "allowDecline"?: boolean; - "ccs"?: Array; - "clientId"?: string; - "customFields"?: Array; - "files"?: Array; - "fileUrls"?: Array; - "isEid"?: boolean; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "signingOptions"?: SubSigningOptions; - "signingRedirectUrl"?: string; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestEditWithTemplateRequest; -} diff --git a/sdks/node/types/model/signatureRequestGetResponse.d.ts b/sdks/node/types/model/signatureRequestGetResponse.d.ts deleted file mode 100644 index c7b3d4473..000000000 --- a/sdks/node/types/model/signatureRequestGetResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponse } from "./signatureRequestResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class SignatureRequestGetResponse { - "signatureRequest": SignatureRequestResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestGetResponse; -} diff --git a/sdks/node/types/model/signatureRequestListResponse.d.ts b/sdks/node/types/model/signatureRequestListResponse.d.ts deleted file mode 100644 index b1f229cb9..000000000 --- a/sdks/node/types/model/signatureRequestListResponse.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { ListInfoResponse } from "./listInfoResponse"; -import { SignatureRequestResponse } from "./signatureRequestResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class SignatureRequestListResponse { - "signatureRequests": Array; - "listInfo": ListInfoResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestListResponse; -} diff --git a/sdks/node/types/model/signatureRequestRemindRequest.d.ts b/sdks/node/types/model/signatureRequestRemindRequest.d.ts deleted file mode 100644 index e1b68203a..000000000 --- a/sdks/node/types/model/signatureRequestRemindRequest.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SignatureRequestRemindRequest { - "emailAddress": string; - "name"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestRemindRequest; -} diff --git a/sdks/node/types/model/signatureRequestResponse.d.ts b/sdks/node/types/model/signatureRequestResponse.d.ts deleted file mode 100644 index a7420b6e9..000000000 --- a/sdks/node/types/model/signatureRequestResponse.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseAttachment } from "./signatureRequestResponseAttachment"; -import { SignatureRequestResponseCustomFieldBase } from "./signatureRequestResponseCustomFieldBase"; -import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; -import { SignatureRequestResponseSignatures } from "./signatureRequestResponseSignatures"; -export declare class SignatureRequestResponse { - "testMode"?: boolean; - "signatureRequestId"?: string; - "requesterEmailAddress"?: string | null; - "title"?: string; - "originalTitle"?: string; - "subject"?: string | null; - "message"?: string | null; - "metadata"?: { - [key: string]: any; - }; - "createdAt"?: number; - "expiresAt"?: number | null; - "isComplete"?: boolean; - "isDeclined"?: boolean; - "hasError"?: boolean; - "filesUrl"?: string; - "signingUrl"?: string | null; - "detailsUrl"?: string; - "ccEmailAddresses"?: Array; - "signingRedirectUrl"?: string | null; - "finalCopyUri"?: string | null; - "templateIds"?: Array | null; - "customFields"?: Array | null; - "attachments"?: Array | null; - "responseData"?: Array | null; - "signatures"?: Array; - "bulkSendJobId"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponse; -} diff --git a/sdks/node/types/model/signatureRequestResponseAttachment.d.ts b/sdks/node/types/model/signatureRequestResponseAttachment.d.ts deleted file mode 100644 index aa6a3b3cf..000000000 --- a/sdks/node/types/model/signatureRequestResponseAttachment.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SignatureRequestResponseAttachment { - "id": string; - "signer": number | string; - "name": string; - "required": boolean; - "instructions"?: string | null; - "uploadedAt"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseAttachment; -} diff --git a/sdks/node/types/model/signatureRequestResponseCustomFieldBase.d.ts b/sdks/node/types/model/signatureRequestResponseCustomFieldBase.d.ts deleted file mode 100644 index a304664b2..000000000 --- a/sdks/node/types/model/signatureRequestResponseCustomFieldBase.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare abstract class SignatureRequestResponseCustomFieldBase { - "type": string; - "name": string; - "required"?: boolean; - "apiId"?: string; - "editor"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static discriminatorClassName(value: any): string | null; -} diff --git a/sdks/node/types/model/signatureRequestResponseCustomFieldCheckbox.d.ts b/sdks/node/types/model/signatureRequestResponseCustomFieldCheckbox.d.ts deleted file mode 100644 index 4b991bd1c..000000000 --- a/sdks/node/types/model/signatureRequestResponseCustomFieldCheckbox.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseCustomFieldBase } from "./signatureRequestResponseCustomFieldBase"; -export declare class SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestResponseCustomFieldBase { - "type": string; - "value"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseCustomFieldCheckbox; -} diff --git a/sdks/node/types/model/signatureRequestResponseCustomFieldText.d.ts b/sdks/node/types/model/signatureRequestResponseCustomFieldText.d.ts deleted file mode 100644 index 3bd5942bf..000000000 --- a/sdks/node/types/model/signatureRequestResponseCustomFieldText.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseCustomFieldBase } from "./signatureRequestResponseCustomFieldBase"; -export declare class SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCustomFieldBase { - "type": string; - "value"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseCustomFieldText; -} diff --git a/sdks/node/types/model/signatureRequestResponseCustomFieldTypeEnum.d.ts b/sdks/node/types/model/signatureRequestResponseCustomFieldTypeEnum.d.ts deleted file mode 100644 index 6991bd41f..000000000 --- a/sdks/node/types/model/signatureRequestResponseCustomFieldTypeEnum.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare enum SignatureRequestResponseCustomFieldTypeEnum { - Text = "text", - Checkbox = "checkbox" -} diff --git a/sdks/node/types/model/signatureRequestResponseDataBase.d.ts b/sdks/node/types/model/signatureRequestResponseDataBase.d.ts deleted file mode 100644 index b7c659e25..000000000 --- a/sdks/node/types/model/signatureRequestResponseDataBase.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare abstract class SignatureRequestResponseDataBase { - "apiId"?: string; - "signatureId"?: string; - "name"?: string; - "required"?: boolean; - "type"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static discriminatorClassName(value: any): string | null; -} diff --git a/sdks/node/types/model/signatureRequestResponseDataTypeEnum.d.ts b/sdks/node/types/model/signatureRequestResponseDataTypeEnum.d.ts deleted file mode 100644 index 4e089a31b..000000000 --- a/sdks/node/types/model/signatureRequestResponseDataTypeEnum.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export declare enum SignatureRequestResponseDataTypeEnum { - Text = "text", - Checkbox = "checkbox", - DateSigned = "date_signed", - Dropdown = "dropdown", - Initials = "initials", - Radio = "radio", - Signature = "signature", - TextMerge = "text-merge", - CheckboxMerge = "checkbox-merge" -} diff --git a/sdks/node/types/model/signatureRequestResponseDataValueCheckbox.d.ts b/sdks/node/types/model/signatureRequestResponseDataValueCheckbox.d.ts deleted file mode 100644 index 9e24d976c..000000000 --- a/sdks/node/types/model/signatureRequestResponseDataValueCheckbox.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; -export declare class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponseDataBase { - "type"?: string; - "value"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseDataValueCheckbox; -} diff --git a/sdks/node/types/model/signatureRequestResponseDataValueCheckboxMerge.d.ts b/sdks/node/types/model/signatureRequestResponseDataValueCheckboxMerge.d.ts deleted file mode 100644 index b2a9c264f..000000000 --- a/sdks/node/types/model/signatureRequestResponseDataValueCheckboxMerge.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; -export declare class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestResponseDataBase { - "type"?: string; - "value"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseDataValueCheckboxMerge; -} diff --git a/sdks/node/types/model/signatureRequestResponseDataValueDateSigned.d.ts b/sdks/node/types/model/signatureRequestResponseDataValueDateSigned.d.ts deleted file mode 100644 index 39ed23d26..000000000 --- a/sdks/node/types/model/signatureRequestResponseDataValueDateSigned.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; -export declare class SignatureRequestResponseDataValueDateSigned extends SignatureRequestResponseDataBase { - "type"?: string; - "value"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseDataValueDateSigned; -} diff --git a/sdks/node/types/model/signatureRequestResponseDataValueDropdown.d.ts b/sdks/node/types/model/signatureRequestResponseDataValueDropdown.d.ts deleted file mode 100644 index c8ad6bf1e..000000000 --- a/sdks/node/types/model/signatureRequestResponseDataValueDropdown.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; -export declare class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponseDataBase { - "type"?: string; - "value"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseDataValueDropdown; -} diff --git a/sdks/node/types/model/signatureRequestResponseDataValueInitials.d.ts b/sdks/node/types/model/signatureRequestResponseDataValueInitials.d.ts deleted file mode 100644 index 060954deb..000000000 --- a/sdks/node/types/model/signatureRequestResponseDataValueInitials.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; -export declare class SignatureRequestResponseDataValueInitials extends SignatureRequestResponseDataBase { - "type"?: string; - "value"?: string; - "isSigned"?: boolean | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseDataValueInitials; -} diff --git a/sdks/node/types/model/signatureRequestResponseDataValueRadio.d.ts b/sdks/node/types/model/signatureRequestResponseDataValueRadio.d.ts deleted file mode 100644 index b00bb01dd..000000000 --- a/sdks/node/types/model/signatureRequestResponseDataValueRadio.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; -export declare class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDataBase { - "type"?: string; - "value"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseDataValueRadio; -} diff --git a/sdks/node/types/model/signatureRequestResponseDataValueSignature.d.ts b/sdks/node/types/model/signatureRequestResponseDataValueSignature.d.ts deleted file mode 100644 index 281a6943f..000000000 --- a/sdks/node/types/model/signatureRequestResponseDataValueSignature.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; -export declare class SignatureRequestResponseDataValueSignature extends SignatureRequestResponseDataBase { - "type"?: string; - "value"?: string; - "isSigned"?: boolean | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseDataValueSignature; -} diff --git a/sdks/node/types/model/signatureRequestResponseDataValueText.d.ts b/sdks/node/types/model/signatureRequestResponseDataValueText.d.ts deleted file mode 100644 index fce7e6127..000000000 --- a/sdks/node/types/model/signatureRequestResponseDataValueText.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; -export declare class SignatureRequestResponseDataValueText extends SignatureRequestResponseDataBase { - "type"?: string; - "value"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseDataValueText; -} diff --git a/sdks/node/types/model/signatureRequestResponseDataValueTextMerge.d.ts b/sdks/node/types/model/signatureRequestResponseDataValueTextMerge.d.ts deleted file mode 100644 index 4b683f438..000000000 --- a/sdks/node/types/model/signatureRequestResponseDataValueTextMerge.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; -export declare class SignatureRequestResponseDataValueTextMerge extends SignatureRequestResponseDataBase { - "type"?: string; - "value"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseDataValueTextMerge; -} diff --git a/sdks/node/types/model/signatureRequestResponseSignatures.d.ts b/sdks/node/types/model/signatureRequestResponseSignatures.d.ts deleted file mode 100644 index f6f9e4920..000000000 --- a/sdks/node/types/model/signatureRequestResponseSignatures.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SignatureRequestResponseSignatures { - "signatureId"?: string; - "signerGroupGuid"?: string | null; - "signerEmailAddress"?: string; - "signerName"?: string | null; - "signerRole"?: string | null; - "order"?: number | null; - "statusCode"?: string; - "declineReason"?: string | null; - "signedAt"?: number | null; - "lastViewedAt"?: number | null; - "lastRemindedAt"?: number | null; - "hasPin"?: boolean; - "hasSmsAuth"?: boolean | null; - "hasSmsDelivery"?: boolean | null; - "smsPhoneNumber"?: string | null; - "reassignedBy"?: string | null; - "reassignmentReason"?: string | null; - "reassignedFrom"?: string | null; - "error"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestResponseSignatures; -} diff --git a/sdks/node/types/model/signatureRequestSendRequest.d.ts b/sdks/node/types/model/signatureRequestSendRequest.d.ts deleted file mode 100644 index 0f26f0697..000000000 --- a/sdks/node/types/model/signatureRequestSendRequest.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubAttachment } from "./subAttachment"; -import { SubCustomField } from "./subCustomField"; -import { SubFieldOptions } from "./subFieldOptions"; -import { SubFormFieldGroup } from "./subFormFieldGroup"; -import { SubFormFieldRule } from "./subFormFieldRule"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -import { SubSignatureRequestGroupedSigners } from "./subSignatureRequestGroupedSigners"; -import { SubSignatureRequestSigner } from "./subSignatureRequestSigner"; -import { SubSigningOptions } from "./subSigningOptions"; -export declare class SignatureRequestSendRequest { - "files"?: Array; - "fileUrls"?: Array; - "signers"?: Array; - "groupedSigners"?: Array; - "allowDecline"?: boolean; - "allowReassign"?: boolean; - "allowFormView"?: boolean; - "attachments"?: Array; - "ccEmailAddresses"?: Array; - "clientId"?: string; - "customFields"?: Array; - "fieldOptions"?: SubFieldOptions; - "formFieldGroups"?: Array; - "formFieldRules"?: Array; - "formFieldsPerDocument"?: Array; - "hideTextTags"?: boolean; - "isQualifiedSignature"?: boolean; - "isEid"?: boolean; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "signingOptions"?: SubSigningOptions; - "signingRedirectUrl"?: string; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - "useTextTags"?: boolean; - "expiresAt"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestSendRequest; -} diff --git a/sdks/node/types/model/signatureRequestSendWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestSendWithTemplateRequest.d.ts deleted file mode 100644 index 3bacfad01..000000000 --- a/sdks/node/types/model/signatureRequestSendWithTemplateRequest.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubCC } from "./subCC"; -import { SubCustomField } from "./subCustomField"; -import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; -import { SubSigningOptions } from "./subSigningOptions"; -export declare class SignatureRequestSendWithTemplateRequest { - "templateIds": Array; - "signers": Array; - "allowDecline"?: boolean; - "ccs"?: Array; - "clientId"?: string; - "customFields"?: Array; - "files"?: Array; - "fileUrls"?: Array; - "isQualifiedSignature"?: boolean; - "isEid"?: boolean; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "signingOptions"?: SubSigningOptions; - "signingRedirectUrl"?: string; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestSendWithTemplateRequest; -} diff --git a/sdks/node/types/model/signatureRequestUpdateRequest.d.ts b/sdks/node/types/model/signatureRequestUpdateRequest.d.ts deleted file mode 100644 index ef354f6fa..000000000 --- a/sdks/node/types/model/signatureRequestUpdateRequest.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SignatureRequestUpdateRequest { - "signatureId": string; - "emailAddress"?: string; - "name"?: string; - "expiresAt"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SignatureRequestUpdateRequest; -} diff --git a/sdks/node/types/model/subAttachment.d.ts b/sdks/node/types/model/subAttachment.d.ts deleted file mode 100644 index 24da561f0..000000000 --- a/sdks/node/types/model/subAttachment.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubAttachment { - "name": string; - "signerIndex": number; - "instructions"?: string; - "required"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubAttachment; -} diff --git a/sdks/node/types/model/subBulkSignerList.d.ts b/sdks/node/types/model/subBulkSignerList.d.ts deleted file mode 100644 index 096e0464f..000000000 --- a/sdks/node/types/model/subBulkSignerList.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubBulkSignerListCustomField } from "./subBulkSignerListCustomField"; -import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; -export declare class SubBulkSignerList { - "customFields"?: Array; - "signers"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubBulkSignerList; -} diff --git a/sdks/node/types/model/subBulkSignerListCustomField.d.ts b/sdks/node/types/model/subBulkSignerListCustomField.d.ts deleted file mode 100644 index 8fa6c7f8c..000000000 --- a/sdks/node/types/model/subBulkSignerListCustomField.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubBulkSignerListCustomField { - "name": string; - "value": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubBulkSignerListCustomField; -} diff --git a/sdks/node/types/model/subCC.d.ts b/sdks/node/types/model/subCC.d.ts deleted file mode 100644 index 9f335a6b0..000000000 --- a/sdks/node/types/model/subCC.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubCC { - "role": string; - "emailAddress": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubCC; -} diff --git a/sdks/node/types/model/subCustomField.d.ts b/sdks/node/types/model/subCustomField.d.ts deleted file mode 100644 index ddb7b3619..000000000 --- a/sdks/node/types/model/subCustomField.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubCustomField { - "name": string; - "editor"?: string; - "required"?: boolean; - "value"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubCustomField; -} diff --git a/sdks/node/types/model/subEditorOptions.d.ts b/sdks/node/types/model/subEditorOptions.d.ts deleted file mode 100644 index 2b324d2cb..000000000 --- a/sdks/node/types/model/subEditorOptions.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubEditorOptions { - "allowEditSigners"?: boolean; - "allowEditDocuments"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubEditorOptions; -} diff --git a/sdks/node/types/model/subFieldOptions.d.ts b/sdks/node/types/model/subFieldOptions.d.ts deleted file mode 100644 index cbb0a88c8..000000000 --- a/sdks/node/types/model/subFieldOptions.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubFieldOptions { - "dateFormat": SubFieldOptions.DateFormatEnum; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFieldOptions; -} -export declare namespace SubFieldOptions { - enum DateFormatEnum { - MMDDYYYY = "MM / DD / YYYY", - MM_DD_YYYY = "MM - DD - YYYY", - DDMMYYYY = "DD / MM / YYYY", - DD_MM_YYYY = "DD - MM - YYYY", - YYYYMMDD = "YYYY / MM / DD", - YYYY_MM_DD = "YYYY - MM - DD" - } -} diff --git a/sdks/node/types/model/subFormFieldGroup.d.ts b/sdks/node/types/model/subFormFieldGroup.d.ts deleted file mode 100644 index d458918c5..000000000 --- a/sdks/node/types/model/subFormFieldGroup.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubFormFieldGroup { - "groupId": string; - "groupLabel": string; - "requirement": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldGroup; -} diff --git a/sdks/node/types/model/subFormFieldRule.d.ts b/sdks/node/types/model/subFormFieldRule.d.ts deleted file mode 100644 index 41eaf44e7..000000000 --- a/sdks/node/types/model/subFormFieldRule.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubFormFieldRuleAction } from "./subFormFieldRuleAction"; -import { SubFormFieldRuleTrigger } from "./subFormFieldRuleTrigger"; -export declare class SubFormFieldRule { - "id": string; - "triggerOperator": string; - "triggers": Array; - "actions": Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldRule; -} diff --git a/sdks/node/types/model/subFormFieldRuleAction.d.ts b/sdks/node/types/model/subFormFieldRuleAction.d.ts deleted file mode 100644 index 650f98673..000000000 --- a/sdks/node/types/model/subFormFieldRuleAction.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubFormFieldRuleAction { - "hidden": boolean; - "type": SubFormFieldRuleAction.TypeEnum; - "fieldId"?: string; - "groupId"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldRuleAction; -} -export declare namespace SubFormFieldRuleAction { - enum TypeEnum { - ChangeFieldVisibility = "change-field-visibility", - FieldVisibility = "change-field-visibility", - ChangeGroupVisibility = "change-group-visibility", - GroupVisibility = "change-group-visibility" - } -} diff --git a/sdks/node/types/model/subFormFieldRuleTrigger.d.ts b/sdks/node/types/model/subFormFieldRuleTrigger.d.ts deleted file mode 100644 index e555d90fe..000000000 --- a/sdks/node/types/model/subFormFieldRuleTrigger.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubFormFieldRuleTrigger { - "id": string; - "operator": SubFormFieldRuleTrigger.OperatorEnum; - "value"?: string; - "values"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldRuleTrigger; -} -export declare namespace SubFormFieldRuleTrigger { - enum OperatorEnum { - Any = "any", - Is = "is", - Match = "match", - None = "none", - Not = "not" - } -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentBase.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentBase.d.ts deleted file mode 100644 index 182539a7d..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentBase.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare abstract class SubFormFieldsPerDocumentBase { - "documentIndex": number; - "apiId": string; - "height": number; - "required": boolean; - "signer": number | string; - "type": string; - "width": number; - "x": number; - "y": number; - "name"?: string; - "page"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static discriminatorClassName(value: any): string | null; -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentCheckbox.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentCheckbox.d.ts deleted file mode 100644 index 5d140db24..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentCheckbox.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -export declare class SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase { - "type": string; - "isChecked": boolean; - "group"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldsPerDocumentCheckbox; -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentCheckboxMerge.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentCheckboxMerge.d.ts deleted file mode 100644 index 9762d6bf8..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentCheckboxMerge.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -export declare class SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase { - "type": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldsPerDocumentCheckboxMerge; -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentDateSigned.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentDateSigned.d.ts deleted file mode 100644 index c356c28fc..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentDateSigned.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -export declare class SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase { - "type": string; - "fontFamily"?: SubFormFieldsPerDocumentDateSigned.FontFamilyEnum; - "fontSize"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldsPerDocumentDateSigned; -} -export declare namespace SubFormFieldsPerDocumentDateSigned { - enum FontFamilyEnum { - Helvetica = "helvetica", - Arial = "arial", - Courier = "courier", - Calibri = "calibri", - Cambria = "cambria", - Georgia = "georgia", - Times = "times", - Trebuchet = "trebuchet", - Verdana = "verdana", - Roboto = "roboto", - RobotoMono = "robotoMono", - NotoSans = "notoSans", - NotoSerif = "notoSerif", - NotoCjkJpRegular = "notoCJK-JP-Regular", - NotoHebrewRegular = "notoHebrew-Regular", - NotoSanThaiMerged = "notoSanThaiMerged" - } -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentDropdown.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentDropdown.d.ts deleted file mode 100644 index 5bdcc4101..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentDropdown.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -export declare class SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase { - "type": string; - "options": Array; - "content"?: string; - "fontFamily"?: SubFormFieldsPerDocumentDropdown.FontFamilyEnum; - "fontSize"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldsPerDocumentDropdown; -} -export declare namespace SubFormFieldsPerDocumentDropdown { - enum FontFamilyEnum { - Helvetica = "helvetica", - Arial = "arial", - Courier = "courier", - Calibri = "calibri", - Cambria = "cambria", - Georgia = "georgia", - Times = "times", - Trebuchet = "trebuchet", - Verdana = "verdana", - Roboto = "roboto", - RobotoMono = "robotoMono", - NotoSans = "notoSans", - NotoSerif = "notoSerif", - NotoCjkJpRegular = "notoCJK-JP-Regular", - NotoHebrewRegular = "notoHebrew-Regular", - NotoSanThaiMerged = "notoSanThaiMerged" - } -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentFontEnum.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentFontEnum.d.ts deleted file mode 100644 index 4fdfe72ad..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentFontEnum.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export declare enum SubFormFieldsPerDocumentFontEnum { - Helvetica = "helvetica", - Arial = "arial", - Courier = "courier", - Calibri = "calibri", - Cambria = "cambria", - Georgia = "georgia", - Times = "times", - Trebuchet = "trebuchet", - Verdana = "verdana", - Roboto = "roboto", - RobotoMono = "robotoMono", - NotoSans = "notoSans", - NotoSerif = "notoSerif", - NotoCjkJpRegular = "notoCJK-JP-Regular", - NotoHebrewRegular = "notoHebrew-Regular", - NotoSanThaiMerged = "notoSanThaiMerged" -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentHyperlink.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentHyperlink.d.ts deleted file mode 100644 index 2d2c6ad19..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentHyperlink.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -export declare class SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase { - "type": string; - "content": string; - "contentUrl": string; - "fontFamily"?: SubFormFieldsPerDocumentHyperlink.FontFamilyEnum; - "fontSize"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldsPerDocumentHyperlink; -} -export declare namespace SubFormFieldsPerDocumentHyperlink { - enum FontFamilyEnum { - Helvetica = "helvetica", - Arial = "arial", - Courier = "courier", - Calibri = "calibri", - Cambria = "cambria", - Georgia = "georgia", - Times = "times", - Trebuchet = "trebuchet", - Verdana = "verdana", - Roboto = "roboto", - RobotoMono = "robotoMono", - NotoSans = "notoSans", - NotoSerif = "notoSerif", - NotoCjkJpRegular = "notoCJK-JP-Regular", - NotoHebrewRegular = "notoHebrew-Regular", - NotoSanThaiMerged = "notoSanThaiMerged" - } -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentInitials.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentInitials.d.ts deleted file mode 100644 index 7d8518474..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentInitials.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -export declare class SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase { - "type": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldsPerDocumentInitials; -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentRadio.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentRadio.d.ts deleted file mode 100644 index 8841004bb..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentRadio.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -export declare class SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase { - "type": string; - "group": string; - "isChecked": boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldsPerDocumentRadio; -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentSignature.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentSignature.d.ts deleted file mode 100644 index 1ef5cb2f1..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentSignature.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -export declare class SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase { - "type": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldsPerDocumentSignature; -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentText.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentText.d.ts deleted file mode 100644 index 5917707da..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentText.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -export declare class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase { - "type": string; - "placeholder"?: string; - "autoFillType"?: string; - "linkId"?: string; - "masked"?: boolean; - "validationType"?: SubFormFieldsPerDocumentText.ValidationTypeEnum; - "validationCustomRegex"?: string; - "validationCustomRegexFormatLabel"?: string; - "content"?: string; - "fontFamily"?: SubFormFieldsPerDocumentText.FontFamilyEnum; - "fontSize"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldsPerDocumentText; -} -export declare namespace SubFormFieldsPerDocumentText { - enum ValidationTypeEnum { - NumbersOnly = "numbers_only", - LettersOnly = "letters_only", - PhoneNumber = "phone_number", - BankRoutingNumber = "bank_routing_number", - BankAccountNumber = "bank_account_number", - EmailAddress = "email_address", - ZipCode = "zip_code", - SocialSecurityNumber = "social_security_number", - EmployerIdentificationNumber = "employer_identification_number", - CustomRegex = "custom_regex" - } - enum FontFamilyEnum { - Helvetica = "helvetica", - Arial = "arial", - Courier = "courier", - Calibri = "calibri", - Cambria = "cambria", - Georgia = "georgia", - Times = "times", - Trebuchet = "trebuchet", - Verdana = "verdana", - Roboto = "roboto", - RobotoMono = "robotoMono", - NotoSans = "notoSans", - NotoSerif = "notoSerif", - NotoCjkJpRegular = "notoCJK-JP-Regular", - NotoHebrewRegular = "notoHebrew-Regular", - NotoSanThaiMerged = "notoSanThaiMerged" - } -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentTextMerge.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentTextMerge.d.ts deleted file mode 100644 index 8d5accd1b..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentTextMerge.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -export declare class SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase { - "type": string; - "fontFamily"?: SubFormFieldsPerDocumentTextMerge.FontFamilyEnum; - "fontSize"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubFormFieldsPerDocumentTextMerge; -} -export declare namespace SubFormFieldsPerDocumentTextMerge { - enum FontFamilyEnum { - Helvetica = "helvetica", - Arial = "arial", - Courier = "courier", - Calibri = "calibri", - Cambria = "cambria", - Georgia = "georgia", - Times = "times", - Trebuchet = "trebuchet", - Verdana = "verdana", - Roboto = "roboto", - RobotoMono = "robotoMono", - NotoSans = "notoSans", - NotoSerif = "notoSerif", - NotoCjkJpRegular = "notoCJK-JP-Regular", - NotoHebrewRegular = "notoHebrew-Regular", - NotoSanThaiMerged = "notoSanThaiMerged" - } -} diff --git a/sdks/node/types/model/subFormFieldsPerDocumentTypeEnum.d.ts b/sdks/node/types/model/subFormFieldsPerDocumentTypeEnum.d.ts deleted file mode 100644 index 948bcd3c7..000000000 --- a/sdks/node/types/model/subFormFieldsPerDocumentTypeEnum.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export declare enum SubFormFieldsPerDocumentTypeEnum { - Checkbox = "checkbox", - CheckboxMerge = "checkbox-merge", - DateSigned = "date_signed", - Dropdown = "dropdown", - Hyperlink = "hyperlink", - Initials = "initials", - Signature = "signature", - Radio = "radio", - Text = "text", - TextMerge = "text-merge" -} diff --git a/sdks/node/types/model/subMergeField.d.ts b/sdks/node/types/model/subMergeField.d.ts deleted file mode 100644 index 8af065e37..000000000 --- a/sdks/node/types/model/subMergeField.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubMergeField { - "name": string; - "type": SubMergeField.TypeEnum; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubMergeField; -} -export declare namespace SubMergeField { - enum TypeEnum { - Text = "text", - Checkbox = "checkbox" - } -} diff --git a/sdks/node/types/model/subOAuth.d.ts b/sdks/node/types/model/subOAuth.d.ts deleted file mode 100644 index 576df5f00..000000000 --- a/sdks/node/types/model/subOAuth.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubOAuth { - "callbackUrl"?: string; - "scopes"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubOAuth; -} -export declare namespace SubOAuth { - enum ScopesEnum { - RequestSignature = "request_signature", - BasicAccountInfo = "basic_account_info", - AccountAccess = "account_access", - SignatureRequestAccess = "signature_request_access", - TemplateAccess = "template_access", - TeamAccess = "team_access", - ApiAppAccess = "api_app_access", - Empty = "" - } -} diff --git a/sdks/node/types/model/subOptions.d.ts b/sdks/node/types/model/subOptions.d.ts deleted file mode 100644 index b017c5cd3..000000000 --- a/sdks/node/types/model/subOptions.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubOptions { - "canInsertEverywhere"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubOptions; -} diff --git a/sdks/node/types/model/subSignatureRequestGroupedSigners.d.ts b/sdks/node/types/model/subSignatureRequestGroupedSigners.d.ts deleted file mode 100644 index 159165156..000000000 --- a/sdks/node/types/model/subSignatureRequestGroupedSigners.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubSignatureRequestSigner } from "./subSignatureRequestSigner"; -export declare class SubSignatureRequestGroupedSigners { - "group": string; - "signers": Array; - "order"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubSignatureRequestGroupedSigners; -} diff --git a/sdks/node/types/model/subSignatureRequestSigner.d.ts b/sdks/node/types/model/subSignatureRequestSigner.d.ts deleted file mode 100644 index 908d37215..000000000 --- a/sdks/node/types/model/subSignatureRequestSigner.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubSignatureRequestSigner { - "name": string; - "emailAddress": string; - "order"?: number | null; - "pin"?: string; - "smsPhoneNumber"?: string; - "smsPhoneNumberType"?: SubSignatureRequestSigner.SmsPhoneNumberTypeEnum; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubSignatureRequestSigner; -} -export declare namespace SubSignatureRequestSigner { - enum SmsPhoneNumberTypeEnum { - Authentication = "authentication", - Delivery = "delivery" - } -} diff --git a/sdks/node/types/model/subSignatureRequestTemplateSigner.d.ts b/sdks/node/types/model/subSignatureRequestTemplateSigner.d.ts deleted file mode 100644 index 0e949a26f..000000000 --- a/sdks/node/types/model/subSignatureRequestTemplateSigner.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubSignatureRequestTemplateSigner { - "role": string; - "name": string; - "emailAddress": string; - "pin"?: string; - "smsPhoneNumber"?: string; - "smsPhoneNumberType"?: SubSignatureRequestTemplateSigner.SmsPhoneNumberTypeEnum; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubSignatureRequestTemplateSigner; -} -export declare namespace SubSignatureRequestTemplateSigner { - enum SmsPhoneNumberTypeEnum { - Authentication = "authentication", - Delivery = "delivery" - } -} diff --git a/sdks/node/types/model/subSigningOptions.d.ts b/sdks/node/types/model/subSigningOptions.d.ts deleted file mode 100644 index c81b643d3..000000000 --- a/sdks/node/types/model/subSigningOptions.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubSigningOptions { - "defaultType": SubSigningOptions.DefaultTypeEnum; - "draw"?: boolean; - "phone"?: boolean; - "type"?: boolean; - "upload"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubSigningOptions; -} -export declare namespace SubSigningOptions { - enum DefaultTypeEnum { - Draw = "draw", - Phone = "phone", - Type = "type", - Upload = "upload" - } -} diff --git a/sdks/node/types/model/subTeamResponse.d.ts b/sdks/node/types/model/subTeamResponse.d.ts deleted file mode 100644 index 7aac1aa05..000000000 --- a/sdks/node/types/model/subTeamResponse.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubTeamResponse { - "teamId"?: string; - "name"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubTeamResponse; -} diff --git a/sdks/node/types/model/subTemplateRole.d.ts b/sdks/node/types/model/subTemplateRole.d.ts deleted file mode 100644 index dead6b96f..000000000 --- a/sdks/node/types/model/subTemplateRole.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubTemplateRole { - "name"?: string; - "order"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubTemplateRole; -} diff --git a/sdks/node/types/model/subUnclaimedDraftSigner.d.ts b/sdks/node/types/model/subUnclaimedDraftSigner.d.ts deleted file mode 100644 index 3a0b2fac8..000000000 --- a/sdks/node/types/model/subUnclaimedDraftSigner.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubUnclaimedDraftSigner { - "emailAddress": string; - "name": string; - "order"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubUnclaimedDraftSigner; -} diff --git a/sdks/node/types/model/subUnclaimedDraftTemplateSigner.d.ts b/sdks/node/types/model/subUnclaimedDraftTemplateSigner.d.ts deleted file mode 100644 index ef6c5dcce..000000000 --- a/sdks/node/types/model/subUnclaimedDraftTemplateSigner.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubUnclaimedDraftTemplateSigner { - "role": string; - "name": string; - "emailAddress": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubUnclaimedDraftTemplateSigner; -} diff --git a/sdks/node/types/model/subWhiteLabelingOptions.d.ts b/sdks/node/types/model/subWhiteLabelingOptions.d.ts deleted file mode 100644 index f87a579d5..000000000 --- a/sdks/node/types/model/subWhiteLabelingOptions.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class SubWhiteLabelingOptions { - "headerBackgroundColor"?: string; - "legalVersion"?: SubWhiteLabelingOptions.LegalVersionEnum; - "linkColor"?: string; - "pageBackgroundColor"?: string; - "primaryButtonColor"?: string; - "primaryButtonColorHover"?: string; - "primaryButtonTextColor"?: string; - "primaryButtonTextColorHover"?: string; - "secondaryButtonColor"?: string; - "secondaryButtonColorHover"?: string; - "secondaryButtonTextColor"?: string; - "secondaryButtonTextColorHover"?: string; - "textColor1"?: string; - "textColor2"?: string; - "resetToDefault"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): SubWhiteLabelingOptions; -} -export declare namespace SubWhiteLabelingOptions { - enum LegalVersionEnum { - Terms1 = "terms1", - Terms2 = "terms2" - } -} diff --git a/sdks/node/types/model/teamAddMemberRequest.d.ts b/sdks/node/types/model/teamAddMemberRequest.d.ts deleted file mode 100644 index fa4476c21..000000000 --- a/sdks/node/types/model/teamAddMemberRequest.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TeamAddMemberRequest { - "accountId"?: string; - "emailAddress"?: string; - "role"?: TeamAddMemberRequest.RoleEnum; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamAddMemberRequest; -} -export declare namespace TeamAddMemberRequest { - enum RoleEnum { - Member = "Member", - Developer = "Developer", - TeamManager = "Team Manager", - Admin = "Admin" - } -} diff --git a/sdks/node/types/model/teamCreateRequest.d.ts b/sdks/node/types/model/teamCreateRequest.d.ts deleted file mode 100644 index 51c712ac8..000000000 --- a/sdks/node/types/model/teamCreateRequest.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TeamCreateRequest { - "name"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamCreateRequest; -} diff --git a/sdks/node/types/model/teamGetInfoResponse.d.ts b/sdks/node/types/model/teamGetInfoResponse.d.ts deleted file mode 100644 index b52a84c46..000000000 --- a/sdks/node/types/model/teamGetInfoResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TeamInfoResponse } from "./teamInfoResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class TeamGetInfoResponse { - "team": TeamInfoResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamGetInfoResponse; -} diff --git a/sdks/node/types/model/teamGetResponse.d.ts b/sdks/node/types/model/teamGetResponse.d.ts deleted file mode 100644 index 5ebf91dd7..000000000 --- a/sdks/node/types/model/teamGetResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TeamResponse } from "./teamResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class TeamGetResponse { - "team": TeamResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamGetResponse; -} diff --git a/sdks/node/types/model/teamInfoResponse.d.ts b/sdks/node/types/model/teamInfoResponse.d.ts deleted file mode 100644 index 95434d89d..000000000 --- a/sdks/node/types/model/teamInfoResponse.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TeamParentResponse } from "./teamParentResponse"; -export declare class TeamInfoResponse { - "teamId"?: string; - "teamParent"?: TeamParentResponse | null; - "name"?: string; - "numMembers"?: number; - "numSubTeams"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamInfoResponse; -} diff --git a/sdks/node/types/model/teamInviteResponse.d.ts b/sdks/node/types/model/teamInviteResponse.d.ts deleted file mode 100644 index c5518e11f..000000000 --- a/sdks/node/types/model/teamInviteResponse.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TeamInviteResponse { - "emailAddress"?: string; - "teamId"?: string; - "role"?: string; - "sentAt"?: number; - "redeemedAt"?: number; - "expiresAt"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamInviteResponse; -} diff --git a/sdks/node/types/model/teamInvitesResponse.d.ts b/sdks/node/types/model/teamInvitesResponse.d.ts deleted file mode 100644 index bbbd11b10..000000000 --- a/sdks/node/types/model/teamInvitesResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TeamInviteResponse } from "./teamInviteResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class TeamInvitesResponse { - "teamInvites": Array; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamInvitesResponse; -} diff --git a/sdks/node/types/model/teamMemberResponse.d.ts b/sdks/node/types/model/teamMemberResponse.d.ts deleted file mode 100644 index dda1369d7..000000000 --- a/sdks/node/types/model/teamMemberResponse.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TeamMemberResponse { - "accountId"?: string; - "emailAddress"?: string; - "role"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamMemberResponse; -} diff --git a/sdks/node/types/model/teamMembersResponse.d.ts b/sdks/node/types/model/teamMembersResponse.d.ts deleted file mode 100644 index d5b56b4dc..000000000 --- a/sdks/node/types/model/teamMembersResponse.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { ListInfoResponse } from "./listInfoResponse"; -import { TeamMemberResponse } from "./teamMemberResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class TeamMembersResponse { - "teamMembers": Array; - "listInfo": ListInfoResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamMembersResponse; -} diff --git a/sdks/node/types/model/teamParentResponse.d.ts b/sdks/node/types/model/teamParentResponse.d.ts deleted file mode 100644 index 209f7a93d..000000000 --- a/sdks/node/types/model/teamParentResponse.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TeamParentResponse { - "teamId"?: string; - "name"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamParentResponse; -} diff --git a/sdks/node/types/model/teamRemoveMemberRequest.d.ts b/sdks/node/types/model/teamRemoveMemberRequest.d.ts deleted file mode 100644 index 758aea1e1..000000000 --- a/sdks/node/types/model/teamRemoveMemberRequest.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TeamRemoveMemberRequest { - "accountId"?: string; - "emailAddress"?: string; - "newOwnerEmailAddress"?: string; - "newTeamId"?: string; - "newRole"?: TeamRemoveMemberRequest.NewRoleEnum; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamRemoveMemberRequest; -} -export declare namespace TeamRemoveMemberRequest { - enum NewRoleEnum { - Member = "Member", - Developer = "Developer", - TeamManager = "Team Manager", - Admin = "Admin" - } -} diff --git a/sdks/node/types/model/teamResponse.d.ts b/sdks/node/types/model/teamResponse.d.ts deleted file mode 100644 index cb7861bd9..000000000 --- a/sdks/node/types/model/teamResponse.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { AccountResponse } from "./accountResponse"; -export declare class TeamResponse { - "name"?: string; - "accounts"?: Array; - "invitedAccounts"?: Array; - "invitedEmails"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamResponse; -} diff --git a/sdks/node/types/model/teamSubTeamsResponse.d.ts b/sdks/node/types/model/teamSubTeamsResponse.d.ts deleted file mode 100644 index ed1b32bf0..000000000 --- a/sdks/node/types/model/teamSubTeamsResponse.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { ListInfoResponse } from "./listInfoResponse"; -import { SubTeamResponse } from "./subTeamResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class TeamSubTeamsResponse { - "subTeams": Array; - "listInfo": ListInfoResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamSubTeamsResponse; -} diff --git a/sdks/node/types/model/teamUpdateRequest.d.ts b/sdks/node/types/model/teamUpdateRequest.d.ts deleted file mode 100644 index 5ebca1aeb..000000000 --- a/sdks/node/types/model/teamUpdateRequest.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TeamUpdateRequest { - "name"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TeamUpdateRequest; -} diff --git a/sdks/node/types/model/templateAddUserRequest.d.ts b/sdks/node/types/model/templateAddUserRequest.d.ts deleted file mode 100644 index ffd7c1e8e..000000000 --- a/sdks/node/types/model/templateAddUserRequest.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TemplateAddUserRequest { - "accountId"?: string; - "emailAddress"?: string; - "skipNotification"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateAddUserRequest; -} diff --git a/sdks/node/types/model/templateCreateEmbeddedDraftRequest.d.ts b/sdks/node/types/model/templateCreateEmbeddedDraftRequest.d.ts deleted file mode 100644 index d6165569c..000000000 --- a/sdks/node/types/model/templateCreateEmbeddedDraftRequest.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubAttachment } from "./subAttachment"; -import { SubEditorOptions } from "./subEditorOptions"; -import { SubFieldOptions } from "./subFieldOptions"; -import { SubFormFieldGroup } from "./subFormFieldGroup"; -import { SubFormFieldRule } from "./subFormFieldRule"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -import { SubMergeField } from "./subMergeField"; -import { SubTemplateRole } from "./subTemplateRole"; -export declare class TemplateCreateEmbeddedDraftRequest { - "clientId": string; - "files"?: Array; - "fileUrls"?: Array; - "allowCcs"?: boolean; - "allowReassign"?: boolean; - "allowFormView"?: boolean; - "attachments"?: Array; - "ccRoles"?: Array; - "editorOptions"?: SubEditorOptions; - "fieldOptions"?: SubFieldOptions; - "forceSignerRoles"?: boolean; - "forceSubjectMessage"?: boolean; - "formFieldGroups"?: Array; - "formFieldRules"?: Array; - "formFieldsPerDocument"?: Array; - "mergeFields"?: Array; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "showPreview"?: boolean; - "showProgressStepper"?: boolean; - "signerRoles"?: Array; - "skipMeNow"?: boolean; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - "usePreexistingFields"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateCreateEmbeddedDraftRequest; -} diff --git a/sdks/node/types/model/templateCreateEmbeddedDraftResponse.d.ts b/sdks/node/types/model/templateCreateEmbeddedDraftResponse.d.ts deleted file mode 100644 index a3897e556..000000000 --- a/sdks/node/types/model/templateCreateEmbeddedDraftResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateCreateEmbeddedDraftResponseTemplate } from "./templateCreateEmbeddedDraftResponseTemplate"; -import { WarningResponse } from "./warningResponse"; -export declare class TemplateCreateEmbeddedDraftResponse { - "template": TemplateCreateEmbeddedDraftResponseTemplate; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateCreateEmbeddedDraftResponse; -} diff --git a/sdks/node/types/model/templateCreateEmbeddedDraftResponseTemplate.d.ts b/sdks/node/types/model/templateCreateEmbeddedDraftResponseTemplate.d.ts deleted file mode 100644 index 7287dbec2..000000000 --- a/sdks/node/types/model/templateCreateEmbeddedDraftResponseTemplate.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { WarningResponse } from "./warningResponse"; -export declare class TemplateCreateEmbeddedDraftResponseTemplate { - "templateId"?: string; - "editUrl"?: string; - "expiresAt"?: number; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateCreateEmbeddedDraftResponseTemplate; -} diff --git a/sdks/node/types/model/templateCreateRequest.d.ts b/sdks/node/types/model/templateCreateRequest.d.ts deleted file mode 100644 index f198ea8de..000000000 --- a/sdks/node/types/model/templateCreateRequest.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubAttachment } from "./subAttachment"; -import { SubFieldOptions } from "./subFieldOptions"; -import { SubFormFieldGroup } from "./subFormFieldGroup"; -import { SubFormFieldRule } from "./subFormFieldRule"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -import { SubMergeField } from "./subMergeField"; -import { SubTemplateRole } from "./subTemplateRole"; -export declare class TemplateCreateRequest { - "formFieldsPerDocument": Array; - "signerRoles": Array; - "files"?: Array; - "fileUrls"?: Array; - "allowReassign"?: boolean; - "allowFormView"?: boolean; - "attachments"?: Array; - "ccRoles"?: Array; - "clientId"?: string; - "fieldOptions"?: SubFieldOptions; - "formFieldGroups"?: Array; - "formFieldRules"?: Array; - "mergeFields"?: Array; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - "usePreexistingFields"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateCreateRequest; -} diff --git a/sdks/node/types/model/templateCreateResponse.d.ts b/sdks/node/types/model/templateCreateResponse.d.ts deleted file mode 100644 index 6dfd9c343..000000000 --- a/sdks/node/types/model/templateCreateResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateCreateResponseTemplate } from "./templateCreateResponseTemplate"; -import { WarningResponse } from "./warningResponse"; -export declare class TemplateCreateResponse { - "template": TemplateCreateResponseTemplate; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateCreateResponse; -} diff --git a/sdks/node/types/model/templateCreateResponseTemplate.d.ts b/sdks/node/types/model/templateCreateResponseTemplate.d.ts deleted file mode 100644 index cc5c4e9a6..000000000 --- a/sdks/node/types/model/templateCreateResponseTemplate.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TemplateCreateResponseTemplate { - "templateId"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateCreateResponseTemplate; -} diff --git a/sdks/node/types/model/templateEditResponse.d.ts b/sdks/node/types/model/templateEditResponse.d.ts deleted file mode 100644 index dba3ddce6..000000000 --- a/sdks/node/types/model/templateEditResponse.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TemplateEditResponse { - "templateId": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateEditResponse; -} diff --git a/sdks/node/types/model/templateGetResponse.d.ts b/sdks/node/types/model/templateGetResponse.d.ts deleted file mode 100644 index 2a2278de7..000000000 --- a/sdks/node/types/model/templateGetResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponse } from "./templateResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class TemplateGetResponse { - "template": TemplateResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateGetResponse; -} diff --git a/sdks/node/types/model/templateListResponse.d.ts b/sdks/node/types/model/templateListResponse.d.ts deleted file mode 100644 index 1f1456d14..000000000 --- a/sdks/node/types/model/templateListResponse.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { ListInfoResponse } from "./listInfoResponse"; -import { TemplateResponse } from "./templateResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class TemplateListResponse { - "templates": Array; - "listInfo": ListInfoResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateListResponse; -} diff --git a/sdks/node/types/model/templateRemoveUserRequest.d.ts b/sdks/node/types/model/templateRemoveUserRequest.d.ts deleted file mode 100644 index 442200ce5..000000000 --- a/sdks/node/types/model/templateRemoveUserRequest.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TemplateRemoveUserRequest { - "accountId"?: string; - "emailAddress"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateRemoveUserRequest; -} diff --git a/sdks/node/types/model/templateResponse.d.ts b/sdks/node/types/model/templateResponse.d.ts deleted file mode 100644 index 34496c128..000000000 --- a/sdks/node/types/model/templateResponse.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SignatureRequestResponseAttachment } from "./signatureRequestResponseAttachment"; -import { TemplateResponseAccount } from "./templateResponseAccount"; -import { TemplateResponseCCRole } from "./templateResponseCCRole"; -import { TemplateResponseDocument } from "./templateResponseDocument"; -import { TemplateResponseDocumentCustomFieldBase } from "./templateResponseDocumentCustomFieldBase"; -import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; -import { TemplateResponseSignerRole } from "./templateResponseSignerRole"; -export declare class TemplateResponse { - "templateId"?: string; - "title"?: string; - "message"?: string; - "updatedAt"?: number; - "isEmbedded"?: boolean | null; - "isCreator"?: boolean; - "canEdit"?: boolean; - "isLocked"?: boolean; - "metadata"?: { - [key: string]: any; - }; - "signerRoles"?: Array; - "ccRoles"?: Array; - "documents"?: Array; - "customFields"?: Array | null; - "namedFormFields"?: Array | null; - "accounts"?: Array; - "attachments"?: Array; - "allowFormView"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponse; -} diff --git a/sdks/node/types/model/templateResponseAccount.d.ts b/sdks/node/types/model/templateResponseAccount.d.ts deleted file mode 100644 index 514cb2550..000000000 --- a/sdks/node/types/model/templateResponseAccount.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseAccountQuota } from "./templateResponseAccountQuota"; -export declare class TemplateResponseAccount { - "accountId"?: string; - "emailAddress"?: string; - "isLocked"?: boolean; - "isPaidHs"?: boolean; - "isPaidHf"?: boolean; - "quotas"?: TemplateResponseAccountQuota; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseAccount; -} diff --git a/sdks/node/types/model/templateResponseAccountQuota.d.ts b/sdks/node/types/model/templateResponseAccountQuota.d.ts deleted file mode 100644 index e8ef0162f..000000000 --- a/sdks/node/types/model/templateResponseAccountQuota.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TemplateResponseAccountQuota { - "templatesLeft"?: number; - "apiSignatureRequestsLeft"?: number; - "documentsLeft"?: number; - "smsVerificationsLeft"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseAccountQuota; -} diff --git a/sdks/node/types/model/templateResponseCCRole.d.ts b/sdks/node/types/model/templateResponseCCRole.d.ts deleted file mode 100644 index ebb6cd371..000000000 --- a/sdks/node/types/model/templateResponseCCRole.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TemplateResponseCCRole { - "name"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseCCRole; -} diff --git a/sdks/node/types/model/templateResponseDocument.d.ts b/sdks/node/types/model/templateResponseDocument.d.ts deleted file mode 100644 index c16b393ed..000000000 --- a/sdks/node/types/model/templateResponseDocument.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentCustomFieldBase } from "./templateResponseDocumentCustomFieldBase"; -import { TemplateResponseDocumentFieldGroup } from "./templateResponseDocumentFieldGroup"; -import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; -import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; -export declare class TemplateResponseDocument { - "name"?: string; - "index"?: number; - "fieldGroups"?: Array; - "formFields"?: Array; - "customFields"?: Array; - "staticFields"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocument; -} diff --git a/sdks/node/types/model/templateResponseDocumentCustomFieldBase.d.ts b/sdks/node/types/model/templateResponseDocumentCustomFieldBase.d.ts deleted file mode 100644 index fa313114d..000000000 --- a/sdks/node/types/model/templateResponseDocumentCustomFieldBase.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare abstract class TemplateResponseDocumentCustomFieldBase { - "type": string; - "apiId"?: string; - "name"?: string; - "signer"?: number | string | null; - "x"?: number; - "y"?: number; - "width"?: number; - "height"?: number; - "required"?: boolean; - "group"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static discriminatorClassName(value: any): string | null; -} diff --git a/sdks/node/types/model/templateResponseDocumentCustomFieldCheckbox.d.ts b/sdks/node/types/model/templateResponseDocumentCustomFieldCheckbox.d.ts deleted file mode 100644 index 19be87a1f..000000000 --- a/sdks/node/types/model/templateResponseDocumentCustomFieldCheckbox.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentCustomFieldBase } from "./templateResponseDocumentCustomFieldBase"; -export declare class TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocumentCustomFieldBase { - "type": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentCustomFieldCheckbox; -} diff --git a/sdks/node/types/model/templateResponseDocumentCustomFieldText.d.ts b/sdks/node/types/model/templateResponseDocumentCustomFieldText.d.ts deleted file mode 100644 index b2d499e48..000000000 --- a/sdks/node/types/model/templateResponseDocumentCustomFieldText.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentCustomFieldBase } from "./templateResponseDocumentCustomFieldBase"; -import { TemplateResponseFieldAvgTextLength } from "./templateResponseFieldAvgTextLength"; -export declare class TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCustomFieldBase { - "type": string; - "avgTextLength"?: TemplateResponseFieldAvgTextLength; - "isMultiline"?: boolean; - "originalFontSize"?: number; - "fontFamily"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentCustomFieldText; -} diff --git a/sdks/node/types/model/templateResponseDocumentFieldGroup.d.ts b/sdks/node/types/model/templateResponseDocumentFieldGroup.d.ts deleted file mode 100644 index d71655df9..000000000 --- a/sdks/node/types/model/templateResponseDocumentFieldGroup.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentFieldGroupRule } from "./templateResponseDocumentFieldGroupRule"; -export declare class TemplateResponseDocumentFieldGroup { - "name"?: string; - "rule"?: TemplateResponseDocumentFieldGroupRule; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentFieldGroup; -} diff --git a/sdks/node/types/model/templateResponseDocumentFieldGroupRule.d.ts b/sdks/node/types/model/templateResponseDocumentFieldGroupRule.d.ts deleted file mode 100644 index 7f23a63d0..000000000 --- a/sdks/node/types/model/templateResponseDocumentFieldGroupRule.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TemplateResponseDocumentFieldGroupRule { - "requirement"?: string; - "groupLabel"?: string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentFieldGroupRule; -} diff --git a/sdks/node/types/model/templateResponseDocumentFormFieldBase.d.ts b/sdks/node/types/model/templateResponseDocumentFormFieldBase.d.ts deleted file mode 100644 index f2ae3c899..000000000 --- a/sdks/node/types/model/templateResponseDocumentFormFieldBase.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare abstract class TemplateResponseDocumentFormFieldBase { - "type": string; - "apiId"?: string; - "name"?: string; - "signer"?: number | string; - "x"?: number; - "y"?: number; - "width"?: number; - "height"?: number; - "required"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static discriminatorClassName(value: any): string | null; -} diff --git a/sdks/node/types/model/templateResponseDocumentFormFieldCheckbox.d.ts b/sdks/node/types/model/templateResponseDocumentFormFieldCheckbox.d.ts deleted file mode 100644 index 40adf3c30..000000000 --- a/sdks/node/types/model/templateResponseDocumentFormFieldCheckbox.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; -export declare class TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocumentFormFieldBase { - "type": string; - "group"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentFormFieldCheckbox; -} diff --git a/sdks/node/types/model/templateResponseDocumentFormFieldDateSigned.d.ts b/sdks/node/types/model/templateResponseDocumentFormFieldDateSigned.d.ts deleted file mode 100644 index d755cb483..000000000 --- a/sdks/node/types/model/templateResponseDocumentFormFieldDateSigned.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; -export declare class TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocumentFormFieldBase { - "type": string; - "group"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentFormFieldDateSigned; -} diff --git a/sdks/node/types/model/templateResponseDocumentFormFieldDropdown.d.ts b/sdks/node/types/model/templateResponseDocumentFormFieldDropdown.d.ts deleted file mode 100644 index b9f96a26f..000000000 --- a/sdks/node/types/model/templateResponseDocumentFormFieldDropdown.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; -export declare class TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocumentFormFieldBase { - "type": string; - "group"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentFormFieldDropdown; -} diff --git a/sdks/node/types/model/templateResponseDocumentFormFieldHyperlink.d.ts b/sdks/node/types/model/templateResponseDocumentFormFieldHyperlink.d.ts deleted file mode 100644 index 856574e09..000000000 --- a/sdks/node/types/model/templateResponseDocumentFormFieldHyperlink.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; -import { TemplateResponseFieldAvgTextLength } from "./templateResponseFieldAvgTextLength"; -export declare class TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumentFormFieldBase { - "type": string; - "avgTextLength"?: TemplateResponseFieldAvgTextLength; - "isMultiline"?: boolean; - "originalFontSize"?: number; - "fontFamily"?: string; - "group"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentFormFieldHyperlink; -} diff --git a/sdks/node/types/model/templateResponseDocumentFormFieldInitials.d.ts b/sdks/node/types/model/templateResponseDocumentFormFieldInitials.d.ts deleted file mode 100644 index 6a1a035f5..000000000 --- a/sdks/node/types/model/templateResponseDocumentFormFieldInitials.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; -export declare class TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocumentFormFieldBase { - "type": string; - "group"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentFormFieldInitials; -} diff --git a/sdks/node/types/model/templateResponseDocumentFormFieldRadio.d.ts b/sdks/node/types/model/templateResponseDocumentFormFieldRadio.d.ts deleted file mode 100644 index e0fc8a2bb..000000000 --- a/sdks/node/types/model/templateResponseDocumentFormFieldRadio.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; -export declare class TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFormFieldBase { - "type": string; - "group": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentFormFieldRadio; -} diff --git a/sdks/node/types/model/templateResponseDocumentFormFieldSignature.d.ts b/sdks/node/types/model/templateResponseDocumentFormFieldSignature.d.ts deleted file mode 100644 index d005bd0ee..000000000 --- a/sdks/node/types/model/templateResponseDocumentFormFieldSignature.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; -export declare class TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumentFormFieldBase { - "type": string; - "group"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentFormFieldSignature; -} diff --git a/sdks/node/types/model/templateResponseDocumentFormFieldText.d.ts b/sdks/node/types/model/templateResponseDocumentFormFieldText.d.ts deleted file mode 100644 index 2509450f9..000000000 --- a/sdks/node/types/model/templateResponseDocumentFormFieldText.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; -import { TemplateResponseFieldAvgTextLength } from "./templateResponseFieldAvgTextLength"; -export declare class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentFormFieldBase { - "type": string; - "avgTextLength"?: TemplateResponseFieldAvgTextLength; - "isMultiline"?: boolean; - "originalFontSize"?: number; - "fontFamily"?: string; - "validationType"?: TemplateResponseDocumentFormFieldText.ValidationTypeEnum; - "validationCustomRegex"?: string | null; - "validationCustomRegexFormatLabel"?: string | null; - "group"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentFormFieldText; -} -export declare namespace TemplateResponseDocumentFormFieldText { - enum ValidationTypeEnum { - NumbersOnly = "numbers_only", - LettersOnly = "letters_only", - PhoneNumber = "phone_number", - BankRoutingNumber = "bank_routing_number", - BankAccountNumber = "bank_account_number", - EmailAddress = "email_address", - ZipCode = "zip_code", - SocialSecurityNumber = "social_security_number", - EmployerIdentificationNumber = "employer_identification_number", - CustomRegex = "custom_regex" - } -} diff --git a/sdks/node/types/model/templateResponseDocumentStaticFieldBase.d.ts b/sdks/node/types/model/templateResponseDocumentStaticFieldBase.d.ts deleted file mode 100644 index 8120739cd..000000000 --- a/sdks/node/types/model/templateResponseDocumentStaticFieldBase.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare abstract class TemplateResponseDocumentStaticFieldBase { - "type": string; - "apiId"?: string; - "name"?: string; - "signer"?: string; - "x"?: number; - "y"?: number; - "width"?: number; - "height"?: number; - "required"?: boolean; - "group"?: string | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static discriminatorClassName(value: any): string | null; -} diff --git a/sdks/node/types/model/templateResponseDocumentStaticFieldCheckbox.d.ts b/sdks/node/types/model/templateResponseDocumentStaticFieldCheckbox.d.ts deleted file mode 100644 index 06cf1c74e..000000000 --- a/sdks/node/types/model/templateResponseDocumentStaticFieldCheckbox.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; -export declare class TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocumentStaticFieldBase { - "type": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentStaticFieldCheckbox; -} diff --git a/sdks/node/types/model/templateResponseDocumentStaticFieldDateSigned.d.ts b/sdks/node/types/model/templateResponseDocumentStaticFieldDateSigned.d.ts deleted file mode 100644 index da1455286..000000000 --- a/sdks/node/types/model/templateResponseDocumentStaticFieldDateSigned.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; -export declare class TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocumentStaticFieldBase { - "type": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentStaticFieldDateSigned; -} diff --git a/sdks/node/types/model/templateResponseDocumentStaticFieldDropdown.d.ts b/sdks/node/types/model/templateResponseDocumentStaticFieldDropdown.d.ts deleted file mode 100644 index b4ce44227..000000000 --- a/sdks/node/types/model/templateResponseDocumentStaticFieldDropdown.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; -export declare class TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocumentStaticFieldBase { - "type": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentStaticFieldDropdown; -} diff --git a/sdks/node/types/model/templateResponseDocumentStaticFieldHyperlink.d.ts b/sdks/node/types/model/templateResponseDocumentStaticFieldHyperlink.d.ts deleted file mode 100644 index d32e087e4..000000000 --- a/sdks/node/types/model/templateResponseDocumentStaticFieldHyperlink.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; -export declare class TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocumentStaticFieldBase { - "type": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentStaticFieldHyperlink; -} diff --git a/sdks/node/types/model/templateResponseDocumentStaticFieldInitials.d.ts b/sdks/node/types/model/templateResponseDocumentStaticFieldInitials.d.ts deleted file mode 100644 index 6ec7bd25c..000000000 --- a/sdks/node/types/model/templateResponseDocumentStaticFieldInitials.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; -export declare class TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocumentStaticFieldBase { - "type": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentStaticFieldInitials; -} diff --git a/sdks/node/types/model/templateResponseDocumentStaticFieldRadio.d.ts b/sdks/node/types/model/templateResponseDocumentStaticFieldRadio.d.ts deleted file mode 100644 index 504f3dbc2..000000000 --- a/sdks/node/types/model/templateResponseDocumentStaticFieldRadio.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; -export declare class TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentStaticFieldBase { - "type": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentStaticFieldRadio; -} diff --git a/sdks/node/types/model/templateResponseDocumentStaticFieldSignature.d.ts b/sdks/node/types/model/templateResponseDocumentStaticFieldSignature.d.ts deleted file mode 100644 index 9523afd31..000000000 --- a/sdks/node/types/model/templateResponseDocumentStaticFieldSignature.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; -export declare class TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocumentStaticFieldBase { - "type": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentStaticFieldSignature; -} diff --git a/sdks/node/types/model/templateResponseDocumentStaticFieldText.d.ts b/sdks/node/types/model/templateResponseDocumentStaticFieldText.d.ts deleted file mode 100644 index 317ba2da0..000000000 --- a/sdks/node/types/model/templateResponseDocumentStaticFieldText.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; -export declare class TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentStaticFieldBase { - "type": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseDocumentStaticFieldText; -} diff --git a/sdks/node/types/model/templateResponseFieldAvgTextLength.d.ts b/sdks/node/types/model/templateResponseFieldAvgTextLength.d.ts deleted file mode 100644 index 811eebeb5..000000000 --- a/sdks/node/types/model/templateResponseFieldAvgTextLength.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TemplateResponseFieldAvgTextLength { - "numLines"?: number; - "numCharsPerLine"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseFieldAvgTextLength; -} diff --git a/sdks/node/types/model/templateResponseSignerRole.d.ts b/sdks/node/types/model/templateResponseSignerRole.d.ts deleted file mode 100644 index ce2cf439d..000000000 --- a/sdks/node/types/model/templateResponseSignerRole.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class TemplateResponseSignerRole { - "name"?: string; - "order"?: number; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateResponseSignerRole; -} diff --git a/sdks/node/types/model/templateUpdateFilesRequest.d.ts b/sdks/node/types/model/templateUpdateFilesRequest.d.ts deleted file mode 100644 index 690367e63..000000000 --- a/sdks/node/types/model/templateUpdateFilesRequest.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -export declare class TemplateUpdateFilesRequest { - "clientId"?: string; - "files"?: Array; - "fileUrls"?: Array; - "message"?: string; - "subject"?: string; - "testMode"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateUpdateFilesRequest; -} diff --git a/sdks/node/types/model/templateUpdateFilesResponse.d.ts b/sdks/node/types/model/templateUpdateFilesResponse.d.ts deleted file mode 100644 index fef82c231..000000000 --- a/sdks/node/types/model/templateUpdateFilesResponse.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { TemplateUpdateFilesResponseTemplate } from "./templateUpdateFilesResponseTemplate"; -export declare class TemplateUpdateFilesResponse { - "template": TemplateUpdateFilesResponseTemplate; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateUpdateFilesResponse; -} diff --git a/sdks/node/types/model/templateUpdateFilesResponseTemplate.d.ts b/sdks/node/types/model/templateUpdateFilesResponseTemplate.d.ts deleted file mode 100644 index b7852797c..000000000 --- a/sdks/node/types/model/templateUpdateFilesResponseTemplate.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { WarningResponse } from "./warningResponse"; -export declare class TemplateUpdateFilesResponseTemplate { - "templateId"?: string; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): TemplateUpdateFilesResponseTemplate; -} diff --git a/sdks/node/types/model/unclaimedDraftCreateEmbeddedRequest.d.ts b/sdks/node/types/model/unclaimedDraftCreateEmbeddedRequest.d.ts deleted file mode 100644 index 3867d6dbc..000000000 --- a/sdks/node/types/model/unclaimedDraftCreateEmbeddedRequest.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubAttachment } from "./subAttachment"; -import { SubCustomField } from "./subCustomField"; -import { SubEditorOptions } from "./subEditorOptions"; -import { SubFieldOptions } from "./subFieldOptions"; -import { SubFormFieldGroup } from "./subFormFieldGroup"; -import { SubFormFieldRule } from "./subFormFieldRule"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -import { SubSigningOptions } from "./subSigningOptions"; -import { SubUnclaimedDraftSigner } from "./subUnclaimedDraftSigner"; -export declare class UnclaimedDraftCreateEmbeddedRequest { - "clientId": string; - "requesterEmailAddress": string; - "files"?: Array; - "fileUrls"?: Array; - "allowCcs"?: boolean; - "allowDecline"?: boolean; - "allowFormView"?: boolean; - "allowReassign"?: boolean; - "attachments"?: Array; - "ccEmailAddresses"?: Array; - "customFields"?: Array; - "editorOptions"?: SubEditorOptions; - "fieldOptions"?: SubFieldOptions; - "forceSignerPage"?: boolean; - "forceSubjectMessage"?: boolean; - "formFieldGroups"?: Array; - "formFieldRules"?: Array; - "formFieldsPerDocument"?: Array; - "hideTextTags"?: boolean; - "holdRequest"?: boolean; - "isForEmbeddedSigning"?: boolean; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "requestingRedirectUrl"?: string; - "showPreview"?: boolean; - "showProgressStepper"?: boolean; - "signers"?: Array; - "signingOptions"?: SubSigningOptions; - "signingRedirectUrl"?: string; - "skipMeNow"?: boolean; - "subject"?: string; - "testMode"?: boolean; - "type"?: UnclaimedDraftCreateEmbeddedRequest.TypeEnum; - "usePreexistingFields"?: boolean; - "useTextTags"?: boolean; - "populateAutoFillFields"?: boolean; - "expiresAt"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): UnclaimedDraftCreateEmbeddedRequest; -} -export declare namespace UnclaimedDraftCreateEmbeddedRequest { - enum TypeEnum { - SendDocument = "send_document", - RequestSignature = "request_signature" - } -} diff --git a/sdks/node/types/model/unclaimedDraftCreateEmbeddedWithTemplateRequest.d.ts b/sdks/node/types/model/unclaimedDraftCreateEmbeddedWithTemplateRequest.d.ts deleted file mode 100644 index 488d294dd..000000000 --- a/sdks/node/types/model/unclaimedDraftCreateEmbeddedWithTemplateRequest.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubCC } from "./subCC"; -import { SubCustomField } from "./subCustomField"; -import { SubEditorOptions } from "./subEditorOptions"; -import { SubFieldOptions } from "./subFieldOptions"; -import { SubSigningOptions } from "./subSigningOptions"; -import { SubUnclaimedDraftTemplateSigner } from "./subUnclaimedDraftTemplateSigner"; -export declare class UnclaimedDraftCreateEmbeddedWithTemplateRequest { - "clientId": string; - "requesterEmailAddress": string; - "templateIds": Array; - "allowDecline"?: boolean; - "allowReassign"?: boolean; - "ccs"?: Array; - "customFields"?: Array; - "editorOptions"?: SubEditorOptions; - "fieldOptions"?: SubFieldOptions; - "files"?: Array; - "fileUrls"?: Array; - "forceSignerRoles"?: boolean; - "forceSubjectMessage"?: boolean; - "holdRequest"?: boolean; - "isForEmbeddedSigning"?: boolean; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "previewOnly"?: boolean; - "requestingRedirectUrl"?: string; - "showPreview"?: boolean; - "showProgressStepper"?: boolean; - "signers"?: Array; - "signingOptions"?: SubSigningOptions; - "signingRedirectUrl"?: string; - "skipMeNow"?: boolean; - "subject"?: string; - "testMode"?: boolean; - "title"?: string; - "populateAutoFillFields"?: boolean; - "allowCcs"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): UnclaimedDraftCreateEmbeddedWithTemplateRequest; -} diff --git a/sdks/node/types/model/unclaimedDraftCreateRequest.d.ts b/sdks/node/types/model/unclaimedDraftCreateRequest.d.ts deleted file mode 100644 index 7dc8008db..000000000 --- a/sdks/node/types/model/unclaimedDraftCreateRequest.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { AttributeTypeMap, RequestFile } from "./"; -import { SubAttachment } from "./subAttachment"; -import { SubCustomField } from "./subCustomField"; -import { SubFieldOptions } from "./subFieldOptions"; -import { SubFormFieldGroup } from "./subFormFieldGroup"; -import { SubFormFieldRule } from "./subFormFieldRule"; -import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; -import { SubSigningOptions } from "./subSigningOptions"; -import { SubUnclaimedDraftSigner } from "./subUnclaimedDraftSigner"; -export declare class UnclaimedDraftCreateRequest { - "type": UnclaimedDraftCreateRequest.TypeEnum; - "files"?: Array; - "fileUrls"?: Array; - "allowDecline"?: boolean; - "allowFormView"?: boolean; - "attachments"?: Array; - "ccEmailAddresses"?: Array; - "clientId"?: string; - "customFields"?: Array; - "fieldOptions"?: SubFieldOptions; - "formFieldGroups"?: Array; - "formFieldRules"?: Array; - "formFieldsPerDocument"?: Array; - "hideTextTags"?: boolean; - "message"?: string; - "metadata"?: { - [key: string]: any; - }; - "showProgressStepper"?: boolean; - "signers"?: Array; - "signingOptions"?: SubSigningOptions; - "signingRedirectUrl"?: string; - "subject"?: string; - "testMode"?: boolean; - "usePreexistingFields"?: boolean; - "useTextTags"?: boolean; - "expiresAt"?: number | null; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): UnclaimedDraftCreateRequest; -} -export declare namespace UnclaimedDraftCreateRequest { - enum TypeEnum { - SendDocument = "send_document", - RequestSignature = "request_signature" - } -} diff --git a/sdks/node/types/model/unclaimedDraftCreateResponse.d.ts b/sdks/node/types/model/unclaimedDraftCreateResponse.d.ts deleted file mode 100644 index 188a52c03..000000000 --- a/sdks/node/types/model/unclaimedDraftCreateResponse.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { UnclaimedDraftResponse } from "./unclaimedDraftResponse"; -import { WarningResponse } from "./warningResponse"; -export declare class UnclaimedDraftCreateResponse { - "unclaimedDraft": UnclaimedDraftResponse; - "warnings"?: Array; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): UnclaimedDraftCreateResponse; -} diff --git a/sdks/node/types/model/unclaimedDraftEditAndResendRequest.d.ts b/sdks/node/types/model/unclaimedDraftEditAndResendRequest.d.ts deleted file mode 100644 index 72baafe6d..000000000 --- a/sdks/node/types/model/unclaimedDraftEditAndResendRequest.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { AttributeTypeMap } from "./"; -import { SubEditorOptions } from "./subEditorOptions"; -export declare class UnclaimedDraftEditAndResendRequest { - "clientId": string; - "editorOptions"?: SubEditorOptions; - "isForEmbeddedSigning"?: boolean; - "requesterEmailAddress"?: string; - "requestingRedirectUrl"?: string; - "showProgressStepper"?: boolean; - "signingRedirectUrl"?: string; - "testMode"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): UnclaimedDraftEditAndResendRequest; -} diff --git a/sdks/node/types/model/unclaimedDraftResponse.d.ts b/sdks/node/types/model/unclaimedDraftResponse.d.ts deleted file mode 100644 index de0af9ed1..000000000 --- a/sdks/node/types/model/unclaimedDraftResponse.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class UnclaimedDraftResponse { - "signatureRequestId"?: string | null; - "claimUrl"?: string; - "signingRedirectUrl"?: string | null; - "requestingRedirectUrl"?: string | null; - "expiresAt"?: number | null; - "testMode"?: boolean; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): UnclaimedDraftResponse; -} diff --git a/sdks/node/types/model/warningResponse.d.ts b/sdks/node/types/model/warningResponse.d.ts deleted file mode 100644 index cdd485a5a..000000000 --- a/sdks/node/types/model/warningResponse.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AttributeTypeMap } from "./"; -export declare class WarningResponse { - "warningMsg": string; - "warningName": string; - static discriminator: string | undefined; - static attributeTypeMap: AttributeTypeMap; - static getAttributeTypeMap(): AttributeTypeMap; - static init(data: any): WarningResponse; -} diff --git a/sdks/php/README.md b/sdks/php/README.md index ddc1ded08..4f6c1c016 100644 --- a/sdks/php/README.md +++ b/sdks/php/README.md @@ -209,6 +209,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | *TemplateApi* | [**templateCreate**](docs/Api/TemplateApi.md#templatecreate) | **POST** /template/create | Create Template | | *TemplateApi* | [**templateCreateEmbeddedDraft**](docs/Api/TemplateApi.md#templatecreateembeddeddraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft | | *TemplateApi* | [**templateDelete**](docs/Api/TemplateApi.md#templatedelete) | **POST** /template/delete/{template_id} | Delete Template | +| *TemplateApi* | [**templateEdit**](docs/Api/TemplateApi.md#templateedit) | **POST** /template/edit/{template_id} | Edit Template | | *TemplateApi* | [**templateFiles**](docs/Api/TemplateApi.md#templatefiles) | **GET** /template/files/{template_id} | Get Template Files | | *TemplateApi* | [**templateFilesAsDataUri**](docs/Api/TemplateApi.md#templatefilesasdatauri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri | | *TemplateApi* | [**templateFilesAsFileUrl**](docs/Api/TemplateApi.md#templatefilesasfileurl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url | @@ -372,7 +373,9 @@ All URIs are relative to *https://api.hellosign.com/v3* - [TemplateCreateRequest](docs/Model/TemplateCreateRequest.md) - [TemplateCreateResponse](docs/Model/TemplateCreateResponse.md) - [TemplateCreateResponseTemplate](docs/Model/TemplateCreateResponseTemplate.md) +- [TemplateEditRequest](docs/Model/TemplateEditRequest.md) - [TemplateEditResponse](docs/Model/TemplateEditResponse.md) +- [TemplateEditResponseTemplate](docs/Model/TemplateEditResponseTemplate.md) - [TemplateGetResponse](docs/Model/TemplateGetResponse.md) - [TemplateListResponse](docs/Model/TemplateListResponse.md) - [TemplateRemoveUserRequest](docs/Model/TemplateRemoveUserRequest.md) diff --git a/sdks/php/docs/Api/TemplateApi.md b/sdks/php/docs/Api/TemplateApi.md index 23d1d5a98..d7a902995 100644 --- a/sdks/php/docs/Api/TemplateApi.md +++ b/sdks/php/docs/Api/TemplateApi.md @@ -8,6 +8,7 @@ All URIs are relative to https://api.hellosign.com/v3. | [**templateCreate()**](TemplateApi.md#templateCreate) | **POST** /template/create | Create Template | | [**templateCreateEmbeddedDraft()**](TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft | | [**templateDelete()**](TemplateApi.md#templateDelete) | **POST** /template/delete/{template_id} | Delete Template | +| [**templateEdit()**](TemplateApi.md#templateEdit) | **POST** /template/edit/{template_id} | Edit Template | | [**templateFiles()**](TemplateApi.md#templateFiles) | **GET** /template/files/{template_id} | Get Template Files | | [**templateFilesAsDataUri()**](TemplateApi.md#templateFilesAsDataUri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri | | [**templateFilesAsFileUrl()**](TemplateApi.md#templateFilesAsFileUrl) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url | @@ -382,6 +383,45 @@ void (empty response body) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) +## `templateEdit()` + +```php +templateEdit($template_id, $template_edit_request): \Dropbox\Sign\Model\TemplateEditResponse +``` +Edit Template + +Edit template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. + +### Example + +```php +REPLACE_ME_WITH_EXAMPLE_FOR__templateEdit_PHP_CODE +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| The ID of the template to update. | | +| **template_edit_request** | [**\Dropbox\Sign\Model\TemplateEditRequest**](../Model/TemplateEditRequest.md)| | | + +### Return type + +[**\Dropbox\Sign\Model\TemplateEditResponse**](../Model/TemplateEditResponse.md) + +### Authorization + +[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: `application/json`, `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + ## `templateFiles()` ```php diff --git a/sdks/php/docs/Model/TemplateEditRequest.md b/sdks/php/docs/Model/TemplateEditRequest.md new file mode 100644 index 000000000..64fa931f1 --- /dev/null +++ b/sdks/php/docs/Model/TemplateEditRequest.md @@ -0,0 +1,15 @@ +# # TemplateEditRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `cc_roles` | ```string[]``` | The CC roles that must be assigned when using the template to send a signature request. | | +| `allow_form_view` | ```bool``` | The CC roles that must be assigned when using the template to send a signature request. If set to `true` all the form fields on template document must have non-empty names. | | +| `title` | ```string``` | The title you want to assign to the SignatureRequest. | | +| `subject` | ```string``` | The new default template email subject. | | +| `message` | ```string``` | The new default template email message. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/TemplateEditResponse.md b/sdks/php/docs/Model/TemplateEditResponse.md index b343db573..419fd40b9 100644 --- a/sdks/php/docs/Model/TemplateEditResponse.md +++ b/sdks/php/docs/Model/TemplateEditResponse.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `template_id`*_required_ | ```string``` | The id of the Template. | | +| `template` | [```\Dropbox\Sign\Model\TemplateEditResponseTemplate```](TemplateEditResponseTemplate.md) | | | +| `warnings` | [```\Dropbox\Sign\Model\WarningResponse[]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/TemplateEditResponseTemplate.md b/sdks/php/docs/Model/TemplateEditResponseTemplate.md new file mode 100644 index 000000000..a3e916451 --- /dev/null +++ b/sdks/php/docs/Model/TemplateEditResponseTemplate.md @@ -0,0 +1,11 @@ +# # TemplateEditResponseTemplate + +Template object with parameters: `template_id`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_id` | ```string``` | The id of the Template. | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/src/Api/TemplateApi.php b/sdks/php/src/Api/TemplateApi.php index 2d39bc886..495258308 100644 --- a/sdks/php/src/Api/TemplateApi.php +++ b/sdks/php/src/Api/TemplateApi.php @@ -82,6 +82,10 @@ class TemplateApi 'templateDelete' => [ 'application/json', ], + 'templateEdit' => [ + 'application/json', + 'multipart/form-data', + ], 'templateFiles' => [ 'application/json', ], @@ -1431,6 +1435,366 @@ public function templateDeleteRequest(string $template_id, string $contentType = ); } + /** + * Operation templateEdit + * + * Edit Template + * + * @param string $template_id The ID of the template to update. (required) + * @param Model\TemplateEditRequest $template_edit_request template_edit_request (required) + * + * @return Model\TemplateEditResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function templateEdit(string $template_id, Model\TemplateEditRequest $template_edit_request) + { + list($response) = $this->templateEditWithHttpInfo($template_id, $template_edit_request); + return $response; + } + + /** + * Operation templateEditWithHttpInfo + * + * Edit Template + * + * @param string $template_id The ID of the template to update. (required) + * @param Model\TemplateEditRequest $template_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateEdit'] to see the possible values for this operation + * + * @return array of Model\TemplateEditResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::templateEdit. This method will eventually become unavailable + */ + public function templateEditWithHttpInfo(string $template_id, Model\TemplateEditRequest $template_edit_request, string $contentType = self::contentTypes['templateEdit'][0]) + { + $request = $this->templateEditRequest($template_id, $template_edit_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; + } + + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TemplateEditResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TemplateEditResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateEditResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string)$request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + + $returnType = '\Dropbox\Sign\Model\TemplateEditResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } catch (ApiException $e) { + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TemplateEditResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation templateEditAsync + * + * Edit Template + * + * @param string $template_id The ID of the template to update. (required) + * @param Model\TemplateEditRequest $template_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateEdit'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::templateEdit. This method will eventually become unavailable + */ + public function templateEditAsync(string $template_id, Model\TemplateEditRequest $template_edit_request, string $contentType = self::contentTypes['templateEdit'][0]) + { + return $this->templateEditAsyncWithHttpInfo($template_id, $template_edit_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation templateEditAsyncWithHttpInfo + * + * Edit Template + * + * @param string $template_id The ID of the template to update. (required) + * @param Model\TemplateEditRequest $template_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateEdit'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::templateEdit. This method will eventually become unavailable + */ + public function templateEditAsyncWithHttpInfo(string $template_id, Model\TemplateEditRequest $template_edit_request, string $contentType = self::contentTypes['templateEdit'][0]) + { + $returnType = '\Dropbox\Sign\Model\TemplateEditResponse'; + $request = $this->templateEditRequest($template_id, $template_edit_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'templateEdit' + * + * @param string $template_id The ID of the template to update. (required) + * @param Model\TemplateEditRequest $template_edit_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateEdit'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::templateEdit. This method will eventually become unavailable + */ + public function templateEditRequest(string $template_id, Model\TemplateEditRequest $template_edit_request, string $contentType = self::contentTypes['templateEdit'][0]) + { + // verify the required parameter 'template_id' is set + if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $template_id when calling templateEdit' + ); + } + + // verify the required parameter 'template_edit_request' is set + if ($template_edit_request === null || (is_array($template_edit_request) && count($template_edit_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $template_edit_request when calling templateEdit' + ); + } + + $resourcePath = '/template/edit/{template_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $template_edit_request + ); + + $multipart = !empty($formParams); + + // path params + if ($template_id !== null) { + $resourcePath = str_replace( + '{template_id}', + ObjectSerializer::toPathValue($template_id), + $resourcePath + ); + } + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) === 0) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_edit_request)); + } else { + $httpBody = $template_edit_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem, + ]; + } + } + // for HTTP post (form) + if (!empty($body)) { + $multipartContents[] = [ + 'name' => 'body', + 'contents' => $body, + 'headers' => ['Content-Type' => 'application/json'], + ]; + } + + if ($payloadHook = $this->config->getPayloadHook()) { + $payloadHook('multipart', $multipartContents, $template_edit_request); + } + $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername())) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ':'); + } + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation templateFiles * diff --git a/sdks/php/src/Model/SubFormFieldRuleAction.php b/sdks/php/src/Model/SubFormFieldRuleAction.php index cb9926586..f4ae41678 100644 --- a/sdks/php/src/Model/SubFormFieldRuleAction.php +++ b/sdks/php/src/Model/SubFormFieldRuleAction.php @@ -239,9 +239,7 @@ public function getModelName() } public const TYPE_CHANGE_FIELD_VISIBILITY = 'change-field-visibility'; - public const TYPE_FIELD_VISIBILITY = self::TYPE_CHANGE_FIELD_VISIBILITY; public const TYPE_CHANGE_GROUP_VISIBILITY = 'change-group-visibility'; - public const TYPE_GROUP_VISIBILITY = self::TYPE_CHANGE_GROUP_VISIBILITY; /** * Gets allowable values of the enum diff --git a/sdks/php/src/Model/TemplateEditRequest.php b/sdks/php/src/Model/TemplateEditRequest.php new file mode 100644 index 000000000..eb2d1f0b5 --- /dev/null +++ b/sdks/php/src/Model/TemplateEditRequest.php @@ -0,0 +1,565 @@ + + */ +class TemplateEditRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TemplateEditRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cc_roles' => 'string[]', + 'allow_form_view' => 'bool', + 'title' => 'string', + 'subject' => 'string', + 'message' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cc_roles' => null, + 'allow_form_view' => null, + 'title' => null, + 'subject' => null, + 'message' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'cc_roles' => false, + 'allow_form_view' => false, + 'title' => false, + 'subject' => false, + 'message' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param bool[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cc_roles' => 'cc_roles', + 'allow_form_view' => 'allow_form_view', + 'title' => 'title', + 'subject' => 'subject', + 'message' => 'message', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cc_roles' => 'setCcRoles', + 'allow_form_view' => 'setAllowFormView', + 'title' => 'setTitle', + 'subject' => 'setSubject', + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cc_roles' => 'getCcRoles', + 'allow_form_view' => 'getAllowFormView', + 'title' => 'getTitle', + 'subject' => 'getSubject', + 'message' => 'getMessage', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('cc_roles', $data ?? [], null); + $this->setIfExists('allow_form_view', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): TemplateEditRequest + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): TemplateEditRequest + { + /** @var TemplateEditRequest */ + return ObjectSerializer::deserialize( + $data, + TemplateEditRequest::class, + ); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string|int|object|array|mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['subject']) && (mb_strlen($this->container['subject']) > 200)) { + $invalidProperties[] = "invalid value for 'subject', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['message']) && (mb_strlen($this->container['message']) > 5000)) { + $invalidProperties[] = "invalid value for 'message', the character length must be smaller than or equal to 5000."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets cc_roles + * + * @return string[]|null + */ + public function getCcRoles() + { + return $this->container['cc_roles']; + } + + /** + * Sets cc_roles + * + * @param string[]|null $cc_roles the CC roles that must be assigned when using the template to send a signature request + * + * @return self + */ + public function setCcRoles(?array $cc_roles) + { + if (is_null($cc_roles)) { + throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); + } + $this->container['cc_roles'] = $cc_roles; + + return $this; + } + + /** + * Gets allow_form_view + * + * @return bool|null + */ + public function getAllowFormView() + { + return $this->container['allow_form_view']; + } + + /** + * Sets allow_form_view + * + * @param bool|null $allow_form_view The CC roles that must be assigned when using the template to send a signature request. If set to `true` all the form fields on template document must have non-empty names. + * + * @return self + */ + public function setAllowFormView(?bool $allow_form_view) + { + if (is_null($allow_form_view)) { + throw new InvalidArgumentException('non-nullable allow_form_view cannot be null'); + } + $this->container['allow_form_view'] = $allow_form_view; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title the title you want to assign to the SignatureRequest + * + * @return self + */ + public function setTitle(?string $title) + { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject the new default template email subject + * + * @return self + */ + public function setSubject(?string $subject) + { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 200) { + throw new InvalidArgumentException('invalid length for $subject when calling TemplateEditRequest., must be smaller than or equal to 200.'); + } + + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message the new default template email message + * + * @return self + */ + public function setMessage(?string $message) + { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { + throw new InvalidArgumentException('invalid length for $message when calling TemplateEditRequest., must be smaller than or equal to 5000.'); + } + + $this->container['message'] = $message; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/php/src/Model/TemplateEditResponse.php b/sdks/php/src/Model/TemplateEditResponse.php index 625024594..825db5d27 100644 --- a/sdks/php/src/Model/TemplateEditResponse.php +++ b/sdks/php/src/Model/TemplateEditResponse.php @@ -57,7 +57,8 @@ class TemplateEditResponse implements ModelInterface, ArrayAccess, JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'template_id' => 'string', + 'template' => '\Dropbox\Sign\Model\TemplateEditResponseTemplate', + 'warnings' => '\Dropbox\Sign\Model\WarningResponse[]', ]; /** @@ -68,7 +69,8 @@ class TemplateEditResponse implements ModelInterface, ArrayAccess, JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'template_id' => null, + 'template' => null, + 'warnings' => null, ]; /** @@ -77,7 +79,8 @@ class TemplateEditResponse implements ModelInterface, ArrayAccess, JsonSerializa * @var bool[] */ protected static array $openAPINullables = [ - 'template_id' => false, + 'template' => false, + 'warnings' => false, ]; /** @@ -158,7 +161,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'template_id' => 'template_id', + 'template' => 'template', + 'warnings' => 'warnings', ]; /** @@ -167,7 +171,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'template_id' => 'setTemplateId', + 'template' => 'setTemplate', + 'warnings' => 'setWarnings', ]; /** @@ -176,7 +181,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'template_id' => 'getTemplateId', + 'template' => 'getTemplate', + 'warnings' => 'getWarnings', ]; /** @@ -235,7 +241,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('template_id', $data ?? [], null); + $this->setIfExists('template', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } /** @@ -281,12 +288,7 @@ private function setIfExists(string $variableName, array $fields, $defaultValue) */ public function listInvalidProperties() { - $invalidProperties = []; - - if ($this->container['template_id'] === null) { - $invalidProperties[] = "'template_id' can't be null"; - } - return $invalidProperties; + return []; } /** @@ -301,28 +303,55 @@ public function valid() } /** - * Gets template_id + * Gets template * - * @return string + * @return TemplateEditResponseTemplate|null + */ + public function getTemplate() + { + return $this->container['template']; + } + + /** + * Sets template + * + * @param TemplateEditResponseTemplate|null $template template + * + * @return self + */ + public function setTemplate(?TemplateEditResponseTemplate $template) + { + if (is_null($template)) { + throw new InvalidArgumentException('non-nullable template cannot be null'); + } + $this->container['template'] = $template; + + return $this; + } + + /** + * Gets warnings + * + * @return WarningResponse[]|null */ - public function getTemplateId() + public function getWarnings() { - return $this->container['template_id']; + return $this->container['warnings']; } /** - * Sets template_id + * Sets warnings * - * @param string $template_id the id of the Template + * @param WarningResponse[]|null $warnings a list of warnings * * @return self */ - public function setTemplateId(string $template_id) + public function setWarnings(?array $warnings) { - if (is_null($template_id)) { - throw new InvalidArgumentException('non-nullable template_id cannot be null'); + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); } - $this->container['template_id'] = $template_id; + $this->container['warnings'] = $warnings; return $this; } diff --git a/sdks/php/src/Model/TemplateEditResponseTemplate.php b/sdks/php/src/Model/TemplateEditResponseTemplate.php new file mode 100644 index 000000000..148989d4e --- /dev/null +++ b/sdks/php/src/Model/TemplateEditResponseTemplate.php @@ -0,0 +1,412 @@ + + */ +class TemplateEditResponseTemplate implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TemplateEditResponseTemplate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'template_id' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'template_id' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template_id' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param bool[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'template_id' => 'template_id', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'template_id' => 'setTemplateId', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'template_id' => 'getTemplateId', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('template_id', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): TemplateEditResponseTemplate + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): TemplateEditResponseTemplate + { + /** @var TemplateEditResponseTemplate */ + return ObjectSerializer::deserialize( + $data, + TemplateEditResponseTemplate::class, + ); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string|int|object|array|mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets template_id + * + * @return string|null + */ + public function getTemplateId() + { + return $this->container['template_id']; + } + + /** + * Sets template_id + * + * @param string|null $template_id the id of the Template + * + * @return self + */ + public function setTemplateId(?string $template_id) + { + if (is_null($template_id)) { + throw new InvalidArgumentException('non-nullable template_id cannot be null'); + } + $this->container['template_id'] = $template_id; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/python/README.md b/sdks/python/README.md index 5c2d67154..c1b44531d 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -165,6 +165,7 @@ Class | Method | HTTP request | Description ```TemplateApi``` | [```template_create```](docs/TemplateApi.md#template_create) | ```POST /template/create``` | Create Template| ```TemplateApi``` | [```template_create_embedded_draft```](docs/TemplateApi.md#template_create_embedded_draft) | ```POST /template/create_embedded_draft``` | Create Embedded Template Draft| ```TemplateApi``` | [```template_delete```](docs/TemplateApi.md#template_delete) | ```POST /template/delete/{template_id}``` | Delete Template| +```TemplateApi``` | [```template_edit```](docs/TemplateApi.md#template_edit) | ```POST /template/edit/{template_id}``` | _t__TemplateEdit::SUMMARY| ```TemplateApi``` | [```template_files```](docs/TemplateApi.md#template_files) | ```GET /template/files/{template_id}``` | Get Template Files| ```TemplateApi``` | [```template_files_as_data_uri```](docs/TemplateApi.md#template_files_as_data_uri) | ```GET /template/files_as_data_uri/{template_id}``` | Get Template Files as Data Uri| ```TemplateApi``` | [```template_files_as_file_url```](docs/TemplateApi.md#template_files_as_file_url) | ```GET /template/files_as_file_url/{template_id}``` | Get Template Files as File Url| @@ -328,7 +329,9 @@ Class | Method | HTTP request | Description - [TemplateCreateRequest](docs/TemplateCreateRequest.md) - [TemplateCreateResponse](docs/TemplateCreateResponse.md) - [TemplateCreateResponseTemplate](docs/TemplateCreateResponseTemplate.md) + - [TemplateEditRequest](docs/TemplateEditRequest.md) - [TemplateEditResponse](docs/TemplateEditResponse.md) + - [TemplateEditResponseTemplate](docs/TemplateEditResponseTemplate.md) - [TemplateGetResponse](docs/TemplateGetResponse.md) - [TemplateListResponse](docs/TemplateListResponse.md) - [TemplateRemoveUserRequest](docs/TemplateRemoveUserRequest.md) diff --git a/sdks/python/docs/TemplateApi.md b/sdks/python/docs/TemplateApi.md index 5ff5a44c8..4a0f67e25 100644 --- a/sdks/python/docs/TemplateApi.md +++ b/sdks/python/docs/TemplateApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description |[```template_create```](TemplateApi.md#template_create) | ```POST /template/create``` | Create Template| |[```template_create_embedded_draft```](TemplateApi.md#template_create_embedded_draft) | ```POST /template/create_embedded_draft``` | Create Embedded Template Draft| |[```template_delete```](TemplateApi.md#template_delete) | ```POST /template/delete/{template_id}``` | Delete Template| +|[```template_edit```](TemplateApi.md#template_edit) | ```POST /template/edit/{template_id}``` | _t__TemplateEdit::SUMMARY| |[```template_files```](TemplateApi.md#template_files) | ```GET /template/files/{template_id}``` | Get Template Files| |[```template_files_as_data_uri```](TemplateApi.md#template_files_as_data_uri) | ```GET /template/files_as_data_uri/{template_id}``` | Get Template Files as Data Uri| |[```template_files_as_file_url```](TemplateApi.md#template_files_as_file_url) | ```GET /template/files_as_file_url/{template_id}``` | Get Template Files as File Url| @@ -418,6 +419,51 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# ```template_edit``` +> ```TemplateEditResponse template_edit(template_id, template_edit_request)``` + +_t__TemplateEdit::SUMMARY + +_t__TemplateEdit::DESCRIPTION + +### Example + +* Basic Authentication (api_key): +* Bearer (JWT) Authentication (oauth2): + +```python +REPLACE_ME_WITH_EXAMPLE_FOR__template_edit_Python_CODE +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `template_id` | **str** | _t__TemplateEdit::TEMPLATE_ID | | +| `template_edit_request` | [**TemplateEditRequest**](TemplateEditRequest.md) | | | + +### Return type + +[**TemplateEditResponse**](TemplateEditResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json, multipart/form-data + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # ```template_files``` > ```io.IOBase template_files(template_id)``` diff --git a/sdks/python/docs/TemplateEditRequest.md b/sdks/python/docs/TemplateEditRequest.md new file mode 100644 index 000000000..d9673b2f7 --- /dev/null +++ b/sdks/python/docs/TemplateEditRequest.md @@ -0,0 +1,16 @@ +# TemplateEditRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `cc_roles` | ```List[str]``` | _t__TemplateEdit::CC_ROLES | | +| `allow_form_view` | ```bool``` | _t__TemplateEdit::ALLOW_FORM_VIEW | | +| `title` | ```str``` | _t__TemplateEdit::TITLE | | +| `subject` | ```str``` | _t__TemplateEdit::SUBJECT | | +| `message` | ```str``` | _t__TemplateEdit::MESSAGE | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdks/python/docs/TemplateEditResponse.md b/sdks/python/docs/TemplateEditResponse.md index 2384cb094..4d3e3c87b 100644 --- a/sdks/python/docs/TemplateEditResponse.md +++ b/sdks/python/docs/TemplateEditResponse.md @@ -5,7 +5,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `template_id`*_required_ | ```str``` | The id of the Template. | | +| `template` | [```TemplateEditResponseTemplate```](TemplateEditResponseTemplate.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/python/docs/TemplateEditResponseTemplate.md b/sdks/python/docs/TemplateEditResponseTemplate.md new file mode 100644 index 000000000..00c4d1cf1 --- /dev/null +++ b/sdks/python/docs/TemplateEditResponseTemplate.md @@ -0,0 +1,12 @@ +# TemplateEditResponseTemplate + +_t__TemplateEditResponseTemplate::DESCRIPTION + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_id` | ```str``` | The id of the Template. | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdks/python/dropbox_sign/__init__.py b/sdks/python/dropbox_sign/__init__.py index 82a36a10d..eaadd7b6b 100644 --- a/sdks/python/dropbox_sign/__init__.py +++ b/sdks/python/dropbox_sign/__init__.py @@ -306,7 +306,11 @@ from dropbox_sign.models.template_create_response_template import ( TemplateCreateResponseTemplate, ) +from dropbox_sign.models.template_edit_request import TemplateEditRequest from dropbox_sign.models.template_edit_response import TemplateEditResponse +from dropbox_sign.models.template_edit_response_template import ( + TemplateEditResponseTemplate, +) from dropbox_sign.models.template_get_response import TemplateGetResponse from dropbox_sign.models.template_list_response import TemplateListResponse from dropbox_sign.models.template_remove_user_request import TemplateRemoveUserRequest diff --git a/sdks/python/dropbox_sign/api/template_api.py b/sdks/python/dropbox_sign/api/template_api.py index 3205675ea..ac5af8650 100644 --- a/sdks/python/dropbox_sign/api/template_api.py +++ b/sdks/python/dropbox_sign/api/template_api.py @@ -31,6 +31,8 @@ ) from dropbox_sign.models.template_create_request import TemplateCreateRequest from dropbox_sign.models.template_create_response import TemplateCreateResponse +from dropbox_sign.models.template_edit_request import TemplateEditRequest +from dropbox_sign.models.template_edit_response import TemplateEditResponse from dropbox_sign.models.template_get_response import TemplateGetResponse from dropbox_sign.models.template_list_response import TemplateListResponse from dropbox_sign.models.template_remove_user_request import TemplateRemoveUserRequest @@ -1163,6 +1165,304 @@ def _template_delete_serialize( _request_auth=_request_auth, ) + @validate_call + def template_edit( + self, + template_id: Annotated[ + StrictStr, Field(description="_t__TemplateEdit::TEMPLATE_ID") + ], + template_edit_request: TemplateEditRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TemplateEditResponse: + """_t__TemplateEdit::SUMMARY + + _t__TemplateEdit::DESCRIPTION + + :param template_id: _t__TemplateEdit::TEMPLATE_ID (required) + :type template_id: str + :param template_edit_request: (required) + :type template_edit_request: TemplateEditRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_edit_serialize( + template_id=template_id, + template_edit_request=template_edit_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TemplateEditResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def template_edit_with_http_info( + self, + template_id: Annotated[ + StrictStr, Field(description="_t__TemplateEdit::TEMPLATE_ID") + ], + template_edit_request: TemplateEditRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplateEditResponse]: + """_t__TemplateEdit::SUMMARY + + _t__TemplateEdit::DESCRIPTION + + :param template_id: _t__TemplateEdit::TEMPLATE_ID (required) + :type template_id: str + :param template_edit_request: (required) + :type template_edit_request: TemplateEditRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_edit_serialize( + template_id=template_id, + template_edit_request=template_edit_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TemplateEditResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def template_edit_without_preload_content( + self, + template_id: Annotated[ + StrictStr, Field(description="_t__TemplateEdit::TEMPLATE_ID") + ], + template_edit_request: TemplateEditRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """_t__TemplateEdit::SUMMARY + + _t__TemplateEdit::DESCRIPTION + + :param template_id: _t__TemplateEdit::TEMPLATE_ID (required) + :type template_id: str + :param template_edit_request: (required) + :type template_edit_request: TemplateEditRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_edit_serialize( + template_id=template_id, + template_edit_request=template_edit_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TemplateEditResponse", + "4XX": "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _template_edit_serialize( + self, + template_id, + template_edit_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = template_edit_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f"{param_name}[{index}]"] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if template_id is not None: + _path_params["template_id"] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if template_edit_request is not None and has_files is False: + _body_params = template_edit_request + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json", "multipart/form-data"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["api_key", "oauth2"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/template/edit/{template_id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + @validate_call def template_files( self, diff --git a/sdks/python/dropbox_sign/models/__init__.py b/sdks/python/dropbox_sign/models/__init__.py index fd5331ae1..2bcff7837 100644 --- a/sdks/python/dropbox_sign/models/__init__.py +++ b/sdks/python/dropbox_sign/models/__init__.py @@ -289,7 +289,11 @@ from dropbox_sign.models.template_create_response_template import ( TemplateCreateResponseTemplate, ) +from dropbox_sign.models.template_edit_request import TemplateEditRequest from dropbox_sign.models.template_edit_response import TemplateEditResponse +from dropbox_sign.models.template_edit_response_template import ( + TemplateEditResponseTemplate, +) from dropbox_sign.models.template_get_response import TemplateGetResponse from dropbox_sign.models.template_list_response import TemplateListResponse from dropbox_sign.models.template_remove_user_request import TemplateRemoveUserRequest diff --git a/sdks/python/dropbox_sign/models/template_edit_request.py b/sdks/python/dropbox_sign/models/template_edit_request.py new file mode 100644 index 000000000..f4f6558ca --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_edit_request.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" +Dropbox Sign API + +Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from typing import Tuple, Union +import io +from pydantic import StrictBool + + +class TemplateEditRequest(BaseModel): + """ + TemplateEditRequest + """ # noqa: E501 + + cc_roles: Optional[List[StrictStr]] = Field( + default=None, description="_t__TemplateEdit::CC_ROLES" + ) + allow_form_view: Optional[StrictBool] = Field( + default=None, description="_t__TemplateEdit::ALLOW_FORM_VIEW" + ) + title: Optional[StrictStr] = Field( + default=None, description="_t__TemplateEdit::TITLE" + ) + subject: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( + default=None, description="_t__TemplateEdit::SUBJECT" + ) + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field( + default=None, description="_t__TemplateEdit::MESSAGE" + ) + __properties: ClassVar[List[str]] = [ + "cc_roles", + "allow_form_view", + "title", + "subject", + "message", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params( + self, excluded_fields: Set[str] = None + ) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateEditRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateEditRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "cc_roles": obj.get("cc_roles"), + "allow_form_view": obj.get("allow_form_view"), + "title": obj.get("title"), + "subject": obj.get("subject"), + "message": obj.get("message"), + } + ) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "cc_roles": "(List[str],)", + "allow_form_view": "(bool,)", + "title": "(str,)", + "subject": "(str,)", + "message": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "cc_roles", + ] diff --git a/sdks/python/dropbox_sign/models/template_edit_response.py b/sdks/python/dropbox_sign/models/template_edit_response.py index 198813848..2f903429e 100644 --- a/sdks/python/dropbox_sign/models/template_edit_response.py +++ b/sdks/python/dropbox_sign/models/template_edit_response.py @@ -18,8 +18,12 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_edit_response_template import ( + TemplateEditResponseTemplate, +) +from dropbox_sign.models.warning_response import WarningResponse from typing import Optional, Set from typing_extensions import Self from typing import Tuple, Union @@ -32,8 +36,11 @@ class TemplateEditResponse(BaseModel): TemplateEditResponse """ # noqa: E501 - template_id: StrictStr = Field(description="The id of the Template.") - __properties: ClassVar[List[str]] = ["template_id"] + template: Optional[TemplateEditResponseTemplate] = None + warnings: Optional[List[WarningResponse]] = Field( + default=None, description="A list of warnings." + ) + __properties: ClassVar[List[str]] = ["template", "warnings"] model_config = ConfigDict( populate_by_name=True, @@ -85,6 +92,16 @@ def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of template + if self.template: + _dict["template"] = self.template.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict["warnings"] = _items return _dict @classmethod @@ -96,7 +113,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"template_id": obj.get("template_id")}) + _obj = cls.model_validate( + { + "template": ( + TemplateEditResponseTemplate.from_dict(obj["template"]) + if obj.get("template") is not None + else None + ), + "warnings": ( + [WarningResponse.from_dict(_item) for _item in obj["warnings"]] + if obj.get("warnings") is not None + else None + ), + } + ) return _obj @classmethod @@ -112,9 +142,12 @@ def init(cls, data: Any) -> Self: @classmethod def openapi_types(cls) -> Dict[str, str]: return { - "template_id": "(str,)", + "template": "(TemplateEditResponseTemplate,)", + "warnings": "(List[WarningResponse],)", } @classmethod def openapi_type_is_array(cls, property_name: str) -> bool: - return property_name in [] + return property_name in [ + "warnings", + ] diff --git a/sdks/python/dropbox_sign/models/template_edit_response_template.py b/sdks/python/dropbox_sign/models/template_edit_response_template.py new file mode 100644 index 000000000..adba6bb4a --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_edit_response_template.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" +Dropbox Sign API + +Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from typing import Tuple, Union +import io +from pydantic import StrictBool + + +class TemplateEditResponseTemplate(BaseModel): + """ + _t__TemplateEditResponseTemplate::DESCRIPTION + """ # noqa: E501 + + template_id: Optional[StrictStr] = Field( + default=None, description="The id of the Template." + ) + __properties: ClassVar[List[str]] = ["template_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params( + self, excluded_fields: Set[str] = None + ) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateEditResponseTemplate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateEditResponseTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"template_id": obj.get("template_id")}) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [] diff --git a/sdks/ruby/README.md b/sdks/ruby/README.md index 2e973be17..14e07d740 100644 --- a/sdks/ruby/README.md +++ b/sdks/ruby/README.md @@ -169,6 +169,7 @@ All URIs are relative to *https://api.hellosign.com/v3* |*Dropbox::Sign::TemplateApi* | [**template_create**](docs/TemplateApi.md#template_create) | **POST** /template/create | Create Template | |*Dropbox::Sign::TemplateApi* | [**template_create_embedded_draft**](docs/TemplateApi.md#template_create_embedded_draft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft | |*Dropbox::Sign::TemplateApi* | [**template_delete**](docs/TemplateApi.md#template_delete) | **POST** /template/delete/{template_id} | Delete Template | +|*Dropbox::Sign::TemplateApi* | [**template_edit**](docs/TemplateApi.md#template_edit) | **POST** /template/edit/{template_id} | _t__TemplateEdit::SUMMARY | |*Dropbox::Sign::TemplateApi* | [**template_files**](docs/TemplateApi.md#template_files) | **GET** /template/files/{template_id} | Get Template Files | |*Dropbox::Sign::TemplateApi* | [**template_files_as_data_uri**](docs/TemplateApi.md#template_files_as_data_uri) | **GET** /template/files_as_data_uri/{template_id} | Get Template Files as Data Uri | |*Dropbox::Sign::TemplateApi* | [**template_files_as_file_url**](docs/TemplateApi.md#template_files_as_file_url) | **GET** /template/files_as_file_url/{template_id} | Get Template Files as File Url | @@ -332,7 +333,9 @@ All URIs are relative to *https://api.hellosign.com/v3* - [Dropbox::Sign::TemplateCreateRequest](docs/TemplateCreateRequest.md) - [Dropbox::Sign::TemplateCreateResponse](docs/TemplateCreateResponse.md) - [Dropbox::Sign::TemplateCreateResponseTemplate](docs/TemplateCreateResponseTemplate.md) + - [Dropbox::Sign::TemplateEditRequest](docs/TemplateEditRequest.md) - [Dropbox::Sign::TemplateEditResponse](docs/TemplateEditResponse.md) + - [Dropbox::Sign::TemplateEditResponseTemplate](docs/TemplateEditResponseTemplate.md) - [Dropbox::Sign::TemplateGetResponse](docs/TemplateGetResponse.md) - [Dropbox::Sign::TemplateListResponse](docs/TemplateListResponse.md) - [Dropbox::Sign::TemplateRemoveUserRequest](docs/TemplateRemoveUserRequest.md) diff --git a/sdks/ruby/docs/TemplateApi.md b/sdks/ruby/docs/TemplateApi.md index 315ced97c..db62a3997 100644 --- a/sdks/ruby/docs/TemplateApi.md +++ b/sdks/ruby/docs/TemplateApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [`template_create`](TemplateApi.md#template_create) | **POST** `/template/create` | Create Template | | [`template_create_embedded_draft`](TemplateApi.md#template_create_embedded_draft) | **POST** `/template/create_embedded_draft` | Create Embedded Template Draft | | [`template_delete`](TemplateApi.md#template_delete) | **POST** `/template/delete/{template_id}` | Delete Template | +| [`template_edit`](TemplateApi.md#template_edit) | **POST** `/template/edit/{template_id}` | _t__TemplateEdit::SUMMARY | | [`template_files`](TemplateApi.md#template_files) | **GET** `/template/files/{template_id}` | Get Template Files | | [`template_files_as_data_uri`](TemplateApi.md#template_files_as_data_uri) | **GET** `/template/files_as_data_uri/{template_id}` | Get Template Files as Data Uri | | [`template_files_as_file_url`](TemplateApi.md#template_files_as_file_url) | **GET** `/template/files_as_file_url/{template_id}` | Get Template Files as File Url | @@ -420,6 +421,59 @@ nil (empty response body) - **Accept**: application/json +## `template_edit` + +> ` template_edit(template_id, template_edit_request)` + +_t__TemplateEdit::SUMMARY + +_t__TemplateEdit::DESCRIPTION + +### Examples + +```ruby +REPLACE_ME_WITH_EXAMPLE_FOR__template_edit_Ruby_CODE +``` + +#### Using the `template_edit_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> template_edit_with_http_info(template_id, template_edit_request)` + +```ruby +begin + # _t__TemplateEdit::SUMMARY + data, status_code, headers = api_instance.template_edit_with_http_info(template_id, template_edit_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling TemplateApi->template_edit_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `template_id` | **String** | _t__TemplateEdit::TEMPLATE_ID | | +| `template_edit_request` | [**TemplateEditRequest**](TemplateEditRequest.md) | | | + +### Return type + +[**TemplateEditResponse**](TemplateEditResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json, multipart/form-data +- **Accept**: application/json + + ## `template_files` > `File template_files(template_id, opts)` diff --git a/sdks/ruby/docs/TemplateEditRequest.md b/sdks/ruby/docs/TemplateEditRequest.md new file mode 100644 index 000000000..768758a57 --- /dev/null +++ b/sdks/ruby/docs/TemplateEditRequest.md @@ -0,0 +1,14 @@ +# Dropbox::Sign::TemplateEditRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `cc_roles` | ```Array``` | _t__TemplateEdit::CC_ROLES | | +| `allow_form_view` | ```Boolean``` | _t__TemplateEdit::ALLOW_FORM_VIEW | | +| `title` | ```String``` | _t__TemplateEdit::TITLE | | +| `subject` | ```String``` | _t__TemplateEdit::SUBJECT | | +| `message` | ```String``` | _t__TemplateEdit::MESSAGE | | + diff --git a/sdks/ruby/docs/TemplateEditResponse.md b/sdks/ruby/docs/TemplateEditResponse.md index 5b46080d2..fe47393f3 100644 --- a/sdks/ruby/docs/TemplateEditResponse.md +++ b/sdks/ruby/docs/TemplateEditResponse.md @@ -6,5 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `template_id`*_required_ | ```String``` | The id of the Template. | | +| `template` | [```TemplateEditResponseTemplate```](TemplateEditResponseTemplate.md) | | | +| `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/TemplateEditResponseTemplate.md b/sdks/ruby/docs/TemplateEditResponseTemplate.md new file mode 100644 index 000000000..d14533b34 --- /dev/null +++ b/sdks/ruby/docs/TemplateEditResponseTemplate.md @@ -0,0 +1,10 @@ +# Dropbox::Sign::TemplateEditResponseTemplate + +_t__TemplateEditResponseTemplate::DESCRIPTION + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `template_id` | ```String``` | The id of the Template. | | + diff --git a/sdks/ruby/lib/dropbox-sign.rb b/sdks/ruby/lib/dropbox-sign.rb index 413c293c8..932132757 100644 --- a/sdks/ruby/lib/dropbox-sign.rb +++ b/sdks/ruby/lib/dropbox-sign.rb @@ -144,7 +144,9 @@ require 'dropbox-sign/models/template_create_request' require 'dropbox-sign/models/template_create_response' require 'dropbox-sign/models/template_create_response_template' +require 'dropbox-sign/models/template_edit_request' require 'dropbox-sign/models/template_edit_response' +require 'dropbox-sign/models/template_edit_response_template' require 'dropbox-sign/models/template_get_response' require 'dropbox-sign/models/template_list_response' require 'dropbox-sign/models/template_remove_user_request' diff --git a/sdks/ruby/lib/dropbox-sign/api/template_api.rb b/sdks/ruby/lib/dropbox-sign/api/template_api.rb index 4620ab332..2531bfa71 100644 --- a/sdks/ruby/lib/dropbox-sign/api/template_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/template_api.rb @@ -422,6 +422,121 @@ def template_delete_with_http_info(template_id, opts = {}) return data, status_code, headers end + # _t__TemplateEdit::SUMMARY + # _t__TemplateEdit::DESCRIPTION + # @param template_id [String] _t__TemplateEdit::TEMPLATE_ID + # @param template_edit_request [TemplateEditRequest] + # @param [Hash] opts the optional parameters + # @return [TemplateEditResponse] + def template_edit(template_id, template_edit_request, opts = {}) + data, _status_code, _headers = template_edit_with_http_info(template_id, template_edit_request, opts) + data + end + + # _t__TemplateEdit::SUMMARY + # _t__TemplateEdit::DESCRIPTION + # @param template_id [String] _t__TemplateEdit::TEMPLATE_ID + # @param template_edit_request [TemplateEditRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(TemplateEditResponse, Integer, Hash)>] TemplateEditResponse data, response status code and response headers + def template_edit_with_http_info(template_id, template_edit_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TemplateApi.template_edit ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplateApi.template_edit" + end + # verify the required parameter 'template_edit_request' is set + if @api_client.config.client_side_validation && template_edit_request.nil? + fail ArgumentError, "Missing the required parameter 'template_edit_request' when calling TemplateApi.template_edit" + end + # resource path + local_var_path = '/template/edit/{template_id}'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + post_body = {} + form_params = opts[:form_params] || {} + result = @api_client.generate_form_data( + template_edit_request, + Dropbox::Sign::TemplateEditRequest.openapi_types + ) + + # form parameters + if result[:has_file] + form_params = opts[:form_params] || result[:params] + header_params['Content-Type'] = 'multipart/form-data' + else + # http body (model) + post_body = opts[:debug_body] || result[:params] + end + + # return_type + return_type = opts[:debug_return_type] || 'TemplateEditResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] + + new_options = opts.merge( + :operation => :"TemplateApi.template_edit", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + begin + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + rescue Dropbox::Sign::ApiError => e + if e.code === 200 + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::TemplateEditResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + range_code = "4XX".split('').first + range_code_left = "#{range_code}00".to_i + range_code_right = "#{range_code}99".to_i + if e.code >= range_code_left && e.code <= range_code_right + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::ErrorResponse" + ) + + fail ApiError.new(:code => e.code, + :response_headers => e.response_headers, + :response_body => body), + e.message + end + + end + + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TemplateApi#template_edit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get Template Files # Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. # @param template_id [String] The id of the template files to retrieve. diff --git a/sdks/ruby/lib/dropbox-sign/models/template_edit_request.rb b/sdks/ruby/lib/dropbox-sign/models/template_edit_request.rb new file mode 100644 index 000000000..cc828e35f --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/template_edit_request.rb @@ -0,0 +1,328 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + class TemplateEditRequest + # _t__TemplateEdit::CC_ROLES + # @return [Array] + attr_accessor :cc_roles + + # _t__TemplateEdit::ALLOW_FORM_VIEW + # @return [Boolean] + attr_accessor :allow_form_view + + # _t__TemplateEdit::TITLE + # @return [String] + attr_accessor :title + + # _t__TemplateEdit::SUBJECT + # @return [String] + attr_accessor :subject + + # _t__TemplateEdit::MESSAGE + # @return [String] + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'cc_roles' => :'cc_roles', + :'allow_form_view' => :'allow_form_view', + :'title' => :'title', + :'subject' => :'subject', + :'message' => :'message' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'cc_roles' => :'Array', + :'allow_form_view' => :'Boolean', + :'title' => :'String', + :'subject' => :'String', + :'message' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Returns attribute map of this model + parent + def self.merged_attributes + self.attribute_map + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.openapi_types + end + + # Returns list of attributes with nullable: true of this model + parent + def self.merged_nullable + self.openapi_nullable + end + + # Attempt to instantiate and hydrate a new instance of this class + # @param [Object] data Data to be converted + # @return [TemplateEditRequest] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "TemplateEditRequest" + ) || TemplateEditRequest.new + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::TemplateEditRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::TemplateEditRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'cc_roles') + if (value = attributes[:'cc_roles']).is_a?(Array) + self.cc_roles = value + end + end + + if attributes.key?(:'allow_form_view') + self.allow_form_view = attributes[:'allow_form_view'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@subject.nil? && @subject.to_s.length > 200 + invalid_properties.push('invalid value for "subject", the character length must be smaller than or equal to 200.') + end + + if !@message.nil? && @message.to_s.length > 5000 + invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 5000.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@subject.nil? && @subject.to_s.length > 200 + return false if !@message.nil? && @message.to_s.length > 5000 + true + end + + # Custom attribute writer method with validation + # @param [Object] subject Value to be assigned + def subject=(subject) + if subject.to_s.length > 200 + fail ArgumentError, 'invalid value for "subject", the character length must be smaller than or equal to 200.' + end + + @subject = subject + end + + # Custom attribute writer method with validation + # @param [Object] message Value to be assigned + def message=(message) + if message.to_s.length > 5000 + fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 5000.' + end + + @message = message + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cc_roles == o.cc_roles && + allow_form_view == o.allow_form_view && + title == o.title && + subject == o.subject && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [cc_roles, allow_form_view, title, subject, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attribute_map = self.class.merged_attributes + + self.class.merged_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + klass = Dropbox::Sign.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash(include_nil = true) + hash = {} + self.class.merged_attributes.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + next unless include_nil + is_nullable = self.class.merged_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value, include_nil) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value, include_nil = true) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v, include_nil) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v, include_nil) } + end + elsif value.respond_to? :to_hash + value.to_hash(include_nil) + else + value + end + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/template_edit_response.rb b/sdks/ruby/lib/dropbox-sign/models/template_edit_response.rb index 9a4996745..888f4fad9 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_edit_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_edit_response.rb @@ -18,14 +18,18 @@ module Dropbox module Dropbox::Sign class TemplateEditResponse - # The id of the Template. - # @return [String] - attr_accessor :template_id + # @return [TemplateEditResponseTemplate] + attr_accessor :template + + # A list of warnings. + # @return [Array] + attr_accessor :warnings # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'template_id' => :'template_id' + :'template' => :'template', + :'warnings' => :'warnings' } end @@ -42,7 +46,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'template_id' => :'String' + :'template' => :'TemplateEditResponseTemplate', + :'warnings' => :'Array' } end @@ -93,8 +98,14 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'template_id') - self.template_id = attributes[:'template_id'] + if attributes.key?(:'template') + self.template = attributes[:'template'] + end + + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end end end @@ -102,36 +113,22 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if @template_id.nil? - invalid_properties.push('invalid value for "template_id", template_id cannot be nil.') - end - invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - return false if @template_id.nil? true end - # Custom attribute writer method with validation - # @param [Object] template_id Value to be assigned - def template_id=(template_id) - if template_id.nil? - fail ArgumentError, 'template_id cannot be nil' - end - - @template_id = template_id - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - template_id == o.template_id + template == o.template && + warnings == o.warnings end # @see the `==` method @@ -143,7 +140,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [template_id].hash + [template, warnings].hash end # Builds the object from hash diff --git a/sdks/ruby/lib/dropbox-sign/models/template_edit_response_template.rb b/sdks/ruby/lib/dropbox-sign/models/template_edit_response_template.rb new file mode 100644 index 000000000..d652ace12 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/template_edit_response_template.rb @@ -0,0 +1,253 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + # _t__TemplateEditResponseTemplate::DESCRIPTION + class TemplateEditResponseTemplate + # The id of the Template. + # @return [String] + attr_accessor :template_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'template_id' => :'template_id' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'template_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Returns attribute map of this model + parent + def self.merged_attributes + self.attribute_map + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.openapi_types + end + + # Returns list of attributes with nullable: true of this model + parent + def self.merged_nullable + self.openapi_nullable + end + + # Attempt to instantiate and hydrate a new instance of this class + # @param [Object] data Data to be converted + # @return [TemplateEditResponseTemplate] + def self.init(data) + ApiClient.default.convert_to_type( + data, + "TemplateEditResponseTemplate" + ) || TemplateEditResponseTemplate.new + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Dropbox::Sign::TemplateEditResponseTemplate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.merged_attributes.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Dropbox::Sign::TemplateEditResponseTemplate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'template_id') + self.template_id = attributes[:'template_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + template_id == o.template_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [template_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attribute_map = self.class.merged_attributes + + self.class.merged_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + klass = Dropbox::Sign.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash(include_nil = true) + hash = {} + self.class.merged_attributes.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + next unless include_nil + is_nullable = self.class.merged_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value, include_nil) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value, include_nil = true) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v, include_nil) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v, include_nil) } + end + elsif value.respond_to? :to_hash + value.to_hash(include_nil) + else + value + end + end + end +end diff --git a/test_fixtures/TemplateEditRequest.json b/test_fixtures/TemplateEditRequest.json new file mode 100644 index 000000000..fb4d2017d --- /dev/null +++ b/test_fixtures/TemplateEditRequest.json @@ -0,0 +1,9 @@ +{ + "default": { + "allow_form_view": false, + "title": "Test Title", + "subject": "Test Subject", + "message": "Test Message", + "cc_roles": ["one", "two"] + } +} \ No newline at end of file diff --git a/test_fixtures/TemplateEditResponse.json b/test_fixtures/TemplateEditResponse.json new file mode 100644 index 000000000..46b48504a --- /dev/null +++ b/test_fixtures/TemplateEditResponse.json @@ -0,0 +1,7 @@ +{ + "default": { + "template": { + "template_id": "21f920ec2b7f4b6bb64d3ed79f26303843046536" + } + } +} \ No newline at end of file diff --git a/translations/en.yaml b/translations/en.yaml index 4099e33e9..72bc9b434 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -805,6 +805,18 @@ "TemplateUpdateFiles::TEMPLATE_ID": The ID of the template whose files to update. "TemplateUpdateFiles::TEST_MODE": Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. +"TemplateEdit::SUMMARY": Edit Template +"TemplateEdit::DESCRIPTION": Edit template fields. Every field is optional and the endpoint will only change whatever is provided. The fields not included in the request payload will remain unchanged. +"TemplateEdit::TEMPLATE_ID": The ID of the template to update. +"TemplateEdit::CC_ROLES": The CC roles that must be assigned when using the template to send a signature request. +"TemplateEdit::ALLOW_FORM_VIEW": "The CC roles that must be assigned when using the template to send a signature request. If set to `true` all the form fields on template document must have non-empty names." +"TemplateEdit::TITLE": The title you want to assign to the SignatureRequest. +"TemplateEdit::SUBJECT": The new default template email subject. +"TemplateEdit::MESSAGE": The new default template email message. +"TemplateEditResponseTemplate::DESCRIPTION": "Template object with parameters: `template_id`." +"TemplateEditRequestExample::SUMMARY": Edit template request example +"TemplateEditResponseExample::SUMMARY": Edit template response example. + "UnclaimedDraftCreate::SUMMARY": Create Unclaimed Draft "UnclaimedDraftCreate::DESCRIPTION": Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the "Sign and send" or the "Request signature" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. "UnclaimedDraftCreate::ALLOW_DECLINE": Allows signers to decline to sign a document if `true`. Defaults to `false`.